From b3204f95d9c836db4549decf7abe9e3a0c5e544f Mon Sep 17 00:00:00 2001 From: Uday Patil Date: Mon, 8 Jul 2024 10:30:28 -0500 Subject: [PATCH] Deprecate dex (#1686) * Remove CPUFeature panic * Add dex list all contract info query * Update tests and add max gas allowed * Remove dex usages and register module removal upgrade * Update CI and other usages to remove dex * fix ignite * remove dex mention * update test * Update sei-cosmos and fix test * Update sei-cosmos tag * Update the store removal upgrade name --------- Co-authored-by: codchen --- .github/workflows/fuzz.yml | 40 - aclmapping/bank/mappings.go | 1 - aclmapping/dependency_generator.go | 2 - aclmapping/dex/mappings.go | 229 - aclmapping/dex/mappings_test.go | 292 - aclmapping/utils/resource_type.go | 70 - app/ante.go | 10 - app/ante_test.go | 2 - app/antedecorators/gasless.go | 38 - app/antedecorators/gasless_test.go | 33 +- app/antedecorators/priority_test.go | 3 +- app/app.go | 80 +- app/app_test.go | 70 +- app/apptesting/test_suite.go | 2 - app/test_helpers.go | 2 - cmd/seid/cmd/debug.go | 2 +- cmd/seid/cmd/iavl_parser.go | 61 - go.mod | 4 +- go.sum | 4 +- .../dex_module/cancel_order_test.yaml | 25 - .../dex_module/place_order_test.yaml | 46 - loadtest/main.go | 166 - occ_tests/utils/utils.go | 5 - proto/dex/asset_list.proto | 23 - proto/dex/contract.proto | 47 - proto/dex/deposit.proto | 21 - proto/dex/enums.proto | 42 - proto/dex/genesis.proto | 37 - proto/dex/gov.proto | 22 - proto/dex/long_book.proto | 19 - proto/dex/match_result.proto | 15 - proto/dex/order.proto | 108 - proto/dex/order_entry.proto | 46 - proto/dex/pair.proto | 30 - proto/dex/params.proto | 70 - proto/dex/price.proto | 52 - proto/dex/query.proto | 401 - proto/dex/settlement.proto | 40 - proto/dex/short_book.proto | 19 - proto/dex/tick_size.proto | 22 - proto/dex/twap.proto | 24 - proto/dex/tx.proto | 147 - proto/mint/v1beta1/gov.proto | 2 - scripts/dump_app_state_for_height.sh | 2 +- scripts/upload_clearing_house_contract.sh | 18 - testutil/fuzzing/dex.go | 228 - testutil/keeper/dex.go | 196 - testutil/keeper/epoch.go | 5 + testutil/processblock/msgs/dex.go | 101 - testutil/processblock/presets.go | 36 - testutil/processblock/verify/bank.go | 7 - testutil/processblock/verify/dex.go | 269 - wasmbinding/bindings/msg.go | 13 - wasmbinding/encoder.go | 7 - wasmbinding/queries.go | 73 +- wasmbinding/query_plugin.go | 3 - wasmbinding/test/encoder_test.go | 68 - wasmbinding/test/query_test.go | 131 +- wasmbinding/wasm.go | 6 +- x/dex/README.md | 57 - x/dex/ante.go | 178 - x/dex/ante_test.go | 283 - x/dex/cache/cache.go | 318 - x/dex/cache/cache_test.go | 225 - x/dex/cache/cancel.go | 65 - x/dex/cache/cancel_test.go | 76 - x/dex/cache/context.go | 44 - x/dex/cache/deposit.go | 51 - x/dex/cache/deposit_test.go | 48 - x/dex/cache/order.go | 142 - x/dex/cache/order_test.go | 257 - x/dex/client/cli/query/query.go | 48 - x/dex/client/cli/query/query_asset_list.go | 80 - .../cli/query/query_get_latest_price.go | 53 - .../client/cli/query/query_get_order_count.go | 52 - x/dex/client/cli/query/query_get_price.go | 58 - x/dex/client/cli/query/query_get_prices.go | 53 - x/dex/client/cli/query/query_get_twaps.go | 53 - x/dex/client/cli/query/query_long_book.go | 90 - .../client/cli/query/query_long_book_test.go | 176 - x/dex/client/cli/query/query_match_result.go | 49 - x/dex/client/cli/query/query_orders.go | 96 - x/dex/client/cli/query/query_params.go | 34 - .../cli/query/query_registered_contract.go | 48 - .../cli/query/query_registered_pairs.go | 48 - x/dex/client/cli/query/query_short_book.go | 92 - .../client/cli/query/query_short_book_test.go | 181 - x/dex/client/cli/tx/gov_tx.go | 60 - x/dex/client/cli/tx/tx.go | 40 - x/dex/client/cli/tx/tx_cancel_orders.go | 75 - .../client/cli/tx/tx_contract_deposit_rent.go | 52 - x/dex/client/cli/tx/tx_place_orders.go | 98 - x/dex/client/cli/tx/tx_register_contract.go | 68 - x/dex/client/cli/tx/tx_register_pairs.go | 54 - x/dex/client/cli/tx/tx_unregister_contract.go | 46 - x/dex/client/cli/tx/tx_unsuspend_contract.go | 46 - .../cli/tx/tx_update_price_tick_size.go | 54 - .../cli/tx/tx_update_quantity_tick_size.go | 54 - x/dex/client/utils/utils.go | 203 - x/dex/client/wasm/bindings/queries.go | 12 - x/dex/client/wasm/encoder.go | 36 - x/dex/client/wasm/query.go | 48 - x/dex/contract/abci.go | 323 - x/dex/contract/abci_test.go | 43 - x/dex/contract/dag.go | 78 - x/dex/contract/dag_test.go | 110 - x/dex/contract/execution.go | 219 - x/dex/contract/execution_test.go | 373 - x/dex/contract/market_order.go | 68 - x/dex/contract/runner.go | 178 - x/dex/contract/runner_test.go | 141 - x/dex/contract/settlement.go | 39 - x/dex/contract/whitelist.go | 91 - x/dex/contract/whitelist_test.go | 28 - .../example/add-asset-metadata-proposal.json | 55 - x/dex/example/register-pair-tx.json | 15 - x/dex/example/update-tick-size-tx.json | 12 - x/dex/exchange/cancel_order.go | 53 - x/dex/exchange/cancel_order_test.go | 105 - x/dex/exchange/helpers.go | 24 - x/dex/exchange/helpers_test.go | 64 - x/dex/exchange/limit_order.go | 103 - x/dex/exchange/limit_order_fuzz_test.go | 55 - x/dex/exchange/limit_order_test.go | 1165 -- x/dex/exchange/market_order.go | 273 - x/dex/exchange/market_order_fuzz_test.go | 92 - x/dex/exchange/market_order_test.go | 1175 -- x/dex/exchange/settlement.go | 129 - x/dex/exchange/settlement_fuzz_test.go | 118 - x/dex/genesis.go | 85 - x/dex/genesis_test.go | 105 - x/dex/gov.go | 14 - x/dex/handler.go | 67 - x/dex/keeper/abci/end_block_cancel_orders.go | 45 - x/dex/keeper/abci/end_block_deposit.go | 58 - x/dex/keeper/abci/end_block_place_orders.go | 83 - .../abci/end_block_place_orders_test.go | 67 - x/dex/keeper/abci/keeper_wrapper.go | 9 - x/dex/keeper/asset_list.go | 43 - x/dex/keeper/asset_list_test.go | 35 - x/dex/keeper/common.go | 22 - x/dex/keeper/contract.go | 244 - x/dex/keeper/contract_test.go | 368 - x/dex/keeper/epoch.go | 26 - x/dex/keeper/keeper.go | 78 - x/dex/keeper/long_book.go | 184 - x/dex/keeper/long_book_test.go | 92 - x/dex/keeper/match_result.go | 45 - x/dex/keeper/msgserver/msg_server.go | 18 - .../msgserver/msg_server_cancel_orders.go | 12 - .../msg_server_cancel_orders_test.go | 36 - .../msg_server_contract_deposit_rent.go | 12 - .../msg_server_contract_deposit_rent_test.go | 34 - .../msgserver/msg_server_place_orders.go | 12 - .../msg_server_place_orders_fuzz_test.go | 65 - .../msgserver/msg_server_place_orders_test.go | 49 - .../msgserver/msg_server_register_contract.go | 12 - .../msg_server_register_contract_test.go | 34 - .../msgserver/msg_server_register_pairs.go | 12 - .../msg_server_register_pairs_test.go | 38 - .../msg_server_unregister_contract.go | 12 - .../msg_server_unregister_contract_test.go | 34 - .../msg_server_unsuspend_contract.go | 12 - .../msg_server_unsuspend_contract_test.go | 23 - .../msg_server_update_price_tick_size.go | 12 - .../msg_server_update_price_tick_size_test.go | 40 - .../msg_server_update_quantity_tick_size.go | 12 - ...g_server_update_quantity_tick_size_test.go | 41 - x/dex/keeper/msgserver/testdata/hackatom.wasm | Bin 208805 -> 0 bytes x/dex/keeper/msgserver/validations.go | 40 - x/dex/keeper/order_count.go | 56 - x/dex/keeper/order_count_test.go | 35 - x/dex/keeper/order_placement.go | 33 - x/dex/keeper/pair.go | 56 - x/dex/keeper/pair_test.go | 41 - x/dex/keeper/params.go | 42 - x/dex/keeper/params_test.go | 24 - x/dex/keeper/price.go | 98 - x/dex/keeper/price_test.go | 20 - x/dex/keeper/query/grpc_query.go | 7 - x/dex/keeper/query/grpc_query_asset_list.go | 36 - .../query/grpc_query_asset_list_test.go | 50 - .../query/grpc_query_get_historical_prices.go | 119 - .../grpc_query_get_historical_prices_test.go | 185 - .../query/grpc_query_get_latest_price.go | 37 - .../query/grpc_query_get_latest_price_test.go | 30 - .../query/grpc_query_get_market_summary.go | 49 - .../grpc_query_get_market_summary_test.go | 33 - .../query/grpc_query_get_order_count.go | 19 - .../query/grpc_query_get_order_count_test.go | 29 - x/dex/keeper/query/grpc_query_get_price.go | 25 - .../keeper/query/grpc_query_get_price_test.go | 32 - x/dex/keeper/query/grpc_query_get_prices.go | 24 - x/dex/keeper/query/grpc_query_get_twaps.go | 57 - .../keeper/query/grpc_query_get_twaps_test.go | 143 - x/dex/keeper/query/grpc_query_long_book.go | 50 - .../keeper/query/grpc_query_long_book_test.go | 123 - x/dex/keeper/query/grpc_query_match_result.go | 24 - x/dex/keeper/query/grpc_query_order.go | 112 - .../query/grpc_query_order_simulation.go | 120 - .../query/grpc_query_order_simulation_test.go | 101 - x/dex/keeper/query/grpc_query_order_test.go | 75 - x/dex/keeper/query/grpc_query_params.go | 19 - x/dex/keeper/query/grpc_query_params_test.go | 23 - .../query/grpc_query_registered_contract.go | 24 - .../grpc_query_registered_contract_test.go | 42 - .../query/grpc_query_registered_pairs.go | 21 - .../query/grpc_query_registered_pairs_test.go | 39 - x/dex/keeper/query/grpc_query_short_book.go | 46 - .../query/grpc_query_short_book_test.go | 123 - x/dex/keeper/query/keeper_wrapper.go | 9 - x/dex/keeper/short_book.go | 165 - x/dex/keeper/short_book_test.go | 92 - x/dex/keeper/tick.go | 60 - x/dex/keeper/tick_test.go | 42 - x/dex/keeper/utils/order_book.go | 89 - x/dex/keeper/utils/price.go | 28 - x/dex/keeper/utils/wasm.go | 116 - x/dex/migrations/v10_to_v11.go | 45 - x/dex/migrations/v10_to_v11_test.go | 60 - x/dex/migrations/v11_to_v12.go | 13 - x/dex/migrations/v11_to_v12_test.go | 31 - x/dex/migrations/v12_to_v13.go | 15 - x/dex/migrations/v12_to_v13_test.go | 32 - x/dex/migrations/v13_to_v14.go | 69 - x/dex/migrations/v13_to_v14_test.go | 79 - x/dex/migrations/v14_to_v15.go | 15 - x/dex/migrations/v14_to_v15_test.go | 26 - x/dex/migrations/v15_to_v16.go | 15 - x/dex/migrations/v15_to_v16_test.go | 24 - x/dex/migrations/v16_to_v17.go | 110 - x/dex/migrations/v16_to_v17_test.go | 89 - x/dex/migrations/v17_to_v18.go | 33 - x/dex/migrations/v17_to_v18_test.go | 62 - x/dex/migrations/v2_to_v3.go | 35 - x/dex/migrations/v3_to_v4.go | 21 - x/dex/migrations/v3_to_v4_test.go | 48 - x/dex/migrations/v4_to_v5.go | 28 - x/dex/migrations/v4_to_v5_test.go | 59 - x/dex/migrations/v5_to_v6.go | 57 - x/dex/migrations/v5_to_v6_test.go | 79 - x/dex/migrations/v6_to_v7.go | 84 - x/dex/migrations/v6_to_v7_test.go | 89 - x/dex/migrations/v7_to_v8.go | 101 - x/dex/migrations/v7_to_v8_test.go | 98 - x/dex/migrations/v8_to_v9.go | 38 - x/dex/migrations/v8_to_v9_test.go | 42 - x/dex/migrations/v9_to_v10.go | 91 - x/dex/migrations/v9_to_v10_test.go | 94 - x/dex/module.go | 362 - x/dex/module_simulation.go | 91 - x/dex/module_test.go | 835 -- x/dex/simulation/simap.go | 15 - x/dex/spec/README.md | 56 - x/dex/testdata/clearing_house.wasm | Bin 833624 -> 0 bytes x/dex/testdata/mars.wasm | Bin 191011 -> 0 bytes x/dex/types/alias.go | 24 - x/dex/types/alias_test.go | 20 - x/dex/types/asset_list.pb.go | 768 -- x/dex/types/codec.go | 71 - x/dex/types/contract.pb.go | 1902 --- x/dex/types/deposit.go | 19 - x/dex/types/deposit.pb.go | 422 - x/dex/types/enums.go | 29 - x/dex/types/enums.pb.go | 235 - x/dex/types/enums_test.go | 53 - x/dex/types/errors.go | 28 - x/dex/types/events.go | 21 - x/dex/types/expected_keepers.go | 18 - x/dex/types/genesis.go | 75 - x/dex/types/genesis.pb.go | 1188 -- x/dex/types/genesis_test.go | 228 - x/dex/types/gov.go | 57 - x/dex/types/gov.pb.go | 418 - x/dex/types/keys.go | 190 - x/dex/types/keys_test.go | 29 - x/dex/types/long_book.pb.go | 380 - x/dex/types/match_result.go | 28 - x/dex/types/match_result.pb.go | 548 - x/dex/types/match_result_test.go | 54 - x/dex/types/message_cancel_orders.go | 72 - x/dex/types/message_cancel_orders_test.go | 42 - x/dex/types/message_contract_deposit_rent.go | 56 - x/dex/types/message_place_orders.go | 85 - x/dex/types/message_place_orders_test.go | 102 - x/dex/types/message_register_contract.go | 75 - x/dex/types/message_register_pairs.go | 83 - x/dex/types/message_unregister_contract.go | 55 - x/dex/types/message_unsuspend_contract.go | 55 - x/dex/types/message_update_price_tick_size.go | 69 - .../message_update_quantity_tick_size.go | 69 - x/dex/types/order.pb.go | 1680 --- x/dex/types/order_cancellation.go | 9 - x/dex/types/order_entry.pb.go | 790 -- x/dex/types/order_placement.go | 31 - x/dex/types/orders.go | 244 - x/dex/types/orders_test.go | 166 - x/dex/types/pair.pb.go | 718 -- x/dex/types/params.go | 143 - x/dex/types/params.pb.go | 870 -- x/dex/types/params_test.go | 17 - x/dex/types/price.pb.go | 881 -- x/dex/types/query.pb.go | 10031 ---------------- x/dex/types/query.pb.gw.go | 2389 ---- x/dex/types/settlement.go | 36 - x/dex/types/settlement.pb.go | 1044 -- x/dex/types/settlement_test.go | 31 - x/dex/types/short_book.pb.go | 380 - x/dex/types/tick_size.pb.go | 433 - x/dex/types/twap.pb.go | 416 - x/dex/types/tx.pb.go | 3884 ------ x/dex/types/types.go | 6 - x/dex/types/utils.go | 14 - x/dex/utils/context.go | 18 - x/dex/utils/dec.go | 71 - x/dex/utils/dec_test.go | 54 - x/dex/utils/errors.go | 11 - x/evm/keeper/msg_server_test.go | 6 - x/mint/keeper/hooks_test.go | 10 - x/mint/types/gov.pb.go | 2 - 320 files changed, 38 insertions(+), 52576 deletions(-) delete mode 100644 .github/workflows/fuzz.yml delete mode 100644 aclmapping/dex/mappings.go delete mode 100644 aclmapping/dex/mappings_test.go delete mode 100644 integration_test/dex_module/cancel_order_test.yaml delete mode 100644 integration_test/dex_module/place_order_test.yaml delete mode 100644 proto/dex/asset_list.proto delete mode 100644 proto/dex/contract.proto delete mode 100644 proto/dex/deposit.proto delete mode 100644 proto/dex/enums.proto delete mode 100644 proto/dex/genesis.proto delete mode 100644 proto/dex/gov.proto delete mode 100644 proto/dex/long_book.proto delete mode 100644 proto/dex/match_result.proto delete mode 100644 proto/dex/order.proto delete mode 100644 proto/dex/order_entry.proto delete mode 100644 proto/dex/pair.proto delete mode 100644 proto/dex/params.proto delete mode 100644 proto/dex/price.proto delete mode 100644 proto/dex/query.proto delete mode 100644 proto/dex/settlement.proto delete mode 100644 proto/dex/short_book.proto delete mode 100644 proto/dex/tick_size.proto delete mode 100644 proto/dex/twap.proto delete mode 100644 proto/dex/tx.proto delete mode 100755 scripts/upload_clearing_house_contract.sh delete mode 100644 testutil/fuzzing/dex.go delete mode 100644 testutil/keeper/dex.go delete mode 100644 testutil/processblock/msgs/dex.go delete mode 100644 testutil/processblock/verify/dex.go delete mode 100644 x/dex/README.md delete mode 100644 x/dex/ante.go delete mode 100644 x/dex/ante_test.go delete mode 100644 x/dex/cache/cache.go delete mode 100644 x/dex/cache/cache_test.go delete mode 100644 x/dex/cache/cancel.go delete mode 100644 x/dex/cache/cancel_test.go delete mode 100644 x/dex/cache/context.go delete mode 100644 x/dex/cache/deposit.go delete mode 100644 x/dex/cache/deposit_test.go delete mode 100644 x/dex/cache/order.go delete mode 100644 x/dex/cache/order_test.go delete mode 100644 x/dex/client/cli/query/query.go delete mode 100644 x/dex/client/cli/query/query_asset_list.go delete mode 100644 x/dex/client/cli/query/query_get_latest_price.go delete mode 100644 x/dex/client/cli/query/query_get_order_count.go delete mode 100644 x/dex/client/cli/query/query_get_price.go delete mode 100644 x/dex/client/cli/query/query_get_prices.go delete mode 100644 x/dex/client/cli/query/query_get_twaps.go delete mode 100644 x/dex/client/cli/query/query_long_book.go delete mode 100644 x/dex/client/cli/query/query_long_book_test.go delete mode 100644 x/dex/client/cli/query/query_match_result.go delete mode 100644 x/dex/client/cli/query/query_orders.go delete mode 100644 x/dex/client/cli/query/query_params.go delete mode 100644 x/dex/client/cli/query/query_registered_contract.go delete mode 100644 x/dex/client/cli/query/query_registered_pairs.go delete mode 100644 x/dex/client/cli/query/query_short_book.go delete mode 100644 x/dex/client/cli/query/query_short_book_test.go delete mode 100644 x/dex/client/cli/tx/gov_tx.go delete mode 100644 x/dex/client/cli/tx/tx.go delete mode 100644 x/dex/client/cli/tx/tx_cancel_orders.go delete mode 100644 x/dex/client/cli/tx/tx_contract_deposit_rent.go delete mode 100644 x/dex/client/cli/tx/tx_place_orders.go delete mode 100644 x/dex/client/cli/tx/tx_register_contract.go delete mode 100644 x/dex/client/cli/tx/tx_register_pairs.go delete mode 100644 x/dex/client/cli/tx/tx_unregister_contract.go delete mode 100644 x/dex/client/cli/tx/tx_unsuspend_contract.go delete mode 100644 x/dex/client/cli/tx/tx_update_price_tick_size.go delete mode 100644 x/dex/client/cli/tx/tx_update_quantity_tick_size.go delete mode 100644 x/dex/client/utils/utils.go delete mode 100644 x/dex/client/wasm/bindings/queries.go delete mode 100644 x/dex/client/wasm/encoder.go delete mode 100644 x/dex/client/wasm/query.go delete mode 100644 x/dex/contract/abci.go delete mode 100644 x/dex/contract/abci_test.go delete mode 100644 x/dex/contract/dag.go delete mode 100644 x/dex/contract/dag_test.go delete mode 100644 x/dex/contract/execution.go delete mode 100644 x/dex/contract/execution_test.go delete mode 100644 x/dex/contract/market_order.go delete mode 100644 x/dex/contract/runner.go delete mode 100644 x/dex/contract/runner_test.go delete mode 100644 x/dex/contract/settlement.go delete mode 100644 x/dex/contract/whitelist.go delete mode 100644 x/dex/contract/whitelist_test.go delete mode 100644 x/dex/example/add-asset-metadata-proposal.json delete mode 100644 x/dex/example/register-pair-tx.json delete mode 100644 x/dex/example/update-tick-size-tx.json delete mode 100644 x/dex/exchange/cancel_order.go delete mode 100644 x/dex/exchange/cancel_order_test.go delete mode 100644 x/dex/exchange/helpers.go delete mode 100644 x/dex/exchange/helpers_test.go delete mode 100644 x/dex/exchange/limit_order.go delete mode 100644 x/dex/exchange/limit_order_fuzz_test.go delete mode 100644 x/dex/exchange/limit_order_test.go delete mode 100644 x/dex/exchange/market_order.go delete mode 100644 x/dex/exchange/market_order_fuzz_test.go delete mode 100644 x/dex/exchange/market_order_test.go delete mode 100644 x/dex/exchange/settlement.go delete mode 100644 x/dex/exchange/settlement_fuzz_test.go delete mode 100644 x/dex/genesis.go delete mode 100644 x/dex/genesis_test.go delete mode 100644 x/dex/gov.go delete mode 100644 x/dex/handler.go delete mode 100644 x/dex/keeper/abci/end_block_cancel_orders.go delete mode 100644 x/dex/keeper/abci/end_block_deposit.go delete mode 100644 x/dex/keeper/abci/end_block_place_orders.go delete mode 100644 x/dex/keeper/abci/end_block_place_orders_test.go delete mode 100644 x/dex/keeper/abci/keeper_wrapper.go delete mode 100644 x/dex/keeper/asset_list.go delete mode 100644 x/dex/keeper/asset_list_test.go delete mode 100644 x/dex/keeper/common.go delete mode 100644 x/dex/keeper/contract.go delete mode 100644 x/dex/keeper/contract_test.go delete mode 100644 x/dex/keeper/epoch.go delete mode 100644 x/dex/keeper/keeper.go delete mode 100644 x/dex/keeper/long_book.go delete mode 100644 x/dex/keeper/long_book_test.go delete mode 100644 x/dex/keeper/match_result.go delete mode 100644 x/dex/keeper/msgserver/msg_server.go delete mode 100644 x/dex/keeper/msgserver/msg_server_cancel_orders.go delete mode 100644 x/dex/keeper/msgserver/msg_server_cancel_orders_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_contract_deposit_rent.go delete mode 100644 x/dex/keeper/msgserver/msg_server_contract_deposit_rent_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_place_orders.go delete mode 100644 x/dex/keeper/msgserver/msg_server_place_orders_fuzz_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_place_orders_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_register_contract.go delete mode 100644 x/dex/keeper/msgserver/msg_server_register_contract_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_register_pairs.go delete mode 100644 x/dex/keeper/msgserver/msg_server_register_pairs_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_unregister_contract.go delete mode 100644 x/dex/keeper/msgserver/msg_server_unregister_contract_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_unsuspend_contract.go delete mode 100644 x/dex/keeper/msgserver/msg_server_unsuspend_contract_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_update_price_tick_size.go delete mode 100644 x/dex/keeper/msgserver/msg_server_update_price_tick_size_test.go delete mode 100644 x/dex/keeper/msgserver/msg_server_update_quantity_tick_size.go delete mode 100644 x/dex/keeper/msgserver/msg_server_update_quantity_tick_size_test.go delete mode 100644 x/dex/keeper/msgserver/testdata/hackatom.wasm delete mode 100644 x/dex/keeper/msgserver/validations.go delete mode 100644 x/dex/keeper/order_count.go delete mode 100644 x/dex/keeper/order_count_test.go delete mode 100644 x/dex/keeper/order_placement.go delete mode 100644 x/dex/keeper/pair.go delete mode 100644 x/dex/keeper/pair_test.go delete mode 100644 x/dex/keeper/params.go delete mode 100644 x/dex/keeper/params_test.go delete mode 100644 x/dex/keeper/price.go delete mode 100644 x/dex/keeper/price_test.go delete mode 100644 x/dex/keeper/query/grpc_query.go delete mode 100644 x/dex/keeper/query/grpc_query_asset_list.go delete mode 100644 x/dex/keeper/query/grpc_query_asset_list_test.go delete mode 100644 x/dex/keeper/query/grpc_query_get_historical_prices.go delete mode 100644 x/dex/keeper/query/grpc_query_get_historical_prices_test.go delete mode 100644 x/dex/keeper/query/grpc_query_get_latest_price.go delete mode 100644 x/dex/keeper/query/grpc_query_get_latest_price_test.go delete mode 100644 x/dex/keeper/query/grpc_query_get_market_summary.go delete mode 100644 x/dex/keeper/query/grpc_query_get_market_summary_test.go delete mode 100644 x/dex/keeper/query/grpc_query_get_order_count.go delete mode 100644 x/dex/keeper/query/grpc_query_get_order_count_test.go delete mode 100644 x/dex/keeper/query/grpc_query_get_price.go delete mode 100644 x/dex/keeper/query/grpc_query_get_price_test.go delete mode 100644 x/dex/keeper/query/grpc_query_get_prices.go delete mode 100644 x/dex/keeper/query/grpc_query_get_twaps.go delete mode 100644 x/dex/keeper/query/grpc_query_get_twaps_test.go delete mode 100644 x/dex/keeper/query/grpc_query_long_book.go delete mode 100644 x/dex/keeper/query/grpc_query_long_book_test.go delete mode 100644 x/dex/keeper/query/grpc_query_match_result.go delete mode 100644 x/dex/keeper/query/grpc_query_order.go delete mode 100644 x/dex/keeper/query/grpc_query_order_simulation.go delete mode 100644 x/dex/keeper/query/grpc_query_order_simulation_test.go delete mode 100644 x/dex/keeper/query/grpc_query_order_test.go delete mode 100644 x/dex/keeper/query/grpc_query_params.go delete mode 100644 x/dex/keeper/query/grpc_query_params_test.go delete mode 100644 x/dex/keeper/query/grpc_query_registered_contract.go delete mode 100644 x/dex/keeper/query/grpc_query_registered_contract_test.go delete mode 100644 x/dex/keeper/query/grpc_query_registered_pairs.go delete mode 100644 x/dex/keeper/query/grpc_query_registered_pairs_test.go delete mode 100644 x/dex/keeper/query/grpc_query_short_book.go delete mode 100644 x/dex/keeper/query/grpc_query_short_book_test.go delete mode 100644 x/dex/keeper/query/keeper_wrapper.go delete mode 100644 x/dex/keeper/short_book.go delete mode 100644 x/dex/keeper/short_book_test.go delete mode 100644 x/dex/keeper/tick.go delete mode 100644 x/dex/keeper/tick_test.go delete mode 100644 x/dex/keeper/utils/order_book.go delete mode 100644 x/dex/keeper/utils/price.go delete mode 100644 x/dex/keeper/utils/wasm.go delete mode 100644 x/dex/migrations/v10_to_v11.go delete mode 100644 x/dex/migrations/v10_to_v11_test.go delete mode 100644 x/dex/migrations/v11_to_v12.go delete mode 100644 x/dex/migrations/v11_to_v12_test.go delete mode 100644 x/dex/migrations/v12_to_v13.go delete mode 100644 x/dex/migrations/v12_to_v13_test.go delete mode 100644 x/dex/migrations/v13_to_v14.go delete mode 100644 x/dex/migrations/v13_to_v14_test.go delete mode 100644 x/dex/migrations/v14_to_v15.go delete mode 100644 x/dex/migrations/v14_to_v15_test.go delete mode 100644 x/dex/migrations/v15_to_v16.go delete mode 100644 x/dex/migrations/v15_to_v16_test.go delete mode 100644 x/dex/migrations/v16_to_v17.go delete mode 100644 x/dex/migrations/v16_to_v17_test.go delete mode 100644 x/dex/migrations/v17_to_v18.go delete mode 100644 x/dex/migrations/v17_to_v18_test.go delete mode 100644 x/dex/migrations/v2_to_v3.go delete mode 100644 x/dex/migrations/v3_to_v4.go delete mode 100644 x/dex/migrations/v3_to_v4_test.go delete mode 100644 x/dex/migrations/v4_to_v5.go delete mode 100644 x/dex/migrations/v4_to_v5_test.go delete mode 100644 x/dex/migrations/v5_to_v6.go delete mode 100644 x/dex/migrations/v5_to_v6_test.go delete mode 100644 x/dex/migrations/v6_to_v7.go delete mode 100644 x/dex/migrations/v6_to_v7_test.go delete mode 100644 x/dex/migrations/v7_to_v8.go delete mode 100644 x/dex/migrations/v7_to_v8_test.go delete mode 100644 x/dex/migrations/v8_to_v9.go delete mode 100644 x/dex/migrations/v8_to_v9_test.go delete mode 100644 x/dex/migrations/v9_to_v10.go delete mode 100644 x/dex/migrations/v9_to_v10_test.go delete mode 100644 x/dex/module.go delete mode 100644 x/dex/module_simulation.go delete mode 100644 x/dex/module_test.go delete mode 100644 x/dex/simulation/simap.go delete mode 100644 x/dex/spec/README.md delete mode 100644 x/dex/testdata/clearing_house.wasm delete mode 100644 x/dex/testdata/mars.wasm delete mode 100644 x/dex/types/alias.go delete mode 100644 x/dex/types/alias_test.go delete mode 100644 x/dex/types/asset_list.pb.go delete mode 100644 x/dex/types/codec.go delete mode 100644 x/dex/types/contract.pb.go delete mode 100644 x/dex/types/deposit.go delete mode 100644 x/dex/types/deposit.pb.go delete mode 100644 x/dex/types/enums.go delete mode 100644 x/dex/types/enums.pb.go delete mode 100644 x/dex/types/enums_test.go delete mode 100644 x/dex/types/errors.go delete mode 100644 x/dex/types/events.go delete mode 100644 x/dex/types/expected_keepers.go delete mode 100644 x/dex/types/genesis.go delete mode 100644 x/dex/types/genesis.pb.go delete mode 100644 x/dex/types/genesis_test.go delete mode 100644 x/dex/types/gov.go delete mode 100644 x/dex/types/gov.pb.go delete mode 100644 x/dex/types/keys.go delete mode 100644 x/dex/types/keys_test.go delete mode 100644 x/dex/types/long_book.pb.go delete mode 100644 x/dex/types/match_result.go delete mode 100644 x/dex/types/match_result.pb.go delete mode 100644 x/dex/types/match_result_test.go delete mode 100644 x/dex/types/message_cancel_orders.go delete mode 100644 x/dex/types/message_cancel_orders_test.go delete mode 100644 x/dex/types/message_contract_deposit_rent.go delete mode 100644 x/dex/types/message_place_orders.go delete mode 100644 x/dex/types/message_place_orders_test.go delete mode 100644 x/dex/types/message_register_contract.go delete mode 100644 x/dex/types/message_register_pairs.go delete mode 100644 x/dex/types/message_unregister_contract.go delete mode 100644 x/dex/types/message_unsuspend_contract.go delete mode 100644 x/dex/types/message_update_price_tick_size.go delete mode 100644 x/dex/types/message_update_quantity_tick_size.go delete mode 100644 x/dex/types/order.pb.go delete mode 100644 x/dex/types/order_cancellation.go delete mode 100644 x/dex/types/order_entry.pb.go delete mode 100644 x/dex/types/order_placement.go delete mode 100644 x/dex/types/orders.go delete mode 100644 x/dex/types/orders_test.go delete mode 100644 x/dex/types/pair.pb.go delete mode 100644 x/dex/types/params.go delete mode 100644 x/dex/types/params.pb.go delete mode 100644 x/dex/types/params_test.go delete mode 100644 x/dex/types/price.pb.go delete mode 100644 x/dex/types/query.pb.go delete mode 100644 x/dex/types/query.pb.gw.go delete mode 100644 x/dex/types/settlement.go delete mode 100644 x/dex/types/settlement.pb.go delete mode 100644 x/dex/types/settlement_test.go delete mode 100644 x/dex/types/short_book.pb.go delete mode 100644 x/dex/types/tick_size.pb.go delete mode 100644 x/dex/types/twap.pb.go delete mode 100644 x/dex/types/tx.pb.go delete mode 100644 x/dex/types/types.go delete mode 100644 x/dex/types/utils.go delete mode 100644 x/dex/utils/context.go delete mode 100644 x/dex/utils/dec.go delete mode 100644 x/dex/utils/dec_test.go delete mode 100644 x/dex/utils/errors.go diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml deleted file mode 100644 index 01f3ef71a..000000000 --- a/.github/workflows/fuzz.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Fuzzing - - -on: - push: - branches: - - main - pull_request: - branches: - - main - -defaults: - run: - shell: bash - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.21 - - - name: Fuzz Place Order Msg - run: go test github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver -fuzz FuzzPlaceOrders -fuzztime 30s - - - name: Fuzz Limit Order Matching - run: go test github.com/sei-protocol/sei-chain/x/dex/exchange -fuzz FuzzMatchLimitOrders -fuzztime 30s - - - name: Fuzz Market Order Matching - run: go test github.com/sei-protocol/sei-chain/x/dex/exchange -fuzz FuzzMatchMarketOrders -fuzztime 30s - - - name: Fuzz Limit Order Settlement - run: go test github.com/sei-protocol/sei-chain/x/dex/exchange -fuzz FuzzSettleLimitOrder -fuzztime 30s - - - name: Fuzz Market Order Settlement - run: go test github.com/sei-protocol/sei-chain/x/dex/exchange -fuzz FuzzSettleMarketOrder -fuzztime 30s diff --git a/aclmapping/bank/mappings.go b/aclmapping/bank/mappings.go index 047c9092a..140e9d463 100644 --- a/aclmapping/bank/mappings.go +++ b/aclmapping/bank/mappings.go @@ -18,7 +18,6 @@ var ErrorInvalidMsgType = fmt.Errorf("invalid message received for bank module") func GetBankDepedencyGenerator() aclkeeper.DependencyGeneratorMap { dependencyGeneratorMap := make(aclkeeper.DependencyGeneratorMap) - // dex place orders placeOrdersKey := acltypes.GenerateMessageKey(&banktypes.MsgSend{}) dependencyGeneratorMap[placeOrdersKey] = MsgSendDependencyGenerator diff --git a/aclmapping/dependency_generator.go b/aclmapping/dependency_generator.go index 8a8cabe81..2e83c1ca7 100644 --- a/aclmapping/dependency_generator.go +++ b/aclmapping/dependency_generator.go @@ -3,7 +3,6 @@ package aclmapping import ( aclkeeper "github.com/cosmos/cosmos-sdk/x/accesscontrol/keeper" aclbankmapping "github.com/sei-protocol/sei-chain/aclmapping/bank" - acldexmapping "github.com/sei-protocol/sei-chain/aclmapping/dex" aclevmmapping "github.com/sei-protocol/sei-chain/aclmapping/evm" acloraclemapping "github.com/sei-protocol/sei-chain/aclmapping/oracle" acltokenfactorymapping "github.com/sei-protocol/sei-chain/aclmapping/tokenfactory" @@ -21,7 +20,6 @@ func (customDepGen CustomDependencyGenerator) GetCustomDependencyGenerators(evmK dependencyGeneratorMap := make(aclkeeper.DependencyGeneratorMap) wasmDependencyGenerators := aclwasmmapping.NewWasmDependencyGenerator() - dependencyGeneratorMap = dependencyGeneratorMap.Merge(acldexmapping.GetDexDependencyGenerators()) dependencyGeneratorMap = dependencyGeneratorMap.Merge(aclbankmapping.GetBankDepedencyGenerator()) dependencyGeneratorMap = dependencyGeneratorMap.Merge(acltokenfactorymapping.GetTokenFactoryDependencyGenerators()) dependencyGeneratorMap = dependencyGeneratorMap.Merge(wasmDependencyGenerators.GetWasmDependencyGenerators()) diff --git a/aclmapping/dex/mappings.go b/aclmapping/dex/mappings.go deleted file mode 100644 index df5350c12..000000000 --- a/aclmapping/dex/mappings.go +++ /dev/null @@ -1,229 +0,0 @@ -package acldexmapping - -import ( - "encoding/hex" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkacltypes "github.com/cosmos/cosmos-sdk/types/accesscontrol" - aclkeeper "github.com/cosmos/cosmos-sdk/x/accesscontrol/keeper" - acltypes "github.com/cosmos/cosmos-sdk/x/accesscontrol/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - dexkeeper "github.com/sei-protocol/sei-chain/x/dex/keeper" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" -) - -var ErrPlaceOrdersGenerator = fmt.Errorf("invalid message received for dex module") - -func GetDexDependencyGenerators() aclkeeper.DependencyGeneratorMap { - dependencyGeneratorMap := make(aclkeeper.DependencyGeneratorMap) - - // dex place orders - placeOrdersKey := acltypes.GenerateMessageKey(&dextypes.MsgPlaceOrders{}) - cancelOrdersKey := acltypes.GenerateMessageKey(&dextypes.MsgCancelOrders{}) - dependencyGeneratorMap[placeOrdersKey] = DexPlaceOrdersDependencyGenerator - dependencyGeneratorMap[cancelOrdersKey] = DexCancelOrdersDependencyGenerator - - return dependencyGeneratorMap -} - -func GetLongShortOrderBookOps(contractAddr string, priceDenom string, assetDenom string) []sdkacltypes.AccessOperation { - return []sdkacltypes.AccessOperation{ - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_CONTRACT_LONGBOOK, - IdentifierTemplate: hex.EncodeToString(dextypes.OrderBookPrefix(true, contractAddr, priceDenom, assetDenom)), - }, - - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_CONTRACT_SHORTBOOK, - IdentifierTemplate: hex.EncodeToString(dextypes.OrderBookPrefix(false, contractAddr, priceDenom, assetDenom)), - }, - } -} - -func DexPlaceOrdersDependencyGenerator(keeper aclkeeper.Keeper, _ sdk.Context, msg sdk.Msg) ([]sdkacltypes.AccessOperation, error) { - // TODO: read + write downstream, write contracts to process - placeOrdersMsg, ok := msg.(*dextypes.MsgPlaceOrders) - if !ok { - return []sdkacltypes.AccessOperation{}, ErrPlaceOrdersGenerator - } - - moduleAdr := keeper.AccountKeeper.GetModuleAddress(dextypes.ModuleName) - - senderBankAddrIdentifier := hex.EncodeToString(banktypes.CreateAccountBalancesPrefixFromBech32(placeOrdersMsg.Creator)) - contractAddr := placeOrdersMsg.ContractAddr - - aclOps := []sdkacltypes.AccessOperation{ - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_NEXT_ORDER_ID, - IdentifierTemplate: hex.EncodeToString(dextypes.NextOrderIDPrefix(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_DEX_NEXT_ORDER_ID, - IdentifierTemplate: hex.EncodeToString(dextypes.NextOrderIDPrefix(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_REGISTERED_PAIR, - IdentifierTemplate: hex.EncodeToString(dextypes.RegisteredPairPrefix(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DEPOSIT, - IdentifierTemplate: hex.EncodeToString(append( - dextypes.MemDepositPrefix(contractAddr), - []byte(placeOrdersMsg.Creator)..., - )), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DEPOSIT, - IdentifierTemplate: hex.EncodeToString(append( - dextypes.MemDepositPrefix(contractAddr), - []byte(placeOrdersMsg.Creator)..., - )), - }, - - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_ORDER, - IdentifierTemplate: hex.EncodeToString(dextypes.MemOrderPrefix(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_ORDER, - IdentifierTemplate: hex.EncodeToString(dextypes.MemOrderPrefix(contractAddr)), - }, - - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS, - IdentifierTemplate: hex.EncodeToString(dextypes.MemDownstreamContractsKey(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS, - IdentifierTemplate: hex.EncodeToString(dextypes.MemDownstreamContractsKey(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_CONTRACTS_TO_PROCESS, - IdentifierTemplate: hex.EncodeToString(dextypes.MemContractsToProcessKey(contractAddr)), - }, - - // Checks balance of sender - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_BANK_BALANCES, - IdentifierTemplate: senderBankAddrIdentifier, - }, - // Reduce the amount from the sender's balance - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_BANK_BALANCES, - IdentifierTemplate: senderBankAddrIdentifier, - }, - - // update the amounts for dex module balance - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_AUTH_ADDRESS_STORE, - IdentifierTemplate: hex.EncodeToString(authtypes.AddressStoreKey(moduleAdr)), - }, - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_BANK_BALANCES, - IdentifierTemplate: hex.EncodeToString(banktypes.CreateAccountBalancesPrefix(moduleAdr)), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_BANK_BALANCES, - IdentifierTemplate: hex.EncodeToString(banktypes.CreateAccountBalancesPrefix(moduleAdr)), - }, - - // Gets Account Info for the sender - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_AUTH_ADDRESS_STORE, - IdentifierTemplate: hex.EncodeToString(authtypes.CreateAddressStoreKeyFromBech32(placeOrdersMsg.Creator)), - }, - - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_CONTRACT, - IdentifierTemplate: hex.EncodeToString([]byte(dexkeeper.ContractPrefixKey)), - }, - - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_LONG_ORDER_COUNT, - IdentifierTemplate: hex.EncodeToString([]byte(dextypes.LongOrderCountKey)), - }, - - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_SHORT_ORDER_COUNT, - IdentifierTemplate: hex.EncodeToString([]byte(dextypes.ShortOrderCountKey)), - }, - } - - // Last Operation should always be a commit - aclOps = append(aclOps, *acltypes.CommitAccessOp()) - return aclOps, nil -} - -func DexCancelOrdersDependencyGenerator(_ aclkeeper.Keeper, _ sdk.Context, msg sdk.Msg) ([]sdkacltypes.AccessOperation, error) { - cancelOrdersMsg, ok := msg.(*dextypes.MsgCancelOrders) - if !ok { - return []sdkacltypes.AccessOperation{}, ErrPlaceOrdersGenerator - } - contractAddr := cancelOrdersMsg.ContractAddr - - aclOps := []sdkacltypes.AccessOperation{ - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_CANCEL, - IdentifierTemplate: hex.EncodeToString(dextypes.MemCancelPrefix(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_CANCEL, - IdentifierTemplate: hex.EncodeToString(dextypes.MemCancelPrefix(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_CONTRACT, - IdentifierTemplate: hex.EncodeToString([]byte(dexkeeper.ContractPrefixKey)), - }, - { - AccessType: sdkacltypes.AccessType_READ, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS, - IdentifierTemplate: hex.EncodeToString(dextypes.MemDownstreamContractsKey(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS, - IdentifierTemplate: hex.EncodeToString(dextypes.MemDownstreamContractsKey(contractAddr)), - }, - { - AccessType: sdkacltypes.AccessType_WRITE, - ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_CONTRACTS_TO_PROCESS, - IdentifierTemplate: hex.EncodeToString(dextypes.MemContractsToProcessKey(contractAddr)), - }, - } - - for _, order := range cancelOrdersMsg.GetCancellations() { - priceDenom := order.GetPriceDenom() - assetDenom := order.GetAssetDenom() - aclOps = append(aclOps, GetLongShortOrderBookOps(contractAddr, priceDenom, assetDenom)...) - } - - // Last Operation should always be a commit - aclOps = append(aclOps, *acltypes.CommitAccessOp()) - return aclOps, nil -} diff --git a/aclmapping/dex/mappings_test.go b/aclmapping/dex/mappings_test.go deleted file mode 100644 index 5e189ac8d..000000000 --- a/aclmapping/dex/mappings_test.go +++ /dev/null @@ -1,292 +0,0 @@ -package acldexmapping_test - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkacltypes "github.com/cosmos/cosmos-sdk/types/accesscontrol" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - acltypes "github.com/cosmos/cosmos-sdk/x/accesscontrol/types" - "github.com/k0kubun/pp/v3" - dexacl "github.com/sei-protocol/sei-chain/aclmapping/dex" - aclutils "github.com/sei-protocol/sei-chain/aclmapping/utils" - "github.com/sei-protocol/sei-chain/app" - "github.com/sei-protocol/sei-chain/app/apptesting" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - dexmsgserver "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" -) - -type KeeperTestSuite struct { - apptesting.KeeperTestHelper - - queryClient dextypes.QueryClient - msgServer dextypes.MsgServer - defaultDenom string - defaultExchangeRate string - initialBalance sdk.Coins - creator string - contract string - - msgPlaceOrders *dextypes.MsgPlaceOrders - msgCancelOrders *dextypes.MsgCancelOrders -} - -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(KeeperTestSuite)) -} - -// Runs before each test case -func (suite *KeeperTestSuite) SetupTest() { - suite.Setup() -} - -// Explicitly only run once during setup -func (suite *KeeperTestSuite) PrepareTest() { - suite.defaultDenom = "usei" - suite.defaultExchangeRate = fmt.Sprintf("%dusei", sdk.NewDec(1700)) - - suite.initialBalance = sdk.Coins{sdk.NewInt64Coin(suite.defaultDenom, 100000000000)} - suite.initialBalance = sdk.Coins{sdk.NewInt64Coin("usei", 100000000000)} - suite.FundAcc(suite.TestAccs[0], suite.initialBalance) - - suite.queryClient = dextypes.NewQueryClient(suite.QueryHelper) - suite.msgServer = dexmsgserver.NewMsgServerImpl(suite.App.DexKeeper) - - msgValidator := sdkacltypes.NewMsgValidator(aclutils.StoreKeyToResourceTypePrefixMap) - suite.Ctx = suite.Ctx.WithMsgValidator(msgValidator) - - suite.Ctx = suite.Ctx.WithBlockHeight(10) - suite.Ctx = suite.Ctx.WithBlockTime(time.Unix(333, 0)) - - suite.creator = suite.TestAccs[0].String() - suite.contract = "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m" - - suite.App.DexKeeper.AddRegisteredPair(suite.Ctx, suite.contract, keepertest.TestPair) - suite.App.DexKeeper.SetPriceTickSizeForPair(suite.Ctx, suite.contract, keepertest.TestPair, *keepertest.TestPair.PriceTicksize) - suite.App.DexKeeper.SetQuantityTickSizeForPair(suite.Ctx, suite.contract, keepertest.TestPair, *keepertest.TestPair.PriceTicksize) - - suite.msgPlaceOrders = &types.MsgPlaceOrders{ - Creator: suite.creator, - ContractAddr: suite.contract, - Orders: []*types.Order{ - { - Price: sdk.MustNewDecFromStr("10"), - Quantity: sdk.MustNewDecFromStr("10"), - Data: "", - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_LIMIT, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - { - Price: sdk.MustNewDecFromStr("20"), - Quantity: sdk.MustNewDecFromStr("5"), - Data: "", - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_MARKET, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }, - } - - suite.msgCancelOrders = &types.MsgCancelOrders{ - Creator: suite.creator, - ContractAddr: suite.contract, - Cancellations: []*types.Cancellation{ - { - Id: 1, - Price: sdk.MustNewDecFromStr("10"), - Creator: suite.creator, - PositionDirection: types.PositionDirection_LONG, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - { - Id: 2, - Creator: suite.creator, - Price: sdk.MustNewDecFromStr("20"), - PositionDirection: types.PositionDirection_SHORT, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }, - } -} - -func (suite *KeeperTestSuite) TestMsgPlaceOrder() { - suite.PrepareTest() - tests := []struct { - name string - expectedError error - msg *dextypes.MsgPlaceOrders - dynamicDep bool - }{ - { - name: "default place order", - msg: suite.msgPlaceOrders, - expectedError: sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated"), - dynamicDep: true, - }, - { - name: "dont check synchronous", - msg: suite.msgPlaceOrders, - expectedError: sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated"), - dynamicDep: false, - }, - } - for _, tc := range tests { - suite.Run(fmt.Sprintf("Test Case: %s", tc.name), func() { - goCtx := context.WithValue(suite.Ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(suite.App.GetMemKey(dextypes.MemStoreKey))) - suite.Ctx = suite.Ctx.WithContext(goCtx) - - handlerCtx, cms := aclutils.CacheTxContext(suite.Ctx) - _, err := suite.msgServer.PlaceOrders( - sdk.WrapSDKContext(handlerCtx), - tc.msg, - ) - - depdenencies, _ := dexacl.DexPlaceOrdersDependencyGenerator( - suite.App.AccessControlKeeper, - handlerCtx, - tc.msg, - ) - - if !tc.dynamicDep { - depdenencies = sdkacltypes.SynchronousAccessOps() - } - - if tc.expectedError != nil { - suite.Require().EqualError(err, tc.expectedError.Error()) - } else { - suite.Require().NoError(err) - } - - missing := handlerCtx.MsgValidator().ValidateAccessOperations(depdenencies, cms.GetEvents()) - pp.Default.SetColoringEnabled(false) - - suite.Require().Empty(missing) - }) - } -} - -func (suite *KeeperTestSuite) TestMsgCancelOrder() { - suite.PrepareTest() - tests := []struct { - name string - expectedError error - msg *dextypes.MsgCancelOrders - dynamicDep bool - }{ - { - name: "default cancel order", - msg: suite.msgCancelOrders, - expectedError: sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated"), - dynamicDep: true, - }, - { - name: "dont check synchronous", - msg: suite.msgCancelOrders, - expectedError: sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated"), - dynamicDep: false, - }, - } - for _, tc := range tests { - suite.Run(fmt.Sprintf("Test Case: %s", tc.name), func() { - goCtx := context.WithValue(suite.Ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(suite.App.GetMemKey(dextypes.MemStoreKey))) - suite.Ctx = suite.Ctx.WithContext(goCtx) - - _, err := suite.msgServer.PlaceOrders( - sdk.WrapSDKContext(suite.Ctx), - suite.msgPlaceOrders, - ) - - handlerCtx, cms := aclutils.CacheTxContext(suite.Ctx) - _, err = suite.msgServer.CancelOrders( - sdk.WrapSDKContext(handlerCtx), - tc.msg, - ) - - depdenencies, _ := dexacl.DexCancelOrdersDependencyGenerator( - suite.App.AccessControlKeeper, - handlerCtx, - tc.msg, - ) - - if !tc.dynamicDep { - depdenencies = sdkacltypes.SynchronousAccessOps() - } - - if tc.expectedError != nil { - suite.Require().EqualError(err, tc.expectedError.Error()) - } else { - suite.Require().NoError(err) - } - - missing := handlerCtx.MsgValidator().ValidateAccessOperations(depdenencies, cms.GetEvents()) - suite.Require().Empty(missing) - }) - } -} - -func TestGeneratorInvalidMessageTypes(t *testing.T) { - tm := time.Now().UTC() - valPub := secp256k1.GenPrivKey().PubKey() - testWrapper := app.NewTestWrapper(t, tm, valPub, false) - - oracleVote := oracletypes.MsgAggregateExchangeRateVote{ - ExchangeRates: "1usei", - Feeder: "test", - Validator: "validator", - } - - _, err := dexacl.DexPlaceOrdersDependencyGenerator( - testWrapper.App.AccessControlKeeper, - testWrapper.Ctx, - &oracleVote, - ) - require.Error(t, err) - - _, err = dexacl.DexCancelOrdersDependencyGenerator( - testWrapper.App.AccessControlKeeper, - testWrapper.Ctx, - &oracleVote, - ) - require.Error(t, err) -} - -func (suite *KeeperTestSuite) TestMsgPlaceOrderGenerator() { - suite.PrepareTest() - - accessOps, err := dexacl.DexPlaceOrdersDependencyGenerator( - suite.App.AccessControlKeeper, - suite.Ctx, - suite.msgPlaceOrders, - ) - require.NoError(suite.T(), err) - err = acltypes.ValidateAccessOps(accessOps) - require.NoError(suite.T(), err) -} - -func (suite *KeeperTestSuite) TestMsgCancelOrderGenerator() { - suite.PrepareTest() - accessOps, err := dexacl.DexCancelOrdersDependencyGenerator( - suite.App.AccessControlKeeper, - suite.Ctx, - suite.msgCancelOrders, - ) - require.NoError(suite.T(), err) - err = acltypes.ValidateAccessOps(accessOps) - require.NoError(suite.T(), err) -} diff --git a/aclmapping/utils/resource_type.go b/aclmapping/utils/resource_type.go index 34fd3cbd6..747cc086c 100644 --- a/aclmapping/utils/resource_type.go +++ b/aclmapping/utils/resource_type.go @@ -11,8 +11,6 @@ import ( feegranttypes "github.com/cosmos/cosmos-sdk/x/feegrant" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - dexkeeper "github.com/sei-protocol/sei-chain/x/dex/keeper" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" epochtypes "github.com/sei-protocol/sei-chain/x/epoch/types" evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types" @@ -29,40 +27,6 @@ var StoreKeyToResourceTypePrefixMap = aclsdktypes.StoreKeyToResourceTypePrefixMa aclsdktypes.ResourceType_KV: aclsdktypes.EmptyPrefix, aclsdktypes.ResourceType_Mem: aclsdktypes.EmptyPrefix, }, - dextypes.StoreKey: { - aclsdktypes.ResourceType_KV_DEX: aclsdktypes.EmptyPrefix, - aclsdktypes.ResourceType_DexMem: aclsdktypes.EmptyPrefix, - aclsdktypes.ResourceType_KV_DEX_CONTRACT_LONGBOOK: dextypes.KeyPrefix(dextypes.LongBookKey), - aclsdktypes.ResourceType_KV_DEX_CONTRACT_SHORTBOOK: dextypes.KeyPrefix(dextypes.ShortBookKey), - // pricedenom and assetdenoms are the prefixes - aclsdktypes.ResourceType_KV_DEX_PAIR_PREFIX: aclsdktypes.EmptyPrefix, - aclsdktypes.ResourceType_KV_DEX_TWAP: dextypes.KeyPrefix(dextypes.TwapKey), - aclsdktypes.ResourceType_KV_DEX_PRICE: dextypes.KeyPrefix(dextypes.PriceKey), - aclsdktypes.ResourceType_KV_DEX_SETTLEMENT_ENTRY: dextypes.KeyPrefix(dextypes.SettlementEntryKey), - aclsdktypes.ResourceType_KV_DEX_REGISTERED_PAIR: dextypes.KeyPrefix(dextypes.RegisteredPairKey), - aclsdktypes.ResourceType_KV_DEX_ORDER: dextypes.KeyPrefix(dextypes.OrderKey), - aclsdktypes.ResourceType_KV_DEX_CANCEL: dextypes.KeyPrefix(dextypes.CancelKey), - aclsdktypes.ResourceType_KV_DEX_ACCOUNT_ACTIVE_ORDERS: dextypes.KeyPrefix(dextypes.AccountActiveOrdersKey), - aclsdktypes.ResourceType_KV_DEX_ASSET_LIST: dextypes.KeyPrefix(dextypes.AssetListKey), - aclsdktypes.ResourceType_KV_DEX_NEXT_ORDER_ID: dextypes.KeyPrefix(dextypes.NextOrderIDKey), - aclsdktypes.ResourceType_KV_DEX_NEXT_SETTLEMENT_ID: dextypes.KeyPrefix(dextypes.NextSettlementIDKey), - aclsdktypes.ResourceType_KV_DEX_MATCH_RESULT: dextypes.KeyPrefix(dextypes.MatchResultKey), - aclsdktypes.ResourceType_KV_DEX_CONTRACT: dextypes.KeyPrefix(dexkeeper.ContractPrefixKey), - aclsdktypes.ResourceType_KV_DEX_ORDER_BOOK: dextypes.KeyPrefix(dextypes.NextOrderIDKey), - aclsdktypes.ResourceType_KV_DEX_LONG_ORDER_COUNT: dextypes.KeyPrefix(dextypes.LongOrderCountKey), - aclsdktypes.ResourceType_KV_DEX_SHORT_ORDER_COUNT: dextypes.KeyPrefix(dextypes.ShortOrderCountKey), - // SETTLEMENT keys are prefixed with account and order id - aclsdktypes.ResourceType_KV_DEX_SETTLEMENT_ORDER_ID: aclsdktypes.EmptyPrefix, - aclsdktypes.ResourceType_KV_DEX_SETTLEMENT: aclsdktypes.EmptyPrefix, - }, - dextypes.MemStoreKey: { - // mem - aclsdktypes.ResourceType_KV_DEX_MEM_ORDER: dextypes.KeyPrefix(dextypes.MemOrderKey), - aclsdktypes.ResourceType_KV_DEX_MEM_CANCEL: dextypes.KeyPrefix(dextypes.MemCancelKey), - aclsdktypes.ResourceType_KV_DEX_MEM_DEPOSIT: dextypes.KeyPrefix(dextypes.MemDepositKey), - aclsdktypes.ResourceType_KV_DEX_MEM_CONTRACTS_TO_PROCESS: dextypes.KeyPrefix(dextypes.MemContractsToProcess), - aclsdktypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS: dextypes.KeyPrefix(dextypes.MemDownstreamContracts), - }, banktypes.StoreKey: { aclsdktypes.ResourceType_KV_BANK: aclsdktypes.EmptyPrefix, aclsdktypes.ResourceType_KV_BANK_BALANCES: banktypes.BalancesPrefix, @@ -173,40 +137,6 @@ var StoreKeyToResourceTypePrefixMap = aclsdktypes.StoreKeyToResourceTypePrefixMa // ResourceTypeToStoreKeyMap this maps between resource types and their respective storekey var ResourceTypeToStoreKeyMap = aclsdktypes.ResourceTypeToStoreKeyMap{ // ANY, KV, and MEM are intentionally excluded because they don't map to a specific store key - - // ~~~~ DEX Resource Types ~~~~ - aclsdktypes.ResourceType_KV_DEX: dextypes.StoreKey, - aclsdktypes.ResourceType_DexMem: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_CONTRACT_LONGBOOK: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_CONTRACT_SHORTBOOK: dextypes.StoreKey, - // pricedenom and assetdenoms are the prefixes - aclsdktypes.ResourceType_KV_DEX_PAIR_PREFIX: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_TWAP: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_PRICE: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_SETTLEMENT_ENTRY: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_REGISTERED_PAIR: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_ORDER: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_CANCEL: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_ACCOUNT_ACTIVE_ORDERS: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_ASSET_LIST: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_NEXT_ORDER_ID: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_NEXT_SETTLEMENT_ID: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_MATCH_RESULT: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_CONTRACT: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_ORDER_BOOK: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_LONG_ORDER_COUNT: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_SHORT_ORDER_COUNT: dextypes.StoreKey, - // SETTLEMENT keys are prefixed with account and order id - aclsdktypes.ResourceType_KV_DEX_SETTLEMENT_ORDER_ID: dextypes.StoreKey, - aclsdktypes.ResourceType_KV_DEX_SETTLEMENT: dextypes.StoreKey, - - // ~~~~ DEX MEM Resource Types ~~~~ - aclsdktypes.ResourceType_KV_DEX_MEM_ORDER: dextypes.MemStoreKey, - aclsdktypes.ResourceType_KV_DEX_MEM_CANCEL: dextypes.MemStoreKey, - aclsdktypes.ResourceType_KV_DEX_MEM_DEPOSIT: dextypes.MemStoreKey, - aclsdktypes.ResourceType_KV_DEX_MEM_CONTRACTS_TO_PROCESS: dextypes.MemStoreKey, - aclsdktypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS: dextypes.MemStoreKey, - // ~~~~ BANK Resource Types ~~~~ aclsdktypes.ResourceType_KV_BANK: banktypes.StoreKey, aclsdktypes.ResourceType_KV_BANK_BALANCES: banktypes.StoreKey, diff --git a/app/ante.go b/app/ante.go index 3106816df..73fe48a61 100644 --- a/app/ante.go +++ b/app/ante.go @@ -14,9 +14,6 @@ import ( ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" "github.com/sei-protocol/sei-chain/app/antedecorators" "github.com/sei-protocol/sei-chain/app/antedecorators/depdecorators" - "github.com/sei-protocol/sei-chain/x/dex" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - dexkeeper "github.com/sei-protocol/sei-chain/x/dex/keeper" evmante "github.com/sei-protocol/sei-chain/x/evm/ante" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" "github.com/sei-protocol/sei-chain/x/oracle" @@ -32,11 +29,9 @@ type HandlerOptions struct { WasmConfig *wasmtypes.WasmConfig WasmKeeper *wasm.Keeper OracleKeeper *oraclekeeper.Keeper - DexKeeper *dexkeeper.Keeper AccessControlKeeper *aclkeeper.Keeper EVMKeeper *evmkeeper.Keeper TXCounterStoreKey sdk.StoreKey - CheckTxMemState *dexcache.MemState LatestCtxGetter func() sdk.Context TracingInfo *tracing.Info @@ -70,9 +65,6 @@ func NewAnteHandlerAndDepGenerator(options HandlerOptions) (sdk.AnteHandler, sdk if options.TracingInfo == nil { return nil, nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tracing info is required for ante builder") } - if options.CheckTxMemState == nil { - return nil, nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "checktx memstate is required for ante builder") - } if options.EVMKeeper == nil { return nil, nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "evm keeper is required for ante builder") } @@ -109,8 +101,6 @@ func NewAnteHandlerAndDepGenerator(options HandlerOptions) (sdk.AnteHandler, sdk sdk.DefaultWrappedAnteDecorator(evmante.NewEVMAddressDecorator(options.EVMKeeper, options.EVMKeeper.AccountKeeper())), sdk.DefaultWrappedAnteDecorator(antedecorators.NewAuthzNestedMessageDecorator()), sdk.DefaultWrappedAnteDecorator(ibcante.NewAnteDecorator(options.IBCKeeper)), - sdk.DefaultWrappedAnteDecorator(dex.NewTickSizeMultipleDecorator(*options.DexKeeper)), - dex.NewCheckDexGasDecorator(*options.DexKeeper, options.CheckTxMemState), antedecorators.NewACLWasmDependencyDecorator(*options.AccessControlKeeper, *options.WasmKeeper), } diff --git a/app/ante_test.go b/app/ante_test.go index a433e5d83..dfbf7a533 100644 --- a/app/ante_test.go +++ b/app/ante_test.go @@ -99,10 +99,8 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { WasmConfig: &wasmConfig, WasmKeeper: &suite.App.WasmKeeper, OracleKeeper: &suite.App.OracleKeeper, - DexKeeper: &suite.App.DexKeeper, AccessControlKeeper: &suite.App.AccessControlKeeper, TracingInfo: tracingInfo, - CheckTxMemState: suite.App.CheckTxMemState, EVMKeeper: &suite.App.EvmKeeper, LatestCtxGetter: func() sdk.Context { return suite.Ctx }, }, diff --git a/app/antedecorators/gasless.go b/app/antedecorators/gasless.go index f71798b1d..2835b93ba 100644 --- a/app/antedecorators/gasless.go +++ b/app/antedecorators/gasless.go @@ -1,7 +1,6 @@ package antedecorators import ( - "bytes" "encoding/hex" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -9,7 +8,6 @@ import ( sdkacltypes "github.com/cosmos/cosmos-sdk/types/accesscontrol" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" oraclekeeper "github.com/sei-protocol/sei-chain/x/oracle/keeper" @@ -118,15 +116,6 @@ func IsTxGasless(tx sdk.Tx, ctx sdk.Context, oracleKeeper oraclekeeper.Keeper, e } for _, msg := range tx.GetMsgs() { switch m := msg.(type) { - case *dextypes.MsgPlaceOrders: - if !dexPlaceOrdersIsGasless(m) { - return false, nil - } - - case *dextypes.MsgCancelOrders: - if !dexCancelOrdersIsGasless(m) { - return false, nil - } case *oracletypes.MsgAggregateExchangeRateVote: isGasless, err := oracleVoteIsGasless(m, ctx, oracleKeeper) if err != nil || !isGasless { @@ -143,33 +132,6 @@ func IsTxGasless(tx sdk.Tx, ctx sdk.Context, oracleKeeper oraclekeeper.Keeper, e return true, nil } -func dexPlaceOrdersIsGasless(_ *dextypes.MsgPlaceOrders) bool { - return false -} - -// WhitelistedGaslessCancellationAddrs TODO: migrate this into params state -var WhitelistedGaslessCancellationAddrs = []sdk.AccAddress{} - -func dexCancelOrdersIsGasless(msg *dextypes.MsgCancelOrders) bool { - return allSignersWhitelisted(msg) -} - -func allSignersWhitelisted(msg *dextypes.MsgCancelOrders) bool { - for _, signer := range msg.GetSigners() { - isWhitelisted := false - for _, whitelisted := range WhitelistedGaslessCancellationAddrs { - if bytes.Compare(signer, whitelisted) == 0 { //nolint:gosimple - isWhitelisted = true - break - } - } - if !isWhitelisted { - return false - } - } - return true -} - func oracleVoteIsGasless(msg *oracletypes.MsgAggregateExchangeRateVote, ctx sdk.Context, keeper oraclekeeper.Keeper) (bool, error) { feederAddr, err := sdk.AccAddressFromBech32(msg.Feeder) if err != nil { diff --git a/app/antedecorators/gasless_test.go b/app/antedecorators/gasless_test.go index 58143c1ce..8152dceab 100644 --- a/app/antedecorators/gasless_test.go +++ b/app/antedecorators/gasless_test.go @@ -8,12 +8,10 @@ import ( "github.com/cosmos/cosmos-sdk/types/accesscontrol" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/sei-protocol/sei-chain/app/antedecorators" - "github.com/sei-protocol/sei-chain/x/dex/types" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" oraclekeeper "github.com/sei-protocol/sei-chain/x/oracle/keeper" oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto/secp256k1" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) @@ -151,40 +149,11 @@ func TestOracleVoteGasless(t *testing.T) { require.True(t, gasless) } -func TestDexCancelOrderGasless(t *testing.T) { - addr1 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - addr2 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - - antedecorators.WhitelistedGaslessCancellationAddrs = []sdk.AccAddress{ - addr2, - } - - cancelMsg1 := types.MsgCancelOrders{ - Creator: addr1.String(), - } - cancelMsg2 := types.MsgCancelOrders{ - Creator: addr2.String(), - } - // not whitelisted - // reset gasless - gasless = true - err := CallGaslessDecoratorWithMsg(sdk.NewContext(nil, tmproto.Header{}, false, nil).WithIsCheckTx(true), &cancelMsg1, oraclekeeper.Keeper{}, nil) - require.NoError(t, err) - require.False(t, gasless) - - // whitelisted - // reset gasless - gasless = true - err = CallGaslessDecoratorWithMsg(sdk.NewContext(nil, tmproto.Header{}, false, nil).WithIsCheckTx(true), &cancelMsg2, oraclekeeper.Keeper{}, nil) - require.NoError(t, err) - require.True(t, gasless) -} - func TestNonGaslessMsg(t *testing.T) { // this needs to be updated if its changed from constant true // reset gasless gasless = true - err := CallGaslessDecoratorWithMsg(sdk.NewContext(nil, tmproto.Header{}, false, nil).WithIsCheckTx(true), &types.MsgRegisterContract{}, oraclekeeper.Keeper{}, nil) + err := CallGaslessDecoratorWithMsg(sdk.NewContext(nil, tmproto.Header{}, false, nil).WithIsCheckTx(true), &oracletypes.MsgDelegateFeedConsent{}, oraclekeeper.Keeper{}, nil) require.NoError(t, err) require.False(t, gasless) } diff --git a/app/antedecorators/priority_test.go b/app/antedecorators/priority_test.go index bc5ceff19..4083fac1e 100644 --- a/app/antedecorators/priority_test.go +++ b/app/antedecorators/priority_test.go @@ -7,7 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/app/antedecorators" - "github.com/sei-protocol/sei-chain/x/dex/types" oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -42,7 +41,7 @@ func TestPriorityAnteDecoratorTooHighPriority(t *testing.T) { ctx.WithPriority(math.MaxInt64-50), FakeTx{ FakeMsgs: []sdk.Msg{ - &types.MsgPlaceOrders{}, + &oracletypes.MsgDelegateFeedConsent{}, }, }, false, diff --git a/app/app.go b/app/app.go index 2aaedeca8..d459b12ad 100644 --- a/app/app.go +++ b/app/app.go @@ -140,12 +140,6 @@ import ( "github.com/sei-protocol/sei-chain/utils/metrics" - dexmodule "github.com/sei-protocol/sei-chain/x/dex" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - dexmodulekeeper "github.com/sei-protocol/sei-chain/x/dex/keeper" - dexmoduletypes "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - oraclemodule "github.com/sei-protocol/sei-chain/x/oracle" oraclekeeper "github.com/sei-protocol/sei-chain/x/oracle/keeper" oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types" @@ -217,7 +211,6 @@ var ( oraclemodule.AppModuleBasic{}, evm.AppModuleBasic{}, wasm.AppModuleBasic{}, - dexmodule.AppModuleBasic{}, epochmodule.AppModuleBasic{}, tokenfactorymodule.AppModuleBasic{}, // this line is used by starport scaffolding # stargate/app/moduleBasic @@ -236,7 +229,6 @@ var ( oracletypes.ModuleName: nil, wasm.ModuleName: {authtypes.Burner}, evmtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - dexmoduletypes.ModuleName: {authtypes.Burner}, tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, // this line is used by starport scaffolding # stargate/app/maccPerms } @@ -350,8 +342,6 @@ type App struct { ScopedTransferKeeper capabilitykeeper.ScopedKeeper ScopedWasmKeeper capabilitykeeper.ScopedKeeper - DexKeeper dexmodulekeeper.Keeper - EpochKeeper epochmodulekeeper.Keeper TokenFactoryKeeper tokenfactorykeeper.Keeper @@ -376,10 +366,6 @@ type App struct { mounter func() - CheckTxMemState *dexcache.MemState - ProcessProposalMemState *dexcache.MemState - MemState *dexcache.MemState - HardForkManager *upgrades.HardForkManager encodingConfig appparams.EncodingConfig @@ -427,13 +413,12 @@ func New( govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, oracletypes.StoreKey, evmtypes.StoreKey, wasm.StoreKey, - dexmoduletypes.StoreKey, epochmoduletypes.StoreKey, tokenfactorytypes.StoreKey, // this line is used by starport scaffolding # stargate/app/storeKey ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, dexmoduletypes.MemStoreKey, banktypes.DeferredCacheStoreKey, oracletypes.MemStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, banktypes.DeferredCacheStoreKey, oracletypes.MemStoreKey) app := &App{ BaseApp: bApp, @@ -550,15 +535,7 @@ func New( app.GetSubspace(epochmoduletypes.ModuleName), ).SetHooks(epochmoduletypes.NewMultiEpochHooks( app.MintKeeper.Hooks())) - app.DexKeeper = *dexmodulekeeper.NewKeeper( - appCodec, - keys[dexmoduletypes.StoreKey], - memKeys[dexmoduletypes.MemStoreKey], - app.GetSubspace(dexmoduletypes.ModuleName), - app.EpochKeeper, - app.BankKeeper, - app.AccountKeeper, - ) + app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper( appCodec, app.keys[tokenfactorytypes.StoreKey], @@ -574,7 +551,6 @@ func New( wasmOpts = append( wasmbinding.RegisterCustomPlugins( &app.OracleKeeper, - &app.DexKeeper, &app.EpochKeeper, &app.TokenFactoryKeeper, &app.AccountKeeper, @@ -674,8 +650,6 @@ func New( aclOpts..., ) - app.DexKeeper.SetWasmKeeper(&app.WasmKeeper) - dexModule := dexmodule.NewAppModule(appCodec, app.DexKeeper, app.AccountKeeper, app.BankKeeper, app.WasmKeeper, app.GetBaseApp().TracingInfo) epochModule := epochmodule.NewAppModule(appCodec, app.EpochKeeper, app.AccountKeeper, app.BankKeeper) // register the proposal types @@ -685,7 +659,6 @@ func New( AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). - AddRoute(dexmoduletypes.RouterKey, dexmodule.NewProposalHandler(app.DexKeeper)). AddRoute(minttypes.RouterKey, mint.NewProposalHandler(app.MintKeeper)). AddRoute(tokenfactorytypes.RouterKey, tokenfactorymodule.NewProposalHandler(app.TokenFactoryKeeper)). AddRoute(acltypes.ModuleName, aclmodule.NewProposalHandler(app.AccessControlKeeper)). @@ -763,7 +736,6 @@ func New( wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), evm.NewAppModule(appCodec, &app.EvmKeeper), transferModule, - dexModule, epochModule, tokenfactorymodule.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), @@ -795,7 +767,6 @@ func New( ibchost.ModuleName, ibctransfertypes.ModuleName, oracletypes.ModuleName, - dexmoduletypes.ModuleName, evmtypes.ModuleName, wasm.ModuleName, tokenfactorytypes.ModuleName, @@ -827,7 +798,6 @@ func New( ibctransfertypes.ModuleName, oracletypes.ModuleName, epochmoduletypes.ModuleName, - dexmoduletypes.ModuleName, evmtypes.ModuleName, wasm.ModuleName, tokenfactorytypes.ModuleName, @@ -853,7 +823,6 @@ func New( vestingtypes.ModuleName, crisistypes.ModuleName, ibchost.ModuleName, - dexmoduletypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, ibctransfertypes.ModuleName, @@ -890,7 +859,6 @@ func New( wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), ibc.NewAppModule(app.IBCKeeper), transferModule, - dexModule, epochModule, tokenfactorymodule.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper), // this line is used by starport scaffolding # stargate/app/appModule @@ -908,10 +876,6 @@ func New( } app.mounter() - app.CheckTxMemState = dexcache.NewMemState(app.GetMemKey(dexmoduletypes.MemStoreKey)) - app.ProcessProposalMemState = dexcache.NewMemState(app.GetMemKey(dexmoduletypes.MemStoreKey)) - app.MemState = dexcache.NewMemState(app.GetMemKey(dexmoduletypes.MemStoreKey)) - // initialize BaseApp app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) @@ -935,11 +899,9 @@ func New( WasmConfig: &wasmConfig, WasmKeeper: &app.WasmKeeper, OracleKeeper: &app.OracleKeeper, - DexKeeper: &app.DexKeeper, EVMKeeper: &app.EvmKeeper, TracingInfo: app.GetBaseApp().TracingInfo, AccessControlKeeper: &app.AccessControlKeeper, - CheckTxMemState: app.CheckTxMemState, LatestCtxGetter: func() sdk.Context { return app.GetCheckCtx() }, @@ -1071,6 +1033,16 @@ func (app *App) SetStoreUpgradeHandlers() { Added: []string{evmtypes.StoreKey}, } + // configure store loader that checks if version == upgradeHeight and applies store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } + // TODO: change this upgrade name if the planned upgrade version number ends up changing more + if upgradeInfo.Name == "v5.7.0" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + dexStoreKeyName := "dex" + storeUpgrades := storetypes.StoreUpgrades{ + Deleted: []string{dexStoreKeyName}, + } + // configure store loader that checks if version == upgradeHeight and applies store upgrades app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) } @@ -1108,7 +1080,6 @@ func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Res if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - ctx = ctx.WithContext(app.decorateContextWithDexMemState(ctx.Context())) app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) return app.mm.InitGenesis(ctx, app.appCodec, genesisState) } @@ -1155,7 +1126,6 @@ func (app *App) ProcessProposalHandler(ctx sdk.Context, req *abci.RequestProcess app.optimisticProcessingInfo.Completion <- struct{}{} } else { go func() { - ctx = ctx.WithContext(app.decorateProcessProposalContextWithDexMemState(ctx.Context())) events, txResults, endBlockResp, _ := app.ProcessBlock(ctx, req.Txs, req, req.ProposedLastCommit) optimisticProcessingInfo.Events = events optimisticProcessingInfo.TxRes = txResults @@ -1195,7 +1165,6 @@ func (app *App) FinalizeBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) } metrics.IncrementOptimisticProcessingCounter(false) ctx.Logger().Info("optimistic processing ineligible") - ctx = ctx.WithContext(app.decorateContextWithDexMemState(ctx.Context())) events, txResults, endBlockResp, _ := app.ProcessBlock(ctx, req.Txs, req, req.DecidedLastCommit) @@ -1405,7 +1374,6 @@ func (app *App) ProcessTxs( dependencyDag.TxMsgAccessOpMapping, absoluteTxIndices, ) - oldDexMemState := dexutils.GetMemState(ctx.Context()).DeepCopy() if ok { // Write the results back to the concurrent contexts - if concurrent execution fails, // this should not be called and the state is rolled back and retried with synchronous execution @@ -1416,13 +1384,6 @@ func (app *App) ProcessTxs( ctx = app.addBadWasmDependenciesToContext(ctx, concurrentResults) ctx.Logger().Error("Concurrent Execution failed, retrying with Synchronous") - oldDexMemStateCtx := context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, oldDexMemState) - ctx = ctx.WithContext(oldDexMemStateCtx) - - dexMemState := dexutils.GetMemState(ctx.Context()) - dexMemState.Clear(ctx) - dexMemState.ClearContractToDependencies(ctx) - txResults := app.ProcessBlockSynchronous(ctx, txs, typedTxs, absoluteTxIndices) processBlockCache.Write() return txResults, ctx @@ -1448,12 +1409,6 @@ func (app *App) PartitionPrioritizedTxs(_ sdk.Context, txs [][]byte, typedTxs [] switch msg.(type) { case *oracletypes.MsgAggregateExchangeRateVote: prioritized = true - case *dexmoduletypes.MsgRegisterContract: - prioritized = true - case *dexmoduletypes.MsgUnregisterContract: - prioritized = true - case *dexmoduletypes.MsgUnsuspendContract: - prioritized = true default: prioritized = false break msgLoop @@ -1563,8 +1518,6 @@ func (app *App) BuildDependenciesAndRunTxs(ctx sdk.Context, txs [][]byte, typedT func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequest, lastCommit abci.CommitInfo) ([]abci.Event, []*abci.ExecTxResult, abci.ResponseEndBlock, error) { ctx = ctx.WithIsOCCEnabled(app.OccEnabled()) - goCtx := app.decorateContextWithDexMemState(ctx.Context()) - ctx = ctx.WithContext(goCtx) events := []abci.Event{} beginBlockReq := abci.RequestBeginBlock{ @@ -1925,7 +1878,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(oracletypes.ModuleName) paramsKeeper.Subspace(wasm.ModuleName) paramsKeeper.Subspace(evmtypes.ModuleName) - paramsKeeper.Subspace(dexmoduletypes.ModuleName) paramsKeeper.Subspace(epochmoduletypes.ModuleName) paramsKeeper.Subspace(tokenfactorytypes.ModuleName) // this line is used by starport scaffolding # stargate/app/paramSubspace @@ -1947,14 +1899,6 @@ func (app *App) BlacklistedAccAddrs() map[string]bool { return blacklistedAddrs } -func (app *App) decorateProcessProposalContextWithDexMemState(base context.Context) context.Context { - return context.WithValue(base, dexutils.DexMemStateContextKey, app.ProcessProposalMemState) -} - -func (app *App) decorateContextWithDexMemState(base context.Context) context.Context { - return context.WithValue(base, dexutils.DexMemStateContextKey, app.MemState) -} - func init() { // override max wasm size to 2MB wasmtypes.MaxWasmSize = 2 * 1024 * 1024 diff --git a/app/app_test.go b/app/app_test.go index ad689e27d..60d51d42f 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -26,7 +26,6 @@ import ( "github.com/k0kubun/pp/v3" "github.com/sei-protocol/sei-chain/app" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" "github.com/sei-protocol/sei-chain/x/evm/config" evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" "github.com/sei-protocol/sei-chain/x/evm/types/ethtx" @@ -135,25 +134,6 @@ func TestPartitionPrioritizedTxs(t *testing.T) { Validator: validator, } - contractRegisterMsg := &dextypes.MsgRegisterContract{ - Creator: account, - Contract: &dextypes.ContractInfoV2{ - CodeId: 1, - ContractAddr: "sei1dc34p57spmhguak2ns88u3vxmt73gnu3c0j6phqv5ukfytklkqjsgepv26", - NeedOrderMatching: true, - }, - } - - contractUnregisterMsg := &dextypes.MsgUnregisterContract{ - Creator: account, - ContractAddr: "sei1dc34p57spmhguak2ns88u3vxmt73gnu3c0j6phqv5ukfytklkqjsgepv26", - } - - contractUnsuspendMsg := &dextypes.MsgUnsuspendContract{ - Creator: account, - ContractAddr: "sei1dc34p57spmhguak2ns88u3vxmt73gnu3c0j6phqv5ukfytklkqjsgepv26", - } - otherMsg := &stakingtypes.MsgDelegate{ DelegatorAddress: account, ValidatorAddress: validator, @@ -162,9 +142,6 @@ func TestPartitionPrioritizedTxs(t *testing.T) { txEncoder := app.MakeEncodingConfig().TxConfig.TxEncoder() oracleTxBuilder := app.MakeEncodingConfig().TxConfig.NewTxBuilder() - contractRegisterBuilder := app.MakeEncodingConfig().TxConfig.NewTxBuilder() - contractUnregisterBuilder := app.MakeEncodingConfig().TxConfig.NewTxBuilder() - contractUnsuspendBuilder := app.MakeEncodingConfig().TxConfig.NewTxBuilder() otherTxBuilder := app.MakeEncodingConfig().TxConfig.NewTxBuilder() mixedTxBuilder := app.MakeEncodingConfig().TxConfig.NewTxBuilder() @@ -173,21 +150,6 @@ func TestPartitionPrioritizedTxs(t *testing.T) { oracleTx, err := txEncoder(oracleTxBuilder.GetTx()) require.NoError(t, err) - err = contractRegisterBuilder.SetMsgs(contractRegisterMsg) - require.NoError(t, err) - contractRegisterTx, err := txEncoder(contractRegisterBuilder.GetTx()) - require.NoError(t, err) - - err = contractUnregisterBuilder.SetMsgs(contractUnregisterMsg) - require.NoError(t, err) - contractUnregisterTx, err := txEncoder(contractUnregisterBuilder.GetTx()) - require.NoError(t, err) - - err = contractUnsuspendBuilder.SetMsgs(contractUnsuspendMsg) - require.NoError(t, err) - contractSuspendTx, err := txEncoder(contractUnsuspendBuilder.GetTx()) - require.NoError(t, err) - err = otherTxBuilder.SetMsgs(otherMsg) require.NoError(t, err) otherTx, err := txEncoder(otherTxBuilder.GetTx()) @@ -201,52 +163,40 @@ func TestPartitionPrioritizedTxs(t *testing.T) { txs := [][]byte{ oracleTx, - contractRegisterTx, - contractUnregisterTx, - contractSuspendTx, otherTx, mixedTx, } typedTxs := []sdk.Tx{ oracleTxBuilder.GetTx(), - contractRegisterBuilder.GetTx(), - contractUnregisterBuilder.GetTx(), - contractUnsuspendBuilder.GetTx(), otherTxBuilder.GetTx(), mixedTxBuilder.GetTx(), } prioritizedTxs, otherTxs, prioritizedTypedTxs, otherTypedTxs, prioIdxs, otherIdxs := testWrapper.App.PartitionPrioritizedTxs(testWrapper.Ctx, txs, typedTxs) - require.Equal(t, [][]byte{oracleTx, contractRegisterTx, contractUnregisterTx, contractSuspendTx}, prioritizedTxs) + require.Equal(t, [][]byte{oracleTx}, prioritizedTxs) require.Equal(t, [][]byte{otherTx, mixedTx}, otherTxs) - require.Equal(t, []int{0, 1, 2, 3}, prioIdxs) - require.Equal(t, []int{4, 5}, otherIdxs) - require.Equal(t, 4, len(prioritizedTypedTxs)) + require.Equal(t, []int{0}, prioIdxs) + require.Equal(t, []int{1, 2}, otherIdxs) + require.Equal(t, 1, len(prioritizedTypedTxs)) require.Equal(t, 2, len(otherTypedTxs)) diffOrderTxs := [][]byte{ - oracleTx, otherTx, - contractRegisterTx, - contractUnregisterTx, + oracleTx, mixedTx, - contractSuspendTx, } differOrderTypedTxs := []sdk.Tx{ - oracleTxBuilder.GetTx(), otherTxBuilder.GetTx(), - contractRegisterBuilder.GetTx(), - contractUnregisterBuilder.GetTx(), + oracleTxBuilder.GetTx(), mixedTxBuilder.GetTx(), - contractUnsuspendBuilder.GetTx(), } prioritizedTxs, otherTxs, prioritizedTypedTxs, otherTypedTxs, prioIdxs, otherIdxs = testWrapper.App.PartitionPrioritizedTxs(testWrapper.Ctx, diffOrderTxs, differOrderTypedTxs) - require.Equal(t, [][]byte{oracleTx, contractRegisterTx, contractUnregisterTx, contractSuspendTx}, prioritizedTxs) + require.Equal(t, [][]byte{oracleTx}, prioritizedTxs) require.Equal(t, [][]byte{otherTx, mixedTx}, otherTxs) - require.Equal(t, []int{0, 2, 3, 5}, prioIdxs) - require.Equal(t, []int{1, 4}, otherIdxs) - require.Equal(t, 4, len(prioritizedTypedTxs)) + require.Equal(t, []int{1}, prioIdxs) + require.Equal(t, []int{0, 2}, otherIdxs) + require.Equal(t, 1, len(prioritizedTypedTxs)) require.Equal(t, 2, len(otherTypedTxs)) } diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index 9d72cc9f6..26ec97dd3 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -16,7 +16,6 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/ed25519" @@ -40,7 +39,6 @@ type KeeperTestHelper struct { func (s *KeeperTestHelper) Setup() { s.App = app.Setup(false, false) s.Ctx = s.App.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: "sei-test", Time: time.Now().UTC()}) - s.Ctx = s.Ctx.WithContext(context.WithValue(s.Ctx.Context(), dexutils.DexMemStateContextKey, s.App.MemState)) s.QueryHelper = &baseapp.QueryServiceTestHelper{ GRPCQueryRouter: s.App.GRPCQueryRouter(), Ctx: s.Ctx, diff --git a/app/test_helpers.go b/app/test_helpers.go index e80e7f357..16c1c80c1 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -22,7 +22,6 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" ) @@ -82,7 +81,6 @@ func newTestWrapper(t *testing.T, tm time.Time, valPub crptotypes.PubKey, enable appPtr = Setup(false, enableEVMCustomPrecompiles, baseAppOptions...) } ctx := appPtr.BaseApp.NewContext(false, tmproto.Header{Height: 1, ChainID: "sei-test", Time: tm}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, appPtr.MemState)) wrapper := &TestWrapper{ App: appPtr, Ctx: ctx, diff --git a/cmd/seid/cmd/debug.go b/cmd/seid/cmd/debug.go index d0a7e3240..ed95da572 100644 --- a/cmd/seid/cmd/debug.go +++ b/cmd/seid/cmd/debug.go @@ -26,7 +26,7 @@ const ( ) var modules = []string{ - "dex", "wasm", "aclaccesscontrol", "oracle", "epoch", "mint", "acc", "bank", "crisis", "feegrant", "staking", "distribution", "slashing", "gov", "params", "ibc", "upgrade", "evidence", "transfer", "tokenfactory", + "wasm", "aclaccesscontrol", "oracle", "epoch", "mint", "acc", "bank", "crisis", "feegrant", "staking", "distribution", "slashing", "gov", "params", "ibc", "upgrade", "evidence", "transfer", "tokenfactory", } func DumpIavlCmd() *cobra.Command { diff --git a/cmd/seid/cmd/iavl_parser.go b/cmd/seid/cmd/iavl_parser.go index fcb54a182..345332f53 100644 --- a/cmd/seid/cmd/iavl_parser.go +++ b/cmd/seid/cmd/iavl_parser.go @@ -9,8 +9,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/sei-protocol/sei-chain/app/params" - dexkeeper "github.com/sei-protocol/sei-chain/x/dex/keeper" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" ) @@ -21,7 +19,6 @@ const UNRECOGNIZED = "Unrecognized Prefix" var ModuleParserMap = map[string]ModuleParser{ "bank": BankParser, "mint": MintParser, - "dex": DexParser, "staking": StakingParser, "acc": AccountParser, } @@ -84,64 +81,6 @@ func BankParser(key []byte) ([]string, error) { return keyItems, nil } -func DexParser(key []byte) ([]string, error) { - keyItems := []string{} - if matched, items, _, err := MatchAndExtractDexAddressPrefixKeys(key); matched { - if err != nil { - return keyItems, err - } - keyItems = append(keyItems, items...) - return keyItems, nil - } - switch { - case bytes.HasPrefix(key, []byte(dexkeeper.EpochKey)): - // do nothing since the key is a string and no other data to be parsed - default: - keyItems = append(keyItems, UNRECOGNIZED) - } - return keyItems, nil -} - -func MatchAndExtractDexAddressPrefixKeys(key []byte) (bool, []string, []byte, error) { - keyItems := []string{} - keysToMatch := []string{ - // Source of truth: github.com/sei-protocol/sei-chain/x/dex/types/keys.go - contains key constants represented here - dextypes.LongBookKey, - dextypes.ShortBookKey, - dextypes.PriceKey, - dextypes.TwapKey, - dextypes.SettlementEntryKey, - dextypes.RegisteredPairKey, - dextypes.OrderKey, - dextypes.CancelKey, - dextypes.AccountActiveOrdersKey, - dextypes.NextOrderIDKey, - dextypes.NextSettlementIDKey, - dextypes.MatchResultKey, - dextypes.MemOrderKey, - dextypes.MemCancelKey, - dextypes.MemDepositKey, - dexkeeper.ContractPrefixKey, - } - - for _, prefix := range keysToMatch { - if bytes.HasPrefix(key, dextypes.KeyPrefix(prefix)) { - keyItems = append(keyItems, prefix) - remaining := bytes.TrimPrefix(key, dextypes.KeyPrefix(prefix)) - items, remaining, err := parseLengthPrefixedAddress(remaining) - if err != nil { - return true, keyItems, remaining, err - } - keyItems = append(keyItems, items...) - if len(remaining) > 0 { - keyItems = append(keyItems, fmt.Sprintf("RemainingString: %s", string(remaining))) - } - return true, keyItems, remaining, nil - } - } - return false, keyItems, key, nil -} - func parseLengthPrefixedAddress(remainingKey []byte) ([]string, []byte, error) { keyItems := []string{} lengthPrefix, remaining := int(remainingKey[0]), remainingKey[1:] diff --git a/go.mod b/go.mod index f5fcc7f23..1aae20b4c 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,6 @@ require ( go.opentelemetry.io/otel/trace v1.9.0 golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa golang.org/x/sync v0.7.0 - golang.org/x/text v0.15.0 golang.org/x/time v0.3.0 google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8 google.golang.org/grpc v1.64.0 @@ -319,6 +318,7 @@ require ( golang.org/x/net v0.25.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/tools v0.21.0 // indirect google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 // indirect @@ -346,7 +346,7 @@ require ( replace ( github.com/CosmWasm/wasmd => github.com/sei-protocol/sei-wasmd v0.1.9 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.24 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.25 github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.1.9 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.1 github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.13.5-sei-22 diff --git a/go.sum b/go.sum index b235cd5cb..844170003 100644 --- a/go.sum +++ b/go.sum @@ -1347,8 +1347,8 @@ github.com/sei-protocol/go-ethereum v1.13.5-sei-22 h1:t/m1qXER+DEMrcpqgoYmUxifkA github.com/sei-protocol/go-ethereum v1.13.5-sei-22/go.mod h1:kcRZmuzRn1lVejiFNTz4l4W7imnpq1bDAnuKS/RyhbQ= github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA= github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= -github.com/sei-protocol/sei-cosmos v0.3.24 h1:7pvXNvsQ3P6wovH2Z6wK/G9UuRTHYgQtQNpPjt9ypZQ= -github.com/sei-protocol/sei-cosmos v0.3.24/go.mod h1:og/KbejR/zSQ8otapODEDU9zYNhFSUDbq9+tgeYePyU= +github.com/sei-protocol/sei-cosmos v0.3.25 h1:S/hAcTK1mAep4zlOc0vHZUvR0kClZEBvILtBJ0hVv/c= +github.com/sei-protocol/sei-cosmos v0.3.25/go.mod h1:og/KbejR/zSQ8otapODEDU9zYNhFSUDbq9+tgeYePyU= github.com/sei-protocol/sei-db v0.0.39 h1:/XwwlObPhWnX8zH8GDbDvyn+a/K2911HZlmlBZzN+gQ= github.com/sei-protocol/sei-db v0.0.39/go.mod h1:F/ZKZA8HJPcUzSZPA8yt6pfwlGriJ4RDR4eHKSGLStI= github.com/sei-protocol/sei-iavl v0.1.9 h1:y4mVYftxLNRs6533zl7N0/Ch+CzRQc04JDfHolIxgBE= diff --git a/integration_test/dex_module/cancel_order_test.yaml b/integration_test/dex_module/cancel_order_test.yaml deleted file mode 100644 index 31496bd87..000000000 --- a/integration_test/dex_module/cancel_order_test.yaml +++ /dev/null @@ -1,25 +0,0 @@ -- name: Test cancel a placed order and query the cancelled order - inputs: - # Get contract address, this requires contract already deployed - - cmd: tail -1 integration_test/contracts/mars-addr.txt - env: CONTRACT_ADDR - # Prepare parameter to first place the order - - cmd: echo "LONG?1.01?5?SEI?ATOM?LIMIT?{\"leverage\":\"1\",\"position_effect\":\"Open\"}" - env: PARAMS - # Place an order and set ORDER_ID - - cmd: printf "12345678\n" | seid tx dex place-orders $CONTRACT_ADDR $PARAMS --amount=1000000000usei -y --from=admin --chain-id=sei --fees=1000000usei --gas=500000 --broadcast-mode=block --output json|jq -M -r ".logs[].events[].attributes[] | select(.key == \"order_id\").value" - env: ORDER_ID - # Prepare parameter to cancel the placed order - - cmd: echo $ORDER_ID"?LONG?1.01?SEI?ATOM" - env: PARAMS - # Cancel the order - - cmd: printf "12345678\n" | seid tx dex cancel-orders $CONTRACT_ADDR $PARAMS -y --from=admin --chain-id=sei --fees=1000000usei --gas=5000000 --broadcast-mode=block --output json - env: RES - - cmd: printf "12345678\n" | seid keys show admin --output json |jq -r .address - env: ADMIN_ADDR - # Query the order by id - - cmd: seid q dex get-orders $CONTRACT_ADDR $ADMIN_ADDR --output json |jq ".[] | length" - env: NUMORDER - verifiers: - - type: eval - expr: NUMORDER == 4 # placed from the place_order test diff --git a/integration_test/dex_module/place_order_test.yaml b/integration_test/dex_module/place_order_test.yaml deleted file mode 100644 index 168d4080c..000000000 --- a/integration_test/dex_module/place_order_test.yaml +++ /dev/null @@ -1,46 +0,0 @@ -- name: Test placing a new order and query the placed order - inputs: - # Get contract address, this requires contract already deployed - - cmd: tail -1 integration_test/contracts/mars-addr.txt - env: CONTRACT_ADDR - # Prepare parameter - - cmd: echo "LONG?1.01?5?SEI?ATOM?LIMIT?{\"leverage\":\"1\",\"position_effect\":\"Open\"}" - env: PARAMS - # Place an order and set ORDER_ID - - cmd: printf "12345678\n" | seid tx dex place-orders $CONTRACT_ADDR $PARAMS --amount=1000000000usei -y --from=admin --chain-id=sei --fees=1000000usei --gas=500000 --broadcast-mode=block --output json|jq -M -r ".logs[].events[].attributes[] | select(.key == \"order_id\").value" - env: ORDER_ID - # Query the order by id - - cmd: seid q dex get-orders-by-id $CONTRACT_ADDR SEI ATOM $ORDER_ID --output json |jq .order.status - env: RESULT - verifiers: - # Order ids should be greater or equal to 0 - - type: eval - expr: ORDER_ID >= 0 - # Order status should be something like PLACED - - type: regex - result: RESULT - expr: '^.*PLACED.*' - -- name: Test place multiple orders should give the correct asset denom - inputs: - # Get contract address, this requires contract already deployed - - cmd: tail -1 integration_test/contracts/mars-addr.txt - env: CONTRACT_ADDR - # Get admin account address - - cmd: printf "12345678\n" | seid keys show admin --output json |jq -r .address - env: ADMIN_ADDR - - cmd: seid q dex get-orders $CONTRACT_ADDR $ADMIN_ADDR --output json |jq ".[] | length" - env: ORDER_COUNT_BEFORE - # Prepare parameter - - cmd: echo "LONG?1.0?10?usei?uatom?LIMIT? LONG?3.0?3000?usei?uatomatomatom?LIMIT? LONG?3.0?1000?usei?uatomatom?LIMIT?" - env: PARAMS - # Place 3 orders - - cmd: printf "12345678\n" | seid tx dex place-orders $CONTRACT_ADDR $PARAMS --amount=1000000000usei -y --from=admin --chain-id=sei --fees=1000000usei --gas=500000 --broadcast-mode=block --output json| jq .code - - # Query all the orders - - cmd: seid q dex get-orders $CONTRACT_ADDR $ADMIN_ADDR --output json |jq ".[] | length" - env: ORDER_COUNT_AFTER - verifiers: - # Verify we should only see 3 orders - - type: eval - expr: ( ORDER_COUNT_AFTER - ORDER_COUNT_BEFORE ) == 3 diff --git a/loadtest/main.go b/loadtest/main.go index 1b094892d..938b19061 100644 --- a/loadtest/main.go +++ b/loadtest/main.go @@ -39,7 +39,6 @@ import ( "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/utils/metrics" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" tokenfactorytypes "github.com/sei-protocol/sei-chain/x/tokenfactory/types" ) @@ -330,10 +329,6 @@ func (c *LoadTestClient) generateMessage(key cryptotypes.PrivKey, msgType string } switch msgType { - case Vortex: - price := config.PriceDistr.Sample() - quantity := config.QuantityDistr.Sample() - msgs = c.generateVortexOrder(config, key, config.WasmMsgTypes.Vortex.NumOrdersPerTx, price, quantity) case WasmMintNft: contract := config.WasmMsgTypes.MintNftType.ContractAddr // TODO: Potentially just hard code the Funds amount here @@ -403,21 +398,6 @@ func (c *LoadTestClient) generateMessage(key cryptotypes.PrivKey, msgType string signer = adminKey gas = 10000000 fee = 1000000 - case Dex: - price := config.PriceDistr.Sample() - quantity := config.QuantityDistr.Sample() - contract := config.ContractDistr.Sample() - orderPlacements := generateDexOrderPlacements(config, key, msgPerTx, price, quantity) - amount, err := sdk.ParseCoinsNormalized(fmt.Sprintf("%d%s", price.Mul(quantity).Ceil().RoundInt64(), "usei")) - if err != nil { - panic(err) - } - msgs = []sdk.Msg{&dextypes.MsgPlaceOrders{ - Creator: sdk.AccAddress(key.PubKey().Address()).String(), - Orders: orderPlacements, - ContractAddr: contract, - Funds: amount, - }} case Staking: delegatorAddr := sdk.AccAddress(key.PubKey().Address()).String() chosenValidator := c.Validators[r.Intn(len(c.Validators))].OperatorAddress @@ -484,42 +464,6 @@ func (c *LoadTestClient) generateMessage(key cryptotypes.PrivKey, msgType string Amount: sdk.NewInt(amountUsei), }), }} - case FailureDexMalformed: - price := config.PriceDistr.InvalidSample() - quantity := config.QuantityDistr.InvalidSample() - contract := config.ContractDistr.Sample() - orderPlacements := generateDexOrderPlacements(config, key, msgPerTx, price, quantity) - amount, err := sdk.ParseCoinsNormalized(fmt.Sprintf("%d%s", price.Mul(quantity).Ceil().RoundInt64(), "usei")) - if err != nil { - panic(err) - } - msgs = []sdk.Msg{&dextypes.MsgPlaceOrders{ - Creator: sdk.AccAddress(key.PubKey().Address()).String(), - Orders: orderPlacements, - ContractAddr: contract, - Funds: amount, - }} - case FailureDexInvalid: - price := config.PriceDistr.Sample() - quantity := config.QuantityDistr.Sample() - contract := config.ContractDistr.Sample() - orderPlacements := generateDexOrderPlacements(config, key, msgPerTx, price, quantity) - var amountUsei int64 - if r.Float64() < 0.5 { - amountUsei = 10000 * price.Mul(quantity).Ceil().RoundInt64() - } else { - amountUsei = 0 - } - amount, err := sdk.ParseCoinsNormalized(fmt.Sprintf("%d%s", amountUsei, "usei")) - if err != nil { - panic(err) - } - msgs = []sdk.Msg{&dextypes.MsgPlaceOrders{ - Creator: sdk.AccAddress(key.PubKey().Address()).String(), - Orders: orderPlacements, - ContractAddr: contract, - Funds: amount, - }} case WasmOccIteratorWrite: // generate some values for indices 1-100 indices := []int{} @@ -578,51 +522,6 @@ func (c *LoadTestClient) generateMessage(key cryptotypes.PrivKey, msgType string return msgs, false, signer, gas, int64(fee) } -func sampleDexOrderType(config Config) (orderType dextypes.OrderType) { - if len(config.MessageTypes) == 1 && config.MessageTypes[0] == "failure_bank_malformed" { - orderType = -1 - } else { - msgType := config.MsgTypeDistr.SampleDexMsgs() - switch msgType { - case Limit: - orderType = dextypes.OrderType_LIMIT - case Market: - orderType = dextypes.OrderType_MARKET - default: - panic(fmt.Sprintf("Unknown message type %s\n", msgType)) - } - } - return orderType -} - -func generateDexOrderPlacements(config Config, key cryptotypes.PrivKey, msgPerTx uint64, price sdk.Dec, quantity sdk.Dec) (orderPlacements []*dextypes.Order) { - orderType := sampleDexOrderType(config) - - r := rand.New(rand.NewSource(time.Now().UnixNano())) - var direction dextypes.PositionDirection - if r.Float64() < 0.5 { - direction = dextypes.PositionDirection_LONG - } else { - direction = dextypes.PositionDirection_SHORT - } - - contract := config.ContractDistr.Sample() - for j := 0; j < int(msgPerTx); j++ { - orderPlacements = append(orderPlacements, &dextypes.Order{ - Account: sdk.AccAddress(key.PubKey().Address()).String(), - ContractAddr: contract, - PositionDirection: direction, - Price: price.Quo(FromMili), - Quantity: quantity.Quo(FromMili), - PriceDenom: "SEI", - AssetDenom: "ATOM", - OrderType: orderType, - Data: VortexData, - }) - } - return orderPlacements -} - func (c *LoadTestClient) generateStakingMsg(delegatorAddr string, chosenValidator string, srcAddr string) sdk.Msg { c.mtx.Lock() defer c.mtx.Unlock() @@ -663,71 +562,6 @@ func (c *LoadTestClient) generateStakingMsg(delegatorAddr string, chosenValidato return msg } -// generateVortexOrder generates Vortex order messages. If short order, creates a deposit message first -func (c *LoadTestClient) generateVortexOrder(config Config, key cryptotypes.PrivKey, numOrders int64, price sdk.Dec, quantity sdk.Dec) []sdk.Msg { - var msgs []sdk.Msg - contract := config.WasmMsgTypes.Vortex.ContractAddr - - r := rand.New(rand.NewSource(time.Now().UnixNano())) - // Randomly select Position Direction - var direction dextypes.PositionDirection - if r.Float64() < 0.5 { - direction = dextypes.PositionDirection_LONG - } else { - direction = dextypes.PositionDirection_SHORT - } - - orderType := sampleDexOrderType(config) - - // If placing short order on vortex, first deposit for buying power - if direction == dextypes.PositionDirection_SHORT { - // TODO: Considering depositing more up front when numOrders > 1 - amountDeposit, err := sdk.ParseCoinsNormalized(fmt.Sprintf("%d%s", price.Mul(quantity).Ceil().RoundInt64(), "usei")) - if err != nil { - panic(err) - } - vortexDeposit := &wasmtypes.MsgExecuteContract{ - Sender: sdk.AccAddress(key.PubKey().Address()).String(), - Contract: contract, - Msg: wasmtypes.RawContractMessage([]byte("{\"deposit\":{}}")), - Funds: amountDeposit, - } - msgs = append(msgs, vortexDeposit) - } - - // Create a MsgPlaceOrders with numOrders Orders - var orderPlacements []*dextypes.Order - for j := 0; j < int(numOrders); j++ { - vortexOrder := &dextypes.Order{ - Account: sdk.AccAddress(key.PubKey().Address()).String(), - ContractAddr: contract, - PositionDirection: direction, - Price: price.Quo(FromMili), - Quantity: quantity.Quo(FromMili), - PriceDenom: "SEI", - AssetDenom: "ATOM", - OrderType: orderType, - Data: VortexData, - } - orderPlacements = append(orderPlacements, vortexOrder) - } - - amount, err := sdk.ParseCoinsNormalized(fmt.Sprintf("%d%s", price.Mul(quantity).Ceil().RoundInt64(), "usei")) - if err != nil { - panic(err) - } - vortexOrderMsg := &dextypes.MsgPlaceOrders{ - Creator: sdk.AccAddress(key.PubKey().Address()).String(), - Orders: orderPlacements, - ContractAddr: contract, - Funds: amount, - } - - msgs = append(msgs, vortexOrderMsg) - - return msgs -} - // nolint func getLastHeight(blockchainEndpoint string) int { out, err := exec.Command("curl", blockchainEndpoint+"/blockchain").Output() diff --git a/occ_tests/utils/utils.go b/occ_tests/utils/utils.go index e64772664..877f92db1 100644 --- a/occ_tests/utils/utils.go +++ b/occ_tests/utils/utils.go @@ -1,7 +1,6 @@ package utils import ( - "context" "crypto/ecdsa" "encoding/hex" "math/big" @@ -32,9 +31,6 @@ import ( "github.com/sei-protocol/sei-chain/app" utils2 "github.com/sei-protocol/sei-chain/utils" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" "github.com/sei-protocol/sei-chain/x/evm/config" types2 "github.com/sei-protocol/sei-chain/x/evm/types" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" @@ -129,7 +125,6 @@ func NewTestContext(t *testing.T, testAccts []TestAcct, blockTime time.Time, wor }) testApp := wrapper.App ctx := wrapper.Ctx - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(dextypes.MemStoreKey)))) ctx = ctx.WithBlockHeader(tmproto.Header{Height: ctx.BlockHeader().Height, ChainID: ctx.BlockHeader().ChainID, Time: blockTime}) amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(1000000000000000)), sdk.NewCoin("uusdc", sdk.NewInt(1000000000000000))) bankkeeper := testApp.BankKeeper diff --git a/proto/dex/asset_list.proto b/proto/dex/asset_list.proto deleted file mode 100644 index b80d54f71..000000000 --- a/proto/dex/asset_list.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "cosmos/bank/v1beta1/bank.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -message AssetIBCInfo { - string sourceChannel = 1 [(gogoproto.jsontag) = "source_channel"]; - string dstChannel = 2 [(gogoproto.jsontag) = "dst_channel"]; - string sourceDenom = 3 [(gogoproto.jsontag) = "source_denom"]; - string sourceChainID = 4 [(gogoproto.jsontag) = "source_chain_id"]; -} - -message AssetMetadata { - AssetIBCInfo ibcInfo = 1 [(gogoproto.jsontag) = "ibc_info"]; - string type_asset = 2 [(gogoproto.jsontag) = "type_asset"]; // Ex: cw20, ics20, erc20 - cosmos.bank.v1beta1.Metadata metadata = 3 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "metadata" - ]; -} diff --git a/proto/dex/contract.proto b/proto/dex/contract.proto deleted file mode 100644 index 11d87ceb6..000000000 --- a/proto/dex/contract.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -message ContractInfo { - uint64 codeId = 1; - string contractAddr = 2; - bool needHook = 3; - bool needOrderMatching = 4; - repeated ContractDependencyInfo dependencies = 5; - int64 numIncomingDependencies = 6; -} - -message ContractInfoV2 { - uint64 codeId = 1; - string contractAddr = 2; - bool needHook = 3; - bool needOrderMatching = 4; - repeated ContractDependencyInfo dependencies = 5; - int64 numIncomingDependencies = 6; - string creator = 7; - uint64 rentBalance = 8; - bool suspended = 9; - string suspensionReason = 10; -} - -// suppose A is first registered and depends on X, then B is added and depends on X, -// and then C is added and depends on X, then A is the elder sibling to B and B is -// the younger sibling to A, and B is the elder sibling to C and C is the younger to B -message ContractDependencyInfo { - string dependency = 1; - string immediateElderSibling = 2; - string immediateYoungerSibling = 3; -} - -message LegacyContractInfo { - uint64 codeId = 1; - string contractAddr = 2; - bool needHook = 3; - bool needOrderMatching = 4; - repeated string dependentContractAddrs = 5; -} - -message DownsteamContracts { - repeated string contractAddrs = 1; -} \ No newline at end of file diff --git a/proto/dex/deposit.proto b/proto/dex/deposit.proto deleted file mode 100644 index 5f09e2ffa..000000000 --- a/proto/dex/deposit.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -message DepositInfoEntry { - string creator = 1 [ - (gogoproto.jsontag) = "creator" - ]; - string denom = 2 [ - (gogoproto.jsontag) = "denom" - ]; - string amount = 3 [ - (gogoproto.moretags) = "yaml:\"amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amount" - ]; -} diff --git a/proto/dex/enums.proto b/proto/dex/enums.proto deleted file mode 100644 index 0eb89c5c0..000000000 --- a/proto/dex/enums.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -enum PositionDirection { - LONG = 0; - SHORT = 1; -} - -enum PositionEffect { - OPEN = 0; - CLOSE = 1; -} - -enum OrderType { - LIMIT = 0; - MARKET = 1; - FOKMARKET = 3; // fill-or-kill market order - FOKMARKETBYVALUE = 4; // fill-or-kill market by value order - STOPLOSS = 5; - STOPLIMIT = 6; -} - -enum Unit { - STANDARD = 0; - MILLI = 1; - MICRO = 2; - NANO = 3; -} - -enum OrderStatus { - PLACED = 0; - FAILED_TO_PLACE = 1; - CANCELLED = 2; - FULFILLED = 3; -} - -enum CancellationInitiator { - USER = 0; - LIQUIDATED = 1; -} diff --git a/proto/dex/genesis.proto b/proto/dex/genesis.proto deleted file mode 100644 index 5e46bc73a..000000000 --- a/proto/dex/genesis.proto +++ /dev/null @@ -1,37 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; -import "dex/params.proto"; -import "dex/long_book.proto"; -import "dex/short_book.proto"; -import "dex/order.proto"; -import "dex/contract.proto"; -import "dex/pair.proto"; -import "dex/price.proto"; -// this line is used by starport scaffolding # genesis/proto/import - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -// GenesisState defines the dex module's genesis state. -message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - repeated ContractState contractState = 2 [(gogoproto.nullable) = false]; - uint64 lastEpoch = 3; - // this line is used by starport scaffolding # genesis/proto/state -} - -message ContractState { - ContractInfoV2 contractInfo = 1 [(gogoproto.nullable) = false]; - repeated LongBook longBookList = 2 [(gogoproto.nullable) = false]; - repeated ShortBook shortBookList = 3 [(gogoproto.nullable) = false]; - repeated Order triggeredOrdersList = 4 [(gogoproto.nullable) = false]; - repeated Pair pairList = 5 [(gogoproto.nullable) = false]; - repeated ContractPairPrices priceList = 6 [(gogoproto.nullable) = false]; - uint64 nextOrderId = 7; -} - -message ContractPairPrices { - Pair pricePair = 1 [(gogoproto.nullable) = false]; - repeated Price prices = 2; -} diff --git a/proto/dex/gov.proto b/proto/dex/gov.proto deleted file mode 100644 index 4fa4d04e7..000000000 --- a/proto/dex/gov.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; -import "dex/asset_list.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -// AddAssetMetadataProposal is a gov Content type for adding a new asset -// to the dex module's asset list. -message AddAssetMetadataProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - repeated AssetMetadata assetList = 3 [ - (gogoproto.moretags) = "yaml:\"asset_list\"", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/dex/long_book.proto b/proto/dex/long_book.proto deleted file mode 100644 index c9b810f23..000000000 --- a/proto/dex/long_book.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; -import "dex/order_entry.proto"; -import "gogoproto/gogo.proto"; - -message LongBook { - string price = 1 [ - (gogoproto.moretags) = "yaml:\"price\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price" - ]; - OrderEntry entry = 2 [ - (gogoproto.jsontag) = "entry" - ]; - -} \ No newline at end of file diff --git a/proto/dex/match_result.proto b/proto/dex/match_result.proto deleted file mode 100644 index c6d76c807..000000000 --- a/proto/dex/match_result.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; -import "dex/order.proto"; -import "dex/settlement.proto"; -import "gogoproto/gogo.proto"; - -message MatchResult { - int64 height = 1 [(gogoproto.jsontag) = "height"]; - string contractAddr = 2 [(gogoproto.jsontag) = "contract_address"]; - repeated Order orders = 3 [(gogoproto.jsontag) = "orders"]; - repeated SettlementEntry settlements = 4 [(gogoproto.jsontag) = "settlements"]; - repeated Cancellation cancellations = 5 [(gogoproto.jsontag) = "cancellations"]; -} \ No newline at end of file diff --git a/proto/dex/order.proto b/proto/dex/order.proto deleted file mode 100644 index 8b366eb6e..000000000 --- a/proto/dex/order.proto +++ /dev/null @@ -1,108 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; -import "dex/enums.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -message Order { - uint64 id = 1 [ - (gogoproto.jsontag) = "id", - (gogoproto.nullable) = true - ]; - OrderStatus status = 2 [ - (gogoproto.jsontag) = "status", - (gogoproto.nullable) = true - ]; - string account = 3 [ - (gogoproto.jsontag) = "account", - (gogoproto.nullable) = true - ]; - string contractAddr = 4 [ - (gogoproto.jsontag) = "contract_address", - (gogoproto.nullable) = true - ]; - string price = 5 [ - (gogoproto.moretags) = "yaml:\"price\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price" - ]; - string quantity = 6 [ - (gogoproto.moretags) = "yaml:\"quantity\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "quantity" - ]; - string priceDenom = 7 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 8 [ - (gogoproto.jsontag) = "asset_denom" - ]; - OrderType orderType = 9 [ - (gogoproto.jsontag) = "order_type" - ]; - PositionDirection positionDirection = 10 [ - (gogoproto.jsontag) = "position_direction" - ]; - string data = 11 [ - (gogoproto.jsontag) = "data" - ]; - string statusDescription = 12 [ - (gogoproto.jsontag) = "status_description" - ]; - string nominal = 13 [ - (gogoproto.moretags) = "yaml:\"nominal\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "nominal" - ]; - string triggerPrice = 14 [ - (gogoproto.moretags) = "yaml:\"trigger_price\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "trigger_price" - ]; - bool triggerStatus = 15 [ - (gogoproto.jsontag) = "trigger_status" - ]; -} - -message Cancellation { - uint64 id = 1 [ - (gogoproto.jsontag) = "id" - ]; - CancellationInitiator initiator = 2 [ - (gogoproto.jsontag) = "initiator" - ]; - string creator = 3 [ - (gogoproto.jsontag) = "creator", - (gogoproto.nullable) = true - ]; - string contractAddr = 4 [ - (gogoproto.jsontag) = "contract_address" - ]; - string priceDenom = 5 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 6 [ - (gogoproto.jsontag) = "asset_denom" - ]; - PositionDirection positionDirection = 7 [ - (gogoproto.jsontag) = "position_direction" - ]; - string price = 8 [ - (gogoproto.moretags) = "yaml:\"price\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price" - ]; -} - -message ActiveOrders { - repeated uint64 ids = 1 [ - (gogoproto.jsontag) = "ids" - ]; -} diff --git a/proto/dex/order_entry.proto b/proto/dex/order_entry.proto deleted file mode 100644 index a35d8075f..000000000 --- a/proto/dex/order_entry.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -message OrderEntry { - - string price = 1 [ - (gogoproto.moretags) = "yaml:\"price\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price" - ]; - string quantity = 2 [ - (gogoproto.moretags) = "yaml:\"quantity\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "quantity" - ]; - repeated Allocation allocations = 3 [ - (gogoproto.jsontag) = "allocations" - ]; - string priceDenom = 4 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 5 [ - (gogoproto.jsontag) = "asset_denom" - ]; -} - -message Allocation { - uint64 orderId = 1 [ - (gogoproto.jsontag) = "order_id" - ]; - string quantity = 2 [ - (gogoproto.moretags) = "yaml:\"quantity\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "quantity" - ]; - string account = 3 [ - (gogoproto.jsontag) = "account" - ]; -} diff --git a/proto/dex/pair.proto b/proto/dex/pair.proto deleted file mode 100644 index 721e459ea..000000000 --- a/proto/dex/pair.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -message Pair { - string priceDenom = 1 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 2 [ - (gogoproto.jsontag) = "asset_denom" - ]; - string priceTicksize = 3 [ - (gogoproto.jsontag) = "price_tick_size", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = true - ]; - string quantityTicksize = 4 [ - (gogoproto.jsontag) = "quantity_tick_size", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = true - ]; -} - -message BatchContractPair { - string contractAddr = 1 [(gogoproto.jsontag) = "contract_addr"]; - repeated Pair pairs = 2 [(gogoproto.jsontag) = "pairs"]; -} diff --git a/proto/dex/params.proto b/proto/dex/params.proto deleted file mode 100644 index de96e4790..000000000 --- a/proto/dex/params.proto +++ /dev/null @@ -1,70 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - uint64 price_snapshot_retention = 1 [ - (gogoproto.moretags) = "yaml:\"price_snapshot_retention\"", - (gogoproto.jsontag) = "price_snapshot_retention" - ]; - string sudo_call_gas_price = 2 [ - (gogoproto.jsontag) = "sudo_call_gas_price", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - uint64 begin_block_gas_limit = 3 [ - (gogoproto.jsontag) = "begin_block_gas_limit", - (gogoproto.moretags) = "yaml:\"begin_block_gas_limit\"" - ]; - uint64 end_block_gas_limit = 4 [ - (gogoproto.jsontag) = "end_block_gas_limit", - (gogoproto.moretags) = "yaml:\"end_block_gas_limit\"" - ]; - uint64 default_gas_per_order = 5 [ - (gogoproto.jsontag) = "default_gas_per_order", - (gogoproto.moretags) = "yaml:\"default_gas_per_order\"" - ]; - uint64 default_gas_per_cancel = 6 [ - (gogoproto.jsontag) = "default_gas_per_cancel", - (gogoproto.moretags) = "yaml:\"default_gas_per_cancel\"" - ]; - uint64 min_rent_deposit = 7 [ - (gogoproto.jsontag) = "min_rent_deposit", - (gogoproto.moretags) = "yaml:\"min_rent_deposit\"" - ]; - uint64 gas_allowance_per_settlement = 8 [ - (gogoproto.jsontag) = "gas_allowance_per_settlement", - (gogoproto.moretags) = "yaml:\"gas_allowance_per_settlement\"" - ]; - uint64 min_processable_rent = 9 [ - (gogoproto.jsontag) = "min_processable_rent", - (gogoproto.moretags) = "yaml:\"min_processable_rent\"" - ]; - uint64 order_book_entries_per_load = 10 [ - (gogoproto.jsontag) = "order_book_entries_per_load", - (gogoproto.moretags) = "yaml:\"order_book_entries_per_load\"" - ]; - uint64 contract_unsuspend_cost = 11 [ - (gogoproto.jsontag) = "contract_unsuspend_cost", - (gogoproto.moretags) = "yaml:\"contract_unsuspend_cost\"" - ]; - uint64 max_order_per_price = 12 [ - (gogoproto.jsontag) = "max_order_per_price", - (gogoproto.moretags) = "yaml:\"max_order_per_price\"" - ]; - uint64 max_pairs_per_contract = 13 [ - (gogoproto.jsontag) = "max_pairs_per_contract", - (gogoproto.moretags) = "yaml:\"max_pairs_per_contract\"" - ]; - uint64 default_gas_per_order_data_byte = 14 [ - (gogoproto.jsontag) = "default_gas_per_order_data_byte", - (gogoproto.moretags) = "yaml:\"default_gas_per_order_data_byte\"" - ]; -} diff --git a/proto/dex/price.proto b/proto/dex/price.proto deleted file mode 100644 index 65b544717..000000000 --- a/proto/dex/price.proto +++ /dev/null @@ -1,52 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; -import "dex/pair.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -message Price { - - uint64 snapshotTimestampInSeconds = 1 [ - (gogoproto.jsontag) = "snapshot_timestamp_in_seconds" - ]; - string price = 2 [ - (gogoproto.moretags) = "yaml:\"price\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price" - ]; - Pair pair = 3 [ - (gogoproto.jsontag) = "pair" - ]; -} - -message PriceCandlestick { - uint64 beginTimestamp = 1 [ - (gogoproto.jsontag) = "begin_timestamp" - ]; - uint64 endTimestamp = 2 [ - (gogoproto.jsontag) = "end_timestamp" - ]; - string open = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "open" - ]; - string high = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "high" - ]; - string low = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "low" - ]; - string close = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "close" - ]; - string volume = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "volume" - ]; -} diff --git a/proto/dex/query.proto b/proto/dex/query.proto deleted file mode 100644 index 4aeccce56..000000000 --- a/proto/dex/query.proto +++ /dev/null @@ -1,401 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "dex/params.proto"; -import "dex/long_book.proto"; -import "dex/short_book.proto"; -import "dex/price.proto"; -import "dex/contract.proto"; -import "dex/twap.proto"; -import "dex/asset_list.proto"; -import "dex/pair.proto"; -import "dex/order.proto"; -import "dex/match_result.proto"; -import "dex/enums.proto"; -// this line is used by starport scaffolding # 1 - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -// Query defines the gRPC querier service. -service Query { - // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/params"; - } - // Queries a LongBook by id. - rpc LongBook(QueryGetLongBookRequest) returns (QueryGetLongBookResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/long_book/{contractAddr}/{priceDenom}/{assetDenom}/{price}"; - } - - // Queries a list of LongBook items. - rpc LongBookAll(QueryAllLongBookRequest) returns (QueryAllLongBookResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/long_book/{contractAddr}/{priceDenom}/{assetDenom}"; - } - -// Queries a ShortBook by id. - rpc ShortBook(QueryGetShortBookRequest) returns (QueryGetShortBookResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/short_book/{contractAddr}/{priceDenom}/{assetDenom}/{price}"; - } - - // Queries a list of ShortBook items. - rpc ShortBookAll(QueryAllShortBookRequest) returns (QueryAllShortBookResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/short_book/{contractAddr}/{priceDenom}/{assetDenom}"; - } - - rpc GetPrice(QueryGetPriceRequest) returns (QueryGetPriceResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/get_price/{contractAddr}/{priceDenom}/{assetDenom}/{timestamp}"; - } - - rpc GetLatestPrice(QueryGetLatestPriceRequest) returns (QueryGetLatestPriceResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/get_latest_price/{contractAddr}/{priceDenom}/{assetDenom}"; - } - - rpc GetPrices(QueryGetPricesRequest) returns (QueryGetPricesResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/get_prices/{contractAddr}/{priceDenom}/{assetDenom}"; - } - - rpc GetTwaps(QueryGetTwapsRequest) returns (QueryGetTwapsResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/get_twaps/{contractAddr}/{lookbackSeconds}"; - } - - // Returns the metadata for a specified denom / display type - rpc AssetMetadata(QueryAssetMetadataRequest) returns (QueryAssetMetadataResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/asset_list/{denom}"; - } - - // Returns metadata for all the assets - rpc AssetList(QueryAssetListRequest) returns (QueryAssetListResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/asset_list"; - } - - // Returns all registered pairs for specified contract address - rpc GetRegisteredPairs(QueryRegisteredPairsRequest) returns (QueryRegisteredPairsResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/registered_pairs"; - } - - // Returns registered contract information - rpc GetRegisteredContract(QueryRegisteredContractRequest) returns (QueryRegisteredContractResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/registered_contract/{contractAddr}"; - } - - rpc GetOrders(QueryGetOrdersRequest) returns (QueryGetOrdersResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/get_orders/{contractAddr}/{account}"; - } - - rpc GetOrder(QueryGetOrderByIDRequest) returns (QueryGetOrderByIDResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/get_order_by_id/{contractAddr}/{priceDenom}/{assetDenom}/{id}"; - } - - rpc GetHistoricalPrices(QueryGetHistoricalPricesRequest) returns (QueryGetHistoricalPricesResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/get_historical_prices/{contractAddr}/{priceDenom}/{assetDenom}/{periodLengthInSeconds}/{numOfPeriods}"; - } - - rpc GetMarketSummary(QueryGetMarketSummaryRequest) returns (QueryGetMarketSummaryResponse) { - option (google.api.http).get = "/sei-protocol/seichain/dex/get_market_summary/{contractAddr}/{priceDenom}/{assetDenom}/{lookbackInSeconds}"; - } - - rpc GetOrderSimulation(QueryOrderSimulationRequest) returns (QueryOrderSimulationResponse) {} - - rpc GetMatchResult(QueryGetMatchResultRequest) returns (QueryGetMatchResultResponse) {} - - rpc GetOrderCount(QueryGetOrderCountRequest) returns (QueryGetOrderCountResponse) {} - -// this line is used by starport scaffolding # 2 -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -message QueryGetLongBookRequest { - string price = 1; - string contractAddr = 2; - string priceDenom = 3; - string assetDenom = 4; -} - -message QueryGetLongBookResponse { - LongBook LongBook = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllLongBookRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; - string contractAddr = 2; - string priceDenom = 3; - string assetDenom = 4; -} - -message QueryAllLongBookResponse { - repeated LongBook LongBook = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetShortBookRequest { - string price = 1; - string contractAddr = 2; - string priceDenom = 3; - string assetDenom = 4; -} - -message QueryGetShortBookResponse { - ShortBook ShortBook = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllShortBookRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; - string contractAddr = 2; - string priceDenom = 3; - string assetDenom = 4; -} - -message QueryAllShortBookResponse { - repeated ShortBook ShortBook = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetPricesRequest { - string priceDenom = 1; - string assetDenom = 2; - string contractAddr = 3; -} - -message QueryGetPricesResponse { - repeated Price prices = 1; -} - -message QueryGetPriceRequest { - string priceDenom = 1; - string assetDenom = 2; - string contractAddr = 3; - uint64 timestamp = 4; -} - -message QueryGetPriceResponse { - Price price = 1; - bool found = 2; -} - -message QueryGetLatestPriceRequest { - string priceDenom = 1 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 2 [ - (gogoproto.jsontag) = "asset_denom" - ]; - string contractAddr = 3 [ - (gogoproto.jsontag) = "contract_address" - ]; -} - -message QueryGetLatestPriceResponse { - Price price = 1; -} - -message QueryGetTwapsRequest { - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; - uint64 lookbackSeconds = 2 [ - (gogoproto.jsontag) = "lookback_seconds" - ]; - } - -message QueryGetTwapsResponse { - repeated Twap twaps = 1 [ - (gogoproto.jsontag) = "twaps" - ]; -} - -message QueryAssetListRequest {} - -message QueryAssetListResponse { - repeated AssetMetadata assetList = 1 [(gogoproto.nullable) = false]; -} - -message QueryAssetMetadataRequest { - string denom = 1; -} - -message QueryAssetMetadataResponse { - AssetMetadata metadata = 1; -} - -message QueryRegisteredPairsRequest { - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; -} - -message QueryRegisteredPairsResponse { - repeated Pair pairs = 1 [(gogoproto.nullable) = false]; -} - -message QueryRegisteredContractRequest { - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; -} - -message QueryRegisteredContractResponse { - ContractInfoV2 contract_info = 1; -} - -message QueryGetOrdersRequest{ - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; - string account = 2 [ - (gogoproto.jsontag) = "account" - ]; -} - -message QueryGetOrdersResponse { - repeated Order orders = 1 [ - (gogoproto.jsontag) = "orders" - ]; -} - -message QueryGetOrderByIDRequest{ - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; - string priceDenom = 2 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 3 [ - (gogoproto.jsontag) = "asset_denom" - ]; - uint64 id = 4 [ - (gogoproto.jsontag) = "id" - ]; -} - -message QueryGetOrderByIDResponse { - Order order = 1 [ - (gogoproto.jsontag) = "order" - ]; -} - -message QueryGetHistoricalPricesRequest { - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; - string priceDenom = 2 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 3 [ - (gogoproto.jsontag) = "asset_denom" - ]; - uint64 periodLengthInSeconds = 4 [ - (gogoproto.jsontag) = "period_length_in_seconds" - ]; - uint64 numOfPeriods = 5 [ - (gogoproto.jsontag) = "number_of_periods" - ]; -} - -message QueryGetHistoricalPricesResponse { - repeated PriceCandlestick prices = 1[ - (gogoproto.jsontag) = "prices" - ]; -} - -message QueryGetMarketSummaryRequest { - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; - string priceDenom = 2 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 3 [ - (gogoproto.jsontag) = "asset_denom" - ]; - uint64 lookbackInSeconds = 4 [ - (gogoproto.jsontag) = "lookback_in_seconds" - ]; -} - -message QueryGetMarketSummaryResponse{ - string totalVolume = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "total_volume" - ]; - string totalVolumeNotional = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "total_volume_notional" - ]; - string highPrice = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "high_price" - ]; - string lowPrice = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "low_price" - ]; - string lastPrice = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "last_price" - ]; -} - -message QueryOrderSimulationRequest { - Order order = 1 [ - (gogoproto.jsontag) = "order" - ]; - string contractAddr = 2 [ - (gogoproto.jsontag) = "contract_address" - ]; -} - -message QueryOrderSimulationResponse { - string ExecutedQuantity = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "executed_quantity" - ]; -} - -message QueryGetMatchResultRequest { - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; -} - -message QueryGetMatchResultResponse { - MatchResult result = 1 [ - (gogoproto.jsontag) = "result" - ]; -} - -message QueryGetOrderCountRequest { - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; - string priceDenom = 2 [ - (gogoproto.jsontag) = "price_denom" - ]; - string assetDenom = 3 [ - (gogoproto.jsontag) = "asset_denom" - ]; - string price = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.jsontag) = "price" - ]; - PositionDirection positionDirection = 5 [ - (gogoproto.jsontag) = "position_direction" - ]; -} - -message QueryGetOrderCountResponse { - uint64 count = 1 [ - (gogoproto.jsontag) = "count" - ]; -} -// this line is used by starport scaffolding # 3 diff --git a/proto/dex/settlement.proto b/proto/dex/settlement.proto deleted file mode 100644 index 8e5487ebd..000000000 --- a/proto/dex/settlement.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; -import "gogoproto/gogo.proto"; - -message SettlementEntry { - string account = 1 [(gogoproto.jsontag) = "account"]; - string priceDenom = 2 [(gogoproto.jsontag) = "price_denom"]; - string assetDenom = 3 [(gogoproto.jsontag) = "asset_denom"]; - string quantity = 4 [ - (gogoproto.moretags) = "yaml:\"quantity\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "quantity" - ]; - string executionCostOrProceed = 5 [ - (gogoproto.moretags) = "yaml:\"execution_cost_or_proceed\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "execution_cost_or_proceed" - ]; - string expectedCostOrProceed = 6 [ - (gogoproto.moretags) = "yaml:\"expected_cost_or_proceed\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "expected_cost_or_proceed" - ]; - string positionDirection = 7 [(gogoproto.jsontag) = "position_direction"]; - string orderType = 8 [(gogoproto.jsontag) = "order_type"]; - uint64 orderId = 9 [(gogoproto.jsontag) = "order_id"]; - uint64 timestamp = 10 [(gogoproto.jsontag) = "timestamp"]; - uint64 height = 11 [(gogoproto.jsontag) = "height"]; - uint64 settlementId = 12 [(gogoproto.jsontag) = "settlement_id"]; -} - -message Settlements { - int64 epoch = 1 [(gogoproto.jsontag) = "epoch"]; - repeated SettlementEntry entries = 2 [(gogoproto.jsontag) = "entries"]; -} \ No newline at end of file diff --git a/proto/dex/short_book.proto b/proto/dex/short_book.proto deleted file mode 100644 index b355c3cab..000000000 --- a/proto/dex/short_book.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; -import "dex/order_entry.proto"; -import "gogoproto/gogo.proto"; - -message ShortBook { - string price = 1 [ - (gogoproto.moretags) = "yaml:\"price\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price" - ]; - OrderEntry entry = 2 [ - (gogoproto.jsontag) = "entry" - ]; - -} \ No newline at end of file diff --git a/proto/dex/tick_size.proto b/proto/dex/tick_size.proto deleted file mode 100644 index 80eece546..000000000 --- a/proto/dex/tick_size.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; -import "dex/pair.proto"; -import "gogoproto/gogo.proto"; - -message TickSize { - Pair pair = 1 [ - (gogoproto.jsontag) = "pair" - ]; - string ticksize = 2 [ - (gogoproto.moretags) = "yaml:\"tick_size\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "tick_size" - ]; - string contractAddr = 3 [ - (gogoproto.moretags) = "yaml:\"tick_size\"", - (gogoproto.jsontag) = "contract_addr" - ]; -} \ No newline at end of file diff --git a/proto/dex/twap.proto b/proto/dex/twap.proto deleted file mode 100644 index cca0836fb..000000000 --- a/proto/dex/twap.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "gogoproto/gogo.proto"; -import "dex/pair.proto"; - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - - -message Twap { - - Pair pair = 1 [ - (gogoproto.jsontag) = "pair" - ]; - string twap = 2 [ - (gogoproto.moretags) = "yaml:\"twap\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "twap" - ]; - uint64 lookbackSeconds = 3 [ - (gogoproto.jsontag) = "lookback_seconds" - ]; -} diff --git a/proto/dex/tx.proto b/proto/dex/tx.proto deleted file mode 100644 index b21f5dde7..000000000 --- a/proto/dex/tx.proto +++ /dev/null @@ -1,147 +0,0 @@ -syntax = "proto3"; -package seiprotocol.seichain.dex; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "dex/contract.proto"; -import "dex/order.proto"; -import "dex/pair.proto"; -import "dex/tick_size.proto"; - -// this line is used by starport scaffolding # proto/tx/import - -option go_package = "github.com/sei-protocol/sei-chain/x/dex/types"; - -// Msg defines the Msg service. -service Msg { - rpc PlaceOrders(MsgPlaceOrders) returns (MsgPlaceOrdersResponse); - rpc CancelOrders(MsgCancelOrders) returns (MsgCancelOrdersResponse); - rpc RegisterContract(MsgRegisterContract) returns(MsgRegisterContractResponse); - rpc ContractDepositRent(MsgContractDepositRent) returns(MsgContractDepositRentResponse); - rpc UnregisterContract(MsgUnregisterContract) returns(MsgUnregisterContractResponse); - rpc RegisterPairs(MsgRegisterPairs) returns(MsgRegisterPairsResponse); - rpc UpdatePriceTickSize(MsgUpdatePriceTickSize) returns(MsgUpdateTickSizeResponse); - rpc UpdateQuantityTickSize(MsgUpdateQuantityTickSize) returns(MsgUpdateTickSizeResponse); - rpc UnsuspendContract(MsgUnsuspendContract) returns(MsgUnsuspendContractResponse); - // privileged endpoints below - -// this line is used by starport scaffolding # proto/tx/rpc -} - -message MsgPlaceOrders { - string creator = 1 [ - (gogoproto.jsontag) = "creator" - ]; - repeated Order orders = 2 [ - (gogoproto.jsontag) = "orders" - ]; - string contractAddr = 3 [ - (gogoproto.jsontag) = "contract_address" - ]; - repeated cosmos.base.v1beta1.Coin funds = 4 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.jsontag) = "funds" - ]; -} - -message MsgPlaceOrdersResponse { - repeated uint64 orderIds = 1 [ - (gogoproto.moretags) = "yaml:\"order_ids\"", - (gogoproto.jsontag) = "order_ids" - ]; -} - -message MsgCancelOrders { - string creator = 1 [ - (gogoproto.jsontag) = "creator" - ]; - repeated Cancellation cancellations = 2 [ - (gogoproto.jsontag) = "cancellations" - ]; - string contractAddr = 3 [ - (gogoproto.jsontag) = "contract_address" - ]; -} - -message MsgCancelOrdersResponse {} - -message MsgRegisterContract { - string creator = 1; - ContractInfoV2 contract = 2; -} - -message MsgRegisterContractResponse {} - -message MsgContractDepositRent { - string contractAddr = 1 [ - (gogoproto.jsontag) = "contract_address" - ]; - uint64 amount = 2 [ - (gogoproto.jsontag) = "amount" - ]; - string sender = 3 [ - (gogoproto.jsontag) = "sender" - ]; -} - -message MsgContractDepositRentResponse {} - -message MsgUnregisterContract { - string creator = 1 [ - (gogoproto.jsontag) = "creator" - ]; - string contractAddr = 2 [ - (gogoproto.jsontag) = "contract_address" - ]; -} - -message MsgUnregisterContractResponse {} - -message MsgRegisterPairs { - string creator = 1; - repeated BatchContractPair batchcontractpair = 3 [ - (gogoproto.moretags) = "yaml:\"batch_contract_pair\"", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "batch_contract_pair" - ]; -} - -message MsgRegisterPairsResponse {} - -message MsgUpdatePriceTickSize { - string creator = 1 [ - (gogoproto.jsontag) = "creator" - ]; - repeated TickSize tickSizeList = 2 [ - (gogoproto.moretags) = "yaml:\"tick_size_list\"", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "tick_size_list" - ]; -} - -message MsgUpdateQuantityTickSize { - string creator = 1 [ - (gogoproto.jsontag) = "creator" - ]; - repeated TickSize tickSizeList = 2 [ - (gogoproto.moretags) = "yaml:\"tick_size_list\"", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "tick_size_list" - ]; -} - -message MsgUpdateTickSizeResponse {} - -message MsgUnsuspendContract { - string creator = 1 [ - (gogoproto.jsontag) = "creator" - ]; - string contractAddr = 2 [ - (gogoproto.jsontag) = "contract_address" - ]; -} - -message MsgUnsuspendContractResponse {} - -// this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/proto/mint/v1beta1/gov.proto b/proto/mint/v1beta1/gov.proto index 084b95196..1f9c2133e 100644 --- a/proto/mint/v1beta1/gov.proto +++ b/proto/mint/v1beta1/gov.proto @@ -6,8 +6,6 @@ import "mint/v1beta1/mint.proto"; option go_package = "github.com/sei-protocol/sei-chain/x/mint/types"; -// AddAssetMetadataProposal is a gov Content type for adding a new asset -// to the dex module's asset list. message UpdateMinterProposal { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; diff --git a/scripts/dump_app_state_for_height.sh b/scripts/dump_app_state_for_height.sh index 3107b2947..5d7d2b647 100755 --- a/scripts/dump_app_state_for_height.sh +++ b/scripts/dump_app_state_for_height.sh @@ -28,7 +28,7 @@ fi cd $HOME sudo rm -r state_$HEIGHT mkdir state_$HEIGHT -for key in dex wasm accesscontrol oracle epoch mint acc bank crisis feegrant staking distribution slashing gov params ibc upgrade evidence transfer tokenfactory +for key in wasm accesscontrol oracle epoch mint acc bank crisis feegrant staking distribution slashing gov params ibc upgrade evidence transfer tokenfactory do $HOME/go/bin/iaviewer data $HOME/.sei/data/application.db "s/k:"$key"/" $HEIGHT > $HOME/state_$HEIGHT/$key.data $HOME/go/bin/iaviewer shape $HOME/.sei/data/application.db "s/k:"$key"/" $HEIGHT > $HOME/state_$HEIGHT/$key.shape diff --git a/scripts/upload_clearing_house_contract.sh b/scripts/upload_clearing_house_contract.sh deleted file mode 100755 index cfbe49e9b..000000000 --- a/scripts/upload_clearing_house_contract.sh +++ /dev/null @@ -1,18 +0,0 @@ -# ./scripts/initialize_local.sh to spawn chain locally, endpoint is default to localhost:9090 -# build the contract to wasm with `cargo build; docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/rust-optimizer:0.12.5` - -# upload the code -printf '00000000\n' | ./build/seid tx wasm store ../matrix-contract/clearing-house-contract/artifacts/clearing_house.wasm -y --from=alice --chain-id=sei --gas=3000000 --fees=100000usei --broadcast-mode=block -# replace addr here with an addr you have privateKey -printf '00000000\n' | ./build/seid tx wasm instantiate 1 '{"whitelist": ["sei1zywupnfk3t8lvtuzh540vls8mf53r5zuq98wkt"],"use_whitelist":false,"admin":"sei1zywupnfk3t8lvtuzh540vls8mf53r5zuq98wkt","limit_order_fee":{"decimal":"0.0001","negative":false},"market_order_fee":{"decimal":"0.0001","negative":false},"liquidation_order_fee":{"decimal":"0.0001","negative":false},"margin_ratio":{"decimal":"0.0625","negative":false},"max_leverage":{"decimal":"4","negative":false}}' -y --no-admin --chain-id=sei --gas=1500000 --fees=15000usei --broadcast-mode=block --label=dex --from=alice -# contract_address highly possible is the same, if not replace -printf '00000000\n' | ./build/seid tx dex register-contract sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m 1 -y --from=alice --chain-id=sei --fees=100000usei --gas=500000 --broadcast-mode=block -# register a pair -printf '00000000\n' | ./build/seid tx dex register-pairs ./x/dex/example/register-pair-tx.json -y --from=alice --chain-id=sei --fees=10000000usei --gas=500000 --broadcast-mode=block -sleep 5 -printf '00000000\n' | ./build/seid tx dex update-tick-size ./x/dex/example/update-tick-size-tx.json -y --from=alice --chain-id=sei --fees=10000000usei --gas=500000 --broadcast-mode=block -printf '00000000\n' | ./build/seid tx gov deposit 2 10000000usei -y --from=alice --chain-id=sei --fees=10000000usei --gas=500000 --broadcast-mode=block -printf '00000000\n' | ./build/seid tx gov vote 2 yes -y --from=alice --chain-id=sei --fees=10000000usei --gas=500000 --broadcast-mode=block -# order: (position_direction, price, quantity, price_denom, asset_denom, position_effect(open/close), order_type(limit, market,..), leverage) -# need to wait for vote period close to take effect, seem no early stop implemented for vote -# ./build/seid tx dex place-orders sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m Long,1.01,5,usdc,sei,Open,Limit,1 --amount=10000usei -y --from=alice --chain-id=sei --fees=10000usei --gas=50000000 --broadcast-mode=block \ No newline at end of file diff --git a/testutil/fuzzing/dex.go b/testutil/fuzzing/dex.go deleted file mode 100644 index 78070362a..000000000 --- a/testutil/fuzzing/dex.go +++ /dev/null @@ -1,228 +0,0 @@ -package fuzzing - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -const BaselinePrice = 1234.56 - -var ValidAccountCorpus = []string{ - "sei1h9yjz89tl0dl6zu65dpxcqnxfhq60wxx8s5kag", - "sei1c2q6xm0x684rshrnlg898zm3vpwz92pcfhgmws", - "sei1ewxvf5a9wq9zk5nurtl6m9yfxpnhyp7s7uk5sl", - "sei1lllgxa294pshcsrsrteh7sj6ey0zqgty30sl8a", - "sei1vhn2p3xavts9swus27zz3n56tz98g3f6unavs2", - "sei1jpkqjfydghgrc23chmnj52xln0muz09j5huhkt", - "sei1k98zjg7scsmk6d4ye8hhrv3an6ppykvt660736", - "sei1wxpqjzdmtjm6gwg6555n0a0aqglrvnp3pqh9hs", - "sei1yuyyr3xg7jhk7pjkrp4j6h88t7gv35e29pfvmf", - "sei1vjgdad5v2euf98nj3pwg5d8agflr384k0eks43", -} - -var AccountCorpus = append([]string{ - "invalid", -}, ValidAccountCorpus...) - -var ContractCorpus = []string{ - "invalid", - "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m", - "sei1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqms7u8a", -} - -var ( - MicroTick = sdk.MustNewDecFromStr("0.000001") - MilliTick = sdk.MustNewDecFromStr("0.001") - WholeTick = sdk.OneDec() - PairCorpus = []types.Pair{ - {}, - {PriceDenom: "SEI"}, - {AssetDenom: "ATOM"}, - { - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - { - PriceDenom: "SEI", - AssetDenom: "ATOM", - PriceTicksize: &MicroTick, - QuantityTicksize: &MicroTick, - }, - { - PriceDenom: "SEI", - AssetDenom: "ATOM", - PriceTicksize: &MilliTick, - QuantityTicksize: &MilliTick, - }, - { - PriceDenom: "SEI", - AssetDenom: "ATOM", - PriceTicksize: &WholeTick, - QuantityTicksize: &WholeTick, - }, - { - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - { - PriceDenom: "USDC", - AssetDenom: "ATOM", - PriceTicksize: &MicroTick, - QuantityTicksize: &MicroTick, - }, - { - PriceDenom: "USDC", - AssetDenom: "ATOM", - PriceTicksize: &MilliTick, - QuantityTicksize: &MilliTick, - }, - { - PriceDenom: "USDC", - AssetDenom: "ATOM", - PriceTicksize: &WholeTick, - QuantityTicksize: &WholeTick, - }, - } -) - -func GetAccount(i int) string { - ui := uint64(i) % uint64(len(AccountCorpus)) - return AccountCorpus[int(ui)] -} - -func GetValidAccount(i int) string { - ui := uint64(i) % uint64(len(ValidAccountCorpus)) - return ValidAccountCorpus[int(ui)] -} - -func GetContract(i int) string { - ui := uint64(i) % uint64(len(ContractCorpus)) - return ContractCorpus[int(ui)] -} - -func GetPair(i int) types.Pair { - ui := uint64(i) % uint64(len(PairCorpus)) - return PairCorpus[int(ui)] -} - -func GetPlacedOrders(direction types.PositionDirection, orderType types.OrderType, pair types.Pair, prices []byte, quantities []byte) []*types.Order { - // take the shorter slice's length - if len(prices) < len(quantities) { - quantities = quantities[:len(prices)] - } else { - prices = prices[:len(quantities)] - } - res := []*types.Order{} - for i, price := range prices { - var priceDec sdk.Dec - if direction == types.PositionDirection_LONG { - priceDec = sdk.MustNewDecFromStr(fmt.Sprintf("%f", BaselinePrice+float64(price))) - } else { - priceDec = sdk.MustNewDecFromStr(fmt.Sprintf("%f", BaselinePrice-float64(price))) - } - quantity := sdk.NewDec(int64(quantities[i])) - res = append(res, &types.Order{ - Id: uint64(i), - Status: types.OrderStatus_PLACED, - Price: priceDec, - Quantity: quantity, - PositionDirection: direction, - OrderType: orderType, - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - }) - } - return res -} - -func GetOrderBookEntries(buy bool, priceDenom string, assetDenom string, entryWeights []byte, allAccountIndices []byte, allWeights []byte) []types.OrderBookEntry { - res := []types.OrderBookEntry{} - totalPriceWeights := uint64(0) - for _, entryWeight := range entryWeights { - totalPriceWeights += uint64(entryWeight) - } - if totalPriceWeights == uint64(0) { - return res - } - sliceStartAccnt, sliceStartWeights := 0, 0 - cumWeights := uint64(0) - for i, entryWeight := range entryWeights { - var price sdk.Dec - if buy { - price = sdk.MustNewDecFromStr(fmt.Sprintf("%f", BaselinePrice-float64(i))) - } else { - price = sdk.MustNewDecFromStr(fmt.Sprintf("%f", BaselinePrice+float64(i))) - } - cumWeights += uint64(entryWeight) - nextSliceStartAccnt := int(cumWeights * uint64(len(allAccountIndices)) / totalPriceWeights) - nextSliceStartWeights := int(cumWeights * uint64(len(allWeights)) / totalPriceWeights) - entry := types.OrderEntry{ - Price: price, - Quantity: sdk.NewDec(int64(uint64((entryWeight)))), - PriceDenom: priceDenom, - AssetDenom: assetDenom, - Allocations: GetAllocations( - int64(uint64((entryWeight))), - allAccountIndices[sliceStartAccnt:nextSliceStartAccnt], - allWeights[sliceStartWeights:nextSliceStartWeights], - ), - } - if buy { - res = append(res, &types.LongBook{ - Price: price, - Entry: &entry, - }) - } else { - res = append(res, &types.ShortBook{ - Price: price, - Entry: &entry, - }) - } - sliceStartAccnt, sliceStartWeights = nextSliceStartAccnt, nextSliceStartWeights - } - return res -} - -func GetAllocations(totalQuantity int64, accountIndices []byte, weights []byte) []*types.Allocation { - // take the shorter slice's length - if len(accountIndices) < len(weights) { - weights = weights[:len(accountIndices)] - } else { - accountIndices = accountIndices[:len(weights)] - } - // dedupe and aggregate - aggregatedAccountsToWeights := map[string]uint64{} - totalWeight := uint64(0) - for i, accountIdx := range accountIndices { - account := GetValidAccount(int(accountIdx)) - weight := uint64(weights[i]) - if old, ok := aggregatedAccountsToWeights[account]; !ok { - aggregatedAccountsToWeights[account] = weight - } else { - aggregatedAccountsToWeights[account] = old + weight - } - totalWeight += weight - } - - quantityDec := sdk.NewDec(totalQuantity) - totalWeightDec := sdk.NewDec(int64(totalWeight)) - res := []*types.Allocation{} - orderID := 0 - for account, weight := range aggregatedAccountsToWeights { - var quantity sdk.Dec - if totalWeightDec.IsZero() { - quantity = sdk.ZeroDec() - } else { - quantity = quantityDec.Mul(sdk.NewDec(int64(weight))).Quo(totalWeightDec) - } - res = append(res, &types.Allocation{ - OrderId: uint64(orderID), - Account: account, - Quantity: quantity, - }) - orderID++ - } - return res -} diff --git a/testutil/keeper/dex.go b/testutil/keeper/dex.go deleted file mode 100644 index 5681676b7..000000000 --- a/testutil/keeper/dex.go +++ /dev/null @@ -1,196 +0,0 @@ -package keeper - -import ( - "context" - "testing" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/sei-protocol/sei-chain/app" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - epochkeeper "github.com/sei-protocol/sei-chain/x/epoch/keeper" - epochtypes "github.com/sei-protocol/sei-chain/x/epoch/types" - minttypes "github.com/sei-protocol/sei-chain/x/mint/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmdb "github.com/tendermint/tm-db" -) - -const ( - TestAccount = "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx" - TestContract = "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc" - TestAccount2 = "sei1vk2f6aps83xahv2sql4equx8fa95jgcnsdxkvr" - TestContract2 = "sei17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgsrtqewe" - TestPriceDenom = "usdc" - TestAssetDenom = "atom" -) - -var ( - TestTicksize = sdk.OneDec() - TestPair = types.Pair{ - PriceDenom: TestPriceDenom, - AssetDenom: TestAssetDenom, - PriceTicksize: &TestTicksize, - QuantityTicksize: &TestTicksize, - } -) - -func TestApp() *app.App { - return app.Setup(false, false) -} - -func DexKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - keyAcc := sdk.NewKVStoreKey(authtypes.StoreKey) - keyBank := sdk.NewKVStoreKey(banktypes.StoreKey) - keyParams := sdk.NewKVStoreKey(typesparams.StoreKey) - tKeyParams := sdk.NewTransientStoreKey(typesparams.TStoreKey) - keyEpochs := sdk.NewKVStoreKey(epochtypes.StoreKey) - dexMemStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(epochtypes.MemStoreKey) - - blackListAddrs := map[string]bool{} - - maccPerms := map[string][]string{ - types.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - } - - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - stateStore.MountStoreWithDB(keyAcc, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(keyBank, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) - stateStore.MountStoreWithDB(dexMemStoreKey, sdk.StoreTypeMemory, nil) - stateStore.MountStoreWithDB(keyEpochs, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(tKeyParams, sdk.StoreTypeTransient, db) - stateStore.MountStoreWithDB(keyParams, sdk.StoreTypeIAVL, db) - require.NoError(t, stateStore.LoadLatestVersion()) - - cdc := codec.NewProtoCodec(app.MakeEncodingConfig().InterfaceRegistry) - - paramsSubspace := typesparams.NewSubspace(cdc, - types.Amino, - storeKey, - memStoreKey, - "DexParams", - ) - paramsKeeper := paramskeeper.NewKeeper(cdc, codec.NewLegacyAmino(), keyParams, tKeyParams) - accountKeeper := authkeeper.NewAccountKeeper(cdc, keyAcc, paramsKeeper.Subspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms) - bankKeeper := bankkeeper.NewBaseKeeper(cdc, keyBank, accountKeeper, paramsKeeper.Subspace(banktypes.ModuleName), blackListAddrs) - epochKeeper := epochkeeper.NewKeeper(cdc, keyEpochs, memStoreKey, paramsKeeper.Subspace(epochtypes.ModuleName)) - k := keeper.NewKeeper( - cdc, - storeKey, - dexMemStoreKey, - paramsSubspace, - *epochKeeper, - bankKeeper, - accountKeeper, - ) - - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - k.CreateModuleAccount(ctx) - - // Initialize params - k.SetParams(ctx, types.DefaultParams()) - bankParams := banktypes.DefaultParams() - bankParams.SendEnabled = []*banktypes.SendEnabled{ - { - Denom: TestPriceDenom, - Enabled: true, - }, - } - bankKeeper.SetParams(ctx, bankParams) - - return k, ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(dexMemStoreKey))) -} - -func CreateAssetMetadata(keeper *keeper.Keeper, ctx sdk.Context) types.AssetMetadata { - ibcInfo := types.AssetIBCInfo{ - SourceChannel: "channel-1", - DstChannel: "channel-2", - SourceDenom: "uusdc", - SourceChainID: "axelar", - } - - denomUnit := banktypes.DenomUnit{ - Denom: "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", - Exponent: 0, - Aliases: []string{"axlusdc", "usdc"}, - } - - var denomUnits []*banktypes.DenomUnit - denomUnits = append(denomUnits, &denomUnit) - - metadata := banktypes.Metadata{ - Description: "Circle's stablecoin on Axelar", - DenomUnits: denomUnits, - Base: "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", - Name: "USD Coin", - Display: "axlusdc", - Symbol: "USDC", - } - - item := types.AssetMetadata{ - IbcInfo: &ibcInfo, - TypeAsset: "erc20", - Metadata: metadata, - } - - keeper.SetAssetMetadata(ctx, item) - - return item -} - -func SeedPriceSnapshot(ctx sdk.Context, k *keeper.Keeper, price string, timestamp uint64) { - priceSnapshot := types.Price{ - SnapshotTimestampInSeconds: timestamp, - Price: sdk.MustNewDecFromStr(price), - Pair: &TestPair, - } - k.SetPriceState(ctx, priceSnapshot, TestContract) -} - -func CreateNLongBook(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.LongBook { - items := make([]types.LongBook, n) - for i := range items { - items[i].Entry = &types.OrderEntry{ - Price: sdk.NewDec(int64(i)), - Quantity: sdk.NewDec(int64(i)), - PriceDenom: TestPriceDenom, - AssetDenom: TestAssetDenom, - } - items[i].Price = sdk.NewDec(int64(i)) - keeper.SetLongBook(ctx, TestContract, items[i]) - } - return items -} - -func CreateNShortBook(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.ShortBook { - items := make([]types.ShortBook, n) - for i := range items { - items[i].Entry = &types.OrderEntry{ - Price: sdk.NewDec(int64(i)), - Quantity: sdk.NewDec(int64(i)), - PriceDenom: TestPriceDenom, - AssetDenom: TestAssetDenom, - } - items[i].Price = sdk.NewDec(int64(i)) - keeper.SetShortBook(ctx, TestContract, items[i]) - } - return items -} diff --git a/testutil/keeper/epoch.go b/testutil/keeper/epoch.go index 0f5584600..57f91de84 100644 --- a/testutil/keeper/epoch.go +++ b/testutil/keeper/epoch.go @@ -9,6 +9,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/x/epoch/keeper" "github.com/sei-protocol/sei-chain/x/epoch/types" "github.com/stretchr/testify/require" @@ -17,6 +18,10 @@ import ( tmdb "github.com/tendermint/tm-db" ) +func TestApp() *app.App { + return app.Setup(false, false) +} + func EpochKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { storeKey := sdk.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) diff --git a/testutil/processblock/msgs/dex.go b/testutil/processblock/msgs/dex.go deleted file mode 100644 index 6a9e79991..000000000 --- a/testutil/processblock/msgs/dex.go +++ /dev/null @@ -1,101 +0,0 @@ -package msgs - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/utils" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type Market struct { - contract string - priceDenom string - assetDenom string -} - -func NewMarket(contract string, priceDenom string, assetDenom string) *Market { - return &Market{ - contract: contract, - priceDenom: priceDenom, - assetDenom: assetDenom, - } -} - -func (m *Market) Register(admin sdk.AccAddress, deps []string, deposit uint64) []sdk.Msg { - pointOne := sdk.NewDecWithPrec(1, 1) - return []sdk.Msg{dextypes.NewMsgRegisterContract(admin.String(), 0, m.contract, true, utils.Map(deps, func(dep string) *dextypes.ContractDependencyInfo { - return &dextypes.ContractDependencyInfo{Dependency: dep} - }), deposit), dextypes.NewMsgRegisterPairs(admin.String(), []dextypes.BatchContractPair{{ - ContractAddr: m.contract, - Pairs: []*dextypes.Pair{{ - PriceDenom: m.priceDenom, - AssetDenom: m.assetDenom, - PriceTicksize: &pointOne, - QuantityTicksize: &pointOne, - }}, - }})} -} - -func (m *Market) LongLimitOrder(account sdk.AccAddress, price string, quantity string) *dextypes.MsgPlaceOrders { - o := m.commonOrder(account, price, quantity) - o.PositionDirection = dextypes.PositionDirection_LONG - o.OrderType = dextypes.OrderType_LIMIT - return dextypes.NewMsgPlaceOrders(account.String(), []*dextypes.Order{o}, m.contract, fundForOrder(o)) -} - -func (m *Market) ShortLimitOrder(account sdk.AccAddress, price string, quantity string) *dextypes.MsgPlaceOrders { - o := m.commonOrder(account, price, quantity) - o.PositionDirection = dextypes.PositionDirection_SHORT - o.OrderType = dextypes.OrderType_LIMIT - return dextypes.NewMsgPlaceOrders(account.String(), []*dextypes.Order{o}, m.contract, fundForOrder(o)) -} - -func (m *Market) LongMarketOrder(account sdk.AccAddress, price string, quantity string) *dextypes.MsgPlaceOrders { - o := m.commonOrder(account, price, quantity) - o.PositionDirection = dextypes.PositionDirection_LONG - o.OrderType = dextypes.OrderType_MARKET - return dextypes.NewMsgPlaceOrders(account.String(), []*dextypes.Order{o}, m.contract, fundForOrder(o)) -} - -func (m *Market) ShortMarketOrder(account sdk.AccAddress, price string, quantity string) *dextypes.MsgPlaceOrders { - o := m.commonOrder(account, price, quantity) - o.PositionDirection = dextypes.PositionDirection_SHORT - o.OrderType = dextypes.OrderType_MARKET - return dextypes.NewMsgPlaceOrders(account.String(), []*dextypes.Order{o}, m.contract, fundForOrder(o)) -} - -func (m *Market) CancelLongOrder(account sdk.AccAddress, price string, id uint64) *dextypes.MsgCancelOrders { - c := m.commonCancel(account, price, id) - c.PositionDirection = dextypes.PositionDirection_LONG - return dextypes.NewMsgCancelOrders(account.String(), []*dextypes.Cancellation{c}, m.contract) -} - -func (m *Market) CancelShortOrder(account sdk.AccAddress, price string, id uint64) *dextypes.MsgCancelOrders { - c := m.commonCancel(account, price, id) - c.PositionDirection = dextypes.PositionDirection_SHORT - return dextypes.NewMsgCancelOrders(account.String(), []*dextypes.Cancellation{c}, m.contract) -} - -func (m *Market) commonOrder(account sdk.AccAddress, price string, quantity string) *dextypes.Order { - return &dextypes.Order{ - Account: account.String(), - Price: sdk.MustNewDecFromStr(price), - Quantity: sdk.MustNewDecFromStr(quantity), - PriceDenom: m.priceDenom, - AssetDenom: m.assetDenom, - } -} - -func (m *Market) commonCancel(account sdk.AccAddress, price string, id uint64) *dextypes.Cancellation { - return &dextypes.Cancellation{ - Creator: account.String(), - Price: sdk.MustNewDecFromStr(price), - Id: id, - PriceDenom: m.priceDenom, - AssetDenom: m.assetDenom, - ContractAddr: m.contract, - } -} - -func fundForOrder(o *dextypes.Order) sdk.Coins { - return sdk.NewCoins(sdk.NewCoin("usei", o.Price.Mul(o.Quantity).RoundInt())) -} diff --git a/testutil/processblock/presets.go b/testutil/processblock/presets.go index 785046f28..27cb58cb8 100644 --- a/testutil/processblock/presets.go +++ b/testutil/processblock/presets.go @@ -9,9 +9,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/sei-protocol/sei-chain/testutil/processblock/msgs" - "github.com/sei-protocol/sei-chain/utils" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" ) @@ -20,8 +17,6 @@ type Preset struct { SignableAccounts []sdk.AccAddress AllAccounts []sdk.AccAddress AllValidators []sdk.ValAddress - AllContracts []sdk.AccAddress - AllDexMarkets []*msgs.Market } // 3 unsignable accounts @@ -32,7 +27,6 @@ func CommonPreset(app *App) *Preset { fmt.Printf("Distribution module: %s\n", app.AccountKeeper.GetModuleAddress(distrtypes.ModuleName).String()) fmt.Printf("Staking bonded pool: %s\n", app.AccountKeeper.GetModuleAddress(stakingtypes.BondedPoolName).String()) fmt.Printf("Staking unbonded pool: %s\n", app.AccountKeeper.GetModuleAddress(stakingtypes.NotBondedPoolName).String()) - fmt.Printf("Dex module: %s\n", app.AccountKeeper.GetModuleAddress(dextypes.ModuleName).String()) fmt.Printf("Wasm module: %s\n", app.AccountKeeper.GetModuleAddress(wasm.ModuleName).String()) p := &Preset{ Admin: app.NewSignableAccount("admin"), @@ -55,37 +49,7 @@ func CommonPreset(app *App) *Preset { return p } -func DexPreset(app *App, numAccounts int, numMarkets int) *Preset { - p := CommonPreset(app) - for i := 0; i < numAccounts; i++ { - acc := app.NewSignableAccount(fmt.Sprintf("DexPreset%d", i)) - app.FundAccount(acc, 10000000) - p.AllAccounts = append(p.AllAccounts, acc) - p.SignableAccounts = append(p.SignableAccounts, acc) - fmt.Printf("DexPreset account: %s\n", acc.String()) - } - for i := 0; i < numMarkets; i++ { - contract := app.NewContract(p.Admin, "./mars.wasm") - market := msgs.NewMarket(contract.String(), "SEI", fmt.Sprintf("ATOM%d", i)) - p.AllContracts = append(p.AllContracts, contract) - p.AllDexMarkets = append(p.AllDexMarkets, market) - fmt.Printf("DexPreset contract: %s\n", contract.String()) - } - return p -} - // always with enough fee func (p *Preset) AdminSign(app *App, msgs ...sdk.Msg) signing.Tx { return app.Sign(p.Admin, 10000000, msgs...) } - -func (p *Preset) DoRegisterMarkets(app *App) { - block := utils.Map(p.AllDexMarkets, func(m *msgs.Market) signing.Tx { - return p.AdminSign(app, m.Register(p.Admin, []string{}, 20000000)...) - }) - for i, code := range app.RunBlock(block) { - if code != 0 { - panic(fmt.Sprintf("error code %d when registering the %d-th market", code, i)) - } - } -} diff --git a/testutil/processblock/verify/bank.go b/testutil/processblock/verify/bank.go index 580ee5b85..2bd76fe9f 100644 --- a/testutil/processblock/verify/bank.go +++ b/testutil/processblock/verify/bank.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/signing" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/sei-protocol/sei-chain/testutil/processblock" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" "github.com/stretchr/testify/require" ) @@ -32,12 +31,6 @@ func Balance(t *testing.T, app *processblock.App, f BlockRunnable, txs []signing for _, output := range m.Outputs { updateMultipleExpectedBalanceChange(expectedChanges, output.Address, output.Coins, true) } - case *dextypes.MsgPlaceOrders: - updateMultipleExpectedBalanceChange(expectedChanges, m.Creator, m.Funds, false) - updateMultipleExpectedBalanceChange(expectedChanges, m.ContractAddr, m.Funds, true) - case *dextypes.MsgRegisterContract: - funds := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(int64(m.Contract.RentBalance)))) - updateMultipleExpectedBalanceChange(expectedChanges, m.Creator, funds, false) default: // TODO: add coverage for other balance-affecting messages to enable testing for those message types continue diff --git a/testutil/processblock/verify/dex.go b/testutil/processblock/verify/dex.go deleted file mode 100644 index cfc5a2779..000000000 --- a/testutil/processblock/verify/dex.go +++ /dev/null @@ -1,269 +0,0 @@ -package verify - -import ( - "sort" - "strings" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/signing" - "github.com/sei-protocol/sei-chain/testutil/processblock" - "github.com/sei-protocol/sei-chain/utils" - dexkeeper "github.com/sei-protocol/sei-chain/x/dex/keeper" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func DexOrders(t *testing.T, app *processblock.App, f BlockRunnable, txs []signing.Tx) BlockRunnable { - return func() []uint32 { - orderPlacementsByMarket := map[string][]*dextypes.Order{} - orderCancellationsByMarket := map[string][]*dextypes.Cancellation{} - markets := map[string]struct{}{} - for _, tx := range txs { - for _, msg := range tx.GetMsgs() { - switch m := msg.(type) { - case *dextypes.MsgPlaceOrders: - for _, o := range m.Orders { - id := strings.Join([]string{m.ContractAddr, o.PriceDenom, o.AssetDenom}, ",") - markets[id] = struct{}{} - if orders, ok := orderPlacementsByMarket[id]; ok { - o.Id = app.DexKeeper.GetNextOrderID(app.Ctx(), m.ContractAddr) + uint64(len(orders)) - orderPlacementsByMarket[id] = append(orders, o) - } else { - o.Id = app.DexKeeper.GetNextOrderID(app.Ctx(), m.ContractAddr) - orderPlacementsByMarket[id] = []*dextypes.Order{o} - } - } - case *dextypes.MsgCancelOrders: - for _, o := range m.Cancellations { - id := strings.Join([]string{m.ContractAddr, o.PriceDenom, o.AssetDenom}, ",") - markets[id] = struct{}{} - if cancels, ok := orderCancellationsByMarket[id]; ok { - orderCancellationsByMarket[id] = append(cancels, o) - } else { - orderCancellationsByMarket[id] = []*dextypes.Cancellation{o} - } - } - default: - continue - } - } - } - expectedLongBookByMarket := map[string]map[string]*dextypes.OrderEntry{} - expectedShortBookByMarket := map[string]map[string]*dextypes.OrderEntry{} - for market := range markets { - orderPlacements := []*dextypes.Order{} - if o, ok := orderPlacementsByMarket[market]; ok { - orderPlacements = o - } - orderCancellations := []*dextypes.Cancellation{} - if c, ok := orderCancellationsByMarket[market]; ok { - orderCancellations = c - } - parts := strings.Split(market, ",") - longBook, shortBook := expectedOrdersForMarket(app.Ctx(), &app.DexKeeper, orderPlacements, orderCancellations, parts[0], parts[1], parts[2]) - expectedLongBookByMarket[market] = longBook - expectedShortBookByMarket[market] = shortBook - } - - results := f() - - for market, longBook := range expectedLongBookByMarket { - parts := strings.Split(market, ",") - contract := parts[0] - priceDenom := parts[1] - assetDenom := parts[2] - require.Equal(t, len(longBook), len(app.DexKeeper.GetAllLongBookForPair(app.Ctx(), contract, priceDenom, assetDenom))) - for price, entry := range longBook { - actual, found := app.DexKeeper.GetLongOrderBookEntryByPrice(app.Ctx(), contract, sdk.MustNewDecFromStr(price), priceDenom, assetDenom) - require.True(t, found) - require.Equal(t, *entry, *(actual.GetOrderEntry())) - } - } - - for market, shortBook := range expectedShortBookByMarket { - parts := strings.Split(market, ",") - contract := parts[0] - priceDenom := parts[1] - assetDenom := parts[2] - require.Equal(t, len(shortBook), len(app.DexKeeper.GetAllShortBookForPair(app.Ctx(), contract, priceDenom, assetDenom))) - for price, entry := range shortBook { - actual, found := app.DexKeeper.GetShortOrderBookEntryByPrice(app.Ctx(), contract, sdk.MustNewDecFromStr(price), priceDenom, assetDenom) - require.True(t, found) - require.Equal(t, *entry, *(actual.GetOrderEntry())) - } - } - - return results - } -} - -// A slow but correct implementation of dex exchange logics that build the expected order book state based on the -// current state and the list of new orders/cancellations, based on dex exchange rules. -func expectedOrdersForMarket( - ctx sdk.Context, - keeper *dexkeeper.Keeper, - orderPlacements []*dextypes.Order, - orderCancellations []*dextypes.Cancellation, - contract string, - priceDenom string, - assetDenom string, -) (longEntries map[string]*dextypes.OrderEntry, shortEntries map[string]*dextypes.OrderEntry) { - longBook := toOrderBookMap(keeper.GetAllLongBookForPair(ctx, contract, priceDenom, assetDenom)) - shortBook := toOrderBookMap(keeper.GetAllShortBookForPair(ctx, contract, priceDenom, assetDenom)) - books := map[dextypes.PositionDirection]map[string]*dextypes.OrderEntry{ - dextypes.PositionDirection_LONG: longBook, - dextypes.PositionDirection_SHORT: shortBook, - } - // first, cancellation - cancelOrders(books, orderCancellations) - // then add new limit orders to book - addOrders(books, orderPlacements) - // then match market orders - matchOrders(getMarketOrderBookMap(orderPlacements, dextypes.PositionDirection_LONG), shortBook) - matchOrders(longBook, getMarketOrderBookMap(orderPlacements, dextypes.PositionDirection_SHORT)) - // finally match limit orders - matchOrders(longBook, shortBook) - return longBook, shortBook -} - -func cancelOrders( - books map[dextypes.PositionDirection]map[string]*dextypes.OrderEntry, - orderCancellations []*dextypes.Cancellation, -) { - for _, cancel := range orderCancellations { - book := books[cancel.PositionDirection] - if entry, ok := book[cancel.Price.String()]; ok { - entry.Allocations = removeMatched(entry.Allocations, func(a *dextypes.Allocation) bool { return a.OrderId == cancel.Id }) - updateEntryQuantity(entry) - if entry.Quantity.IsZero() { - delete(book, cancel.Price.String()) - } - } - } -} - -func addOrders( - books map[dextypes.PositionDirection]map[string]*dextypes.OrderEntry, - orderPlacements []*dextypes.Order, -) { - for _, o := range orderPlacements { - if o.OrderType != dextypes.OrderType_LIMIT { - continue - } - book := books[o.PositionDirection] - newAllocation := &dextypes.Allocation{ - Account: o.Account, - Quantity: o.Quantity, - OrderId: o.Id, - } - if entry, ok := book[o.Price.String()]; ok { - entry.Allocations = append(entry.Allocations, newAllocation) - updateEntryQuantity(entry) - } else { - book[o.Price.String()] = &dextypes.OrderEntry{ - Price: o.Price, - Quantity: o.Quantity, - PriceDenom: o.PriceDenom, - AssetDenom: o.AssetDenom, - Allocations: []*dextypes.Allocation{newAllocation}, - } - } - } -} - -func matchOrders( - longBook map[string]*dextypes.OrderEntry, - shortBook map[string]*dextypes.OrderEntry, -) { - buyPrices := sortedPrices(longBook, true) - sellPrices := sortedPrices(shortBook, false) - for i, j := 0, 0; i < len(buyPrices) && j < len(sellPrices) && buyPrices[i].GTE(sellPrices[j]); { - buyEntry := longBook[buyPrices[i].String()] - sellEntry := shortBook[sellPrices[j].String()] - if buyEntry.Quantity.GT(sellEntry.Quantity) { - takeLiquidity(longBook, buyPrices[i], sellEntry.Quantity) - takeLiquidity(shortBook, sellPrices[i], sellEntry.Quantity) - j++ - } else { - takeLiquidity(longBook, buyPrices[i], buyEntry.Quantity) - takeLiquidity(shortBook, sellPrices[i], buyEntry.Quantity) - i++ - } - } -} - -func toOrderBookMap(book []dextypes.OrderBookEntry) map[string]*dextypes.OrderEntry { - bookMap := map[string]*dextypes.OrderEntry{} - for _, e := range book { - bookMap[e.GetPrice().String()] = e.GetOrderEntry() - } - return bookMap -} - -func getMarketOrderBookMap(orderPlacements []*dextypes.Order, direction dextypes.PositionDirection) map[string]*dextypes.OrderEntry { - bookMap := map[string]*dextypes.OrderEntry{} - for _, o := range orderPlacements { - if o.OrderType != dextypes.OrderType_MARKET || o.PositionDirection != direction { - continue - } - bookMap[o.Price.String()] = orderToOrderEntry(o) - } - return bookMap -} - -func updateEntryQuantity(entry *dextypes.OrderEntry) { - entry.Quantity = utils.Reduce( - entry.Allocations, - func(a *dextypes.Allocation, q sdk.Dec) sdk.Dec { return q.Add(a.Quantity) }, - sdk.ZeroDec(), - ) -} - -func takeLiquidity(book map[string]*dextypes.OrderEntry, price sdk.Dec, quantity sdk.Dec) { - entry := book[price.String()] - if entry.Quantity.Equal(quantity) { - delete(book, price.String()) - return - } - if quantity.GT(entry.Quantity) { - panic("insufficient liquidity") - } - allocated := sdk.ZeroDec() - newAllocations := []*dextypes.Allocation{} - for _, a := range entry.Allocations { - switch { - case allocated.Equal(quantity): - newAllocations = append(newAllocations, a) - case allocated.Add(a.Quantity).GT(quantity): - a.Quantity = a.Quantity.Sub(quantity.Sub(allocated)) - newAllocations = append(newAllocations, a) - allocated = quantity - default: - allocated = allocated.Add(a.Quantity) - } - } - entry.Allocations = newAllocations - entry.Quantity = entry.Quantity.Sub(quantity) -} - -func sortedPrices(book map[string]*dextypes.OrderEntry, descending bool) []sdk.Dec { - prices := []sdk.Dec{} - for p := range book { - prices = append(prices, sdk.MustNewDecFromStr(p)) - } - if descending { - sort.Slice(prices, func(i, j int) bool { return prices[i].GT(prices[j]) }) - } else { - sort.Slice(prices, func(i, j int) bool { return prices[i].LT(prices[j]) }) - } - return prices -} - -func orderToOrderEntry(order *dextypes.Order) *dextypes.OrderEntry { - return &dextypes.OrderEntry{ - Price: order.Price, - Quantity: order.Quantity, - Allocations: []*dextypes.Allocation{{Quantity: order.Quantity}}, - } -} diff --git a/wasmbinding/bindings/msg.go b/wasmbinding/bindings/msg.go index 7e633640d..cb9fdff46 100644 --- a/wasmbinding/bindings/msg.go +++ b/wasmbinding/bindings/msg.go @@ -3,7 +3,6 @@ package bindings import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/sei-protocol/sei-chain/x/dex/types" ) // / CreateDenom creates a new factory denom, of denomination: @@ -35,18 +34,6 @@ type BurnTokens struct { Amount sdk.Coin `json:"amount"` } -// Dex Module msgs -type PlaceOrders struct { - Orders []*types.Order `json:"orders"` - Funds sdk.Coins `json:"funds"` - ContractAddr string `json:"contract_address"` -} - -type CancelOrders struct { - Cancellations []*types.Cancellation `json:"cancellations"` - ContractAddr string `json:"contract_address"` -} - type CallEVM struct { Value *sdk.Int `json:"value"` To string `json:"to"` diff --git a/wasmbinding/encoder.go b/wasmbinding/encoder.go index 1e691b8d6..087e00279 100644 --- a/wasmbinding/encoder.go +++ b/wasmbinding/encoder.go @@ -7,14 +7,11 @@ import ( wasmvmtypes "github.com/CosmWasm/wasmvm/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - dexwasm "github.com/sei-protocol/sei-chain/x/dex/client/wasm" evmwasm "github.com/sei-protocol/sei-chain/x/evm/client/wasm" tokenfactorywasm "github.com/sei-protocol/sei-chain/x/tokenfactory/client/wasm" ) type SeiWasmMessage struct { - PlaceOrders json.RawMessage `json:"place_orders,omitempty"` - CancelOrders json.RawMessage `json:"cancel_orders,omitempty"` CreateDenom json.RawMessage `json:"create_denom,omitempty"` MintTokens json.RawMessage `json:"mint_tokens,omitempty"` BurnTokens json.RawMessage `json:"burn_tokens,omitempty"` @@ -30,10 +27,6 @@ func CustomEncoder(sender sdk.AccAddress, msg json.RawMessage, info wasmvmtypes. return []sdk.Msg{}, sdkerrors.Wrap(err, "Error parsing Sei Wasm Message") } switch { - case parsedMessage.PlaceOrders != nil: - return dexwasm.EncodeDexPlaceOrders(parsedMessage.PlaceOrders, sender) - case parsedMessage.CancelOrders != nil: - return dexwasm.EncodeDexCancelOrders(parsedMessage.CancelOrders, sender) case parsedMessage.CreateDenom != nil: return tokenfactorywasm.EncodeTokenFactoryCreateDenom(parsedMessage.CreateDenom, sender) case parsedMessage.MintTokens != nil: diff --git a/wasmbinding/queries.go b/wasmbinding/queries.go index 122bb712b..de60fed50 100644 --- a/wasmbinding/queries.go +++ b/wasmbinding/queries.go @@ -7,9 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/utils/metrics" - dexwasm "github.com/sei-protocol/sei-chain/x/dex/client/wasm" - dexbindings "github.com/sei-protocol/sei-chain/x/dex/client/wasm/bindings" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" epochwasm "github.com/sei-protocol/sei-chain/x/epoch/client/wasm" epochbindings "github.com/sei-protocol/sei-chain/x/epoch/client/wasm/bindings" epochtypes "github.com/sei-protocol/sei-chain/x/epoch/types" @@ -25,17 +22,15 @@ import ( type QueryPlugin struct { oracleHandler oraclewasm.OracleWasmQueryHandler - dexHandler dexwasm.DexWasmQueryHandler epochHandler epochwasm.EpochWasmQueryHandler tokenfactoryHandler tokenfactorywasm.TokenFactoryWasmQueryHandler evmHandler evmwasm.EVMQueryHandler } // NewQueryPlugin returns a reference to a new QueryPlugin. -func NewQueryPlugin(oh *oraclewasm.OracleWasmQueryHandler, dh *dexwasm.DexWasmQueryHandler, eh *epochwasm.EpochWasmQueryHandler, th *tokenfactorywasm.TokenFactoryWasmQueryHandler, evmh *evmwasm.EVMQueryHandler) *QueryPlugin { +func NewQueryPlugin(oh *oraclewasm.OracleWasmQueryHandler, eh *epochwasm.EpochWasmQueryHandler, th *tokenfactorywasm.TokenFactoryWasmQueryHandler, evmh *evmwasm.EVMQueryHandler) *QueryPlugin { return &QueryPlugin{ oracleHandler: *oh, - dexHandler: *dh, epochHandler: *eh, tokenfactoryHandler: *th, evmHandler: *evmh, @@ -75,72 +70,6 @@ func (qp QueryPlugin) HandleOracleQuery(ctx sdk.Context, queryData json.RawMessa } } -func (qp QueryPlugin) HandleDexQuery(ctx sdk.Context, queryData json.RawMessage) ([]byte, error) { - var parsedQuery dexbindings.SeiDexQuery - if err := json.Unmarshal(queryData, &parsedQuery); err != nil { - return nil, dextypes.ErrParsingSeiDexQuery - } - switch { - case parsedQuery.DexTwaps != nil: - res, err := qp.dexHandler.GetDexTwap(ctx, parsedQuery.DexTwaps) - if err != nil { - return nil, err - } - bz, err := json.Marshal(res) - if err != nil { - return nil, dextypes.ErrEncodingDexTwaps - } - - return bz, nil - case parsedQuery.GetOrders != nil: - res, err := qp.dexHandler.GetOrders(ctx, parsedQuery.GetOrders) - if err != nil { - return nil, err - } - bz, err := json.Marshal(res) - if err != nil { - return nil, dextypes.ErrEncodingOrders - } - - return bz, nil - case parsedQuery.GetOrderByID != nil: - res, err := qp.dexHandler.GetOrderByID(ctx, parsedQuery.GetOrderByID) - if err != nil { - return nil, err - } - bz, err := json.Marshal(res) - if err != nil { - return nil, dextypes.ErrEncodingOrder - } - - return bz, nil - case parsedQuery.GetOrderSimulation != nil: - res, err := qp.dexHandler.GetOrderSimulation(ctx, parsedQuery.GetOrderSimulation) - if err != nil { - return nil, err - } - bz, err := json.Marshal(res) - if err != nil { - return nil, dextypes.ErrEncodingOrderSimulation - } - - return bz, nil - case parsedQuery.GetLatestPrice != nil: - res, err := qp.dexHandler.GetLatestPrice(ctx, parsedQuery.GetLatestPrice) - if err != nil { - return nil, err - } - bz, err := json.Marshal(res) - if err != nil { - return nil, dextypes.ErrEncodingLatestPrice - } - - return bz, nil - default: - return nil, dextypes.ErrUnknownSeiDexQuery - } -} - func (qp QueryPlugin) HandleEpochQuery(ctx sdk.Context, queryData json.RawMessage) ([]byte, error) { var parsedQuery epochbindings.SeiEpochQuery if err := json.Unmarshal(queryData, &parsedQuery); err != nil { diff --git a/wasmbinding/query_plugin.go b/wasmbinding/query_plugin.go index db21e9404..aa24663be 100644 --- a/wasmbinding/query_plugin.go +++ b/wasmbinding/query_plugin.go @@ -10,7 +10,6 @@ import ( const ( OracleRoute = "oracle" - DexRoute = "dex" EpochRoute = "epoch" TokenFactoryRoute = "tokenfactory" EVMRoute = "evm" @@ -32,8 +31,6 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag switch contractQuery.Route { case OracleRoute: return qp.HandleOracleQuery(ctx, contractQuery.QueryData) - case DexRoute: - return qp.HandleDexQuery(ctx, contractQuery.QueryData) case EpochRoute: return qp.HandleEpochQuery(ctx, contractQuery.QueryData) case TokenFactoryRoute: diff --git a/wasmbinding/test/encoder_test.go b/wasmbinding/test/encoder_test.go index 439c3a707..0e55393cb 100644 --- a/wasmbinding/test/encoder_test.go +++ b/wasmbinding/test/encoder_test.go @@ -6,9 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/wasmbinding/bindings" - dexwasm "github.com/sei-protocol/sei-chain/x/dex/client/wasm" - "github.com/sei-protocol/sei-chain/x/dex/types" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" tokenfactorywasm "github.com/sei-protocol/sei-chain/x/tokenfactory/client/wasm" tokenfactorytypes "github.com/sei-protocol/sei-chain/x/tokenfactory/types" "github.com/stretchr/testify/require" @@ -19,71 +16,6 @@ const ( TEST_CREATOR = "sei1y3pxq5dp900czh0mkudhjdqjq5m8cpmmps8yjw" ) -func TestEncodePlaceOrder(t *testing.T) { - contractAddr, err := sdk.AccAddressFromBech32("sei1y3pxq5dp900czh0mkudhjdqjq5m8cpmmps8yjw") - require.NoError(t, err) - order := dextypes.Order{ - PositionDirection: dextypes.PositionDirection_LONG, - OrderType: dextypes.OrderType_LIMIT, - PriceDenom: "USDC", - AssetDenom: "SEI", - Price: sdk.MustNewDecFromStr("10"), - Quantity: sdk.OneDec(), - Data: "{\"position_effect\":\"OPEN\", \"leverage\":\"1\"}", - Nominal: sdk.ZeroDec(), - TriggerPrice: sdk.ZeroDec(), - TriggerStatus: false, - } - fund := sdk.NewCoin("usei", sdk.NewInt(1000000000)) - msg := bindings.PlaceOrders{ - Orders: []*dextypes.Order{&order}, - Funds: []sdk.Coin{fund}, - ContractAddr: TEST_TARGET_CONTRACT, - } - serializedMsg, _ := json.Marshal(msg) - - decodedMsgs, err := dexwasm.EncodeDexPlaceOrders(serializedMsg, contractAddr) - require.NoError(t, err) - require.Equal(t, 1, len(decodedMsgs)) - typedDecodedMsg, ok := decodedMsgs[0].(*dextypes.MsgPlaceOrders) - require.True(t, ok) - expectedMsg := dextypes.MsgPlaceOrders{ - Creator: TEST_CREATOR, - Orders: []*dextypes.Order{&order}, - ContractAddr: TEST_TARGET_CONTRACT, - Funds: []sdk.Coin{fund}, - } - require.Equal(t, expectedMsg, *typedDecodedMsg) -} - -func TestDecodeOrderCancellation(t *testing.T) { - contractAddr, err := sdk.AccAddressFromBech32("sei1y3pxq5dp900czh0mkudhjdqjq5m8cpmmps8yjw") - require.NoError(t, err) - msg := bindings.CancelOrders{ - Cancellations: []*types.Cancellation{ - {Id: 1}, - }, - ContractAddr: TEST_TARGET_CONTRACT, - } - serializedMsg, _ := json.Marshal(msg) - - decodedMsgs, err := dexwasm.EncodeDexCancelOrders(serializedMsg, contractAddr) - require.NoError(t, err) - require.Equal(t, 1, len(decodedMsgs)) - typedDecodedMsg, ok := decodedMsgs[0].(*dextypes.MsgCancelOrders) - require.True(t, ok) - expectedMsg := dextypes.MsgCancelOrders{ - Creator: TEST_CREATOR, - Cancellations: []*types.Cancellation{ - {Id: 1, Price: sdk.ZeroDec()}, - }, - ContractAddr: TEST_TARGET_CONTRACT, - } - require.Equal(t, expectedMsg.Creator, typedDecodedMsg.Creator) - require.Equal(t, *expectedMsg.Cancellations[0], *typedDecodedMsg.Cancellations[0]) - require.Equal(t, expectedMsg.ContractAddr, typedDecodedMsg.ContractAddr) -} - func TestEncodeCreateDenom(t *testing.T) { contractAddr, err := sdk.AccAddressFromBech32("sei1y3pxq5dp900czh0mkudhjdqjq5m8cpmmps8yjw") require.NoError(t, err) diff --git a/wasmbinding/test/query_test.go b/wasmbinding/test/query_test.go index c4dd219bb..d02a72f1c 100644 --- a/wasmbinding/test/query_test.go +++ b/wasmbinding/test/query_test.go @@ -1,7 +1,6 @@ package wasmbinding import ( - "context" "encoding/json" "fmt" "testing" @@ -12,13 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sei-protocol/sei-chain/app" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/sei-protocol/sei-chain/wasmbinding" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - dexwasm "github.com/sei-protocol/sei-chain/x/dex/client/wasm" - dexbinding "github.com/sei-protocol/sei-chain/x/dex/client/wasm/bindings" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" epochwasm "github.com/sei-protocol/sei-chain/x/epoch/client/wasm" epochbinding "github.com/sei-protocol/sei-chain/x/epoch/client/wasm/bindings" epochtypes "github.com/sei-protocol/sei-chain/x/epoch/types" @@ -40,11 +33,10 @@ func SetupWasmbindingTest(t *testing.T) (*app.TestWrapper, func(ctx sdk.Context, testWrapper := app.NewTestWrapper(t, tm, valPub, false) oh := oraclewasm.NewOracleWasmQueryHandler(&testWrapper.App.OracleKeeper) - dh := dexwasm.NewDexWasmQueryHandler(&testWrapper.App.DexKeeper) eh := epochwasm.NewEpochWasmQueryHandler(&testWrapper.App.EpochKeeper) th := tokenfactorywasm.NewTokenFactoryWasmQueryHandler(&testWrapper.App.TokenFactoryKeeper) evmh := evmwasm.NewEVMQueryHandler(&testWrapper.App.EvmKeeper) - qp := wasmbinding.NewQueryPlugin(oh, dh, eh, th, evmh) + qp := wasmbinding.NewQueryPlugin(oh, eh, th, evmh) return testWrapper, wasmbinding.CustomQuerier(qp) } @@ -62,17 +54,6 @@ func TestWasmUnknownQuery(t *testing.T) { require.Error(t, err) require.Equal(t, err, oracletypes.ErrUnknownSeiOracleQuery) - dex_req := dexbinding.SeiDexQuery{} - queryData, err = json.Marshal(dex_req) - require.NoError(t, err) - query = wasmbinding.SeiQueryWrapper{Route: wasmbinding.DexRoute, QueryData: queryData} - rawQuery, err = json.Marshal(query) - require.NoError(t, err) - - _, err = customQuerier(testWrapper.Ctx, rawQuery) - require.Error(t, err) - require.Equal(t, err, dextypes.ErrUnknownSeiDexQuery) - epoch_req := epochbinding.SeiEpochQuery{} queryData, err = json.Marshal(epoch_req) require.NoError(t, err) @@ -180,116 +161,6 @@ func TestWasmGetOracleTwapsErrorHandling(t *testing.T) { require.Equal(t, err, oracletypes.ErrInvalidTwapLookback) } -func TestWasmGetDexTwaps(t *testing.T) { - testWrapper, customQuerier := SetupWasmbindingTest(t) - - req := dexbinding.SeiDexQuery{DexTwaps: &dextypes.QueryGetTwapsRequest{ - ContractAddr: app.TestContract, - LookbackSeconds: 200, - }} - queryData, err := json.Marshal(req) - require.NoError(t, err) - query := wasmbinding.SeiQueryWrapper{Route: wasmbinding.DexRoute, QueryData: queryData} - - rawQuery, err := json.Marshal(query) - require.NoError(t, err) - - testWrapper.Ctx = testWrapper.Ctx.WithBlockHeight(11).WithBlockTime(time.Unix(3600, 0)) - testWrapper.App.DexKeeper.AddRegisteredPair( - testWrapper.Ctx, - app.TestContract, - dextypes.Pair{PriceDenom: "sei", AssetDenom: "atom"}, - ) - testWrapper.App.DexKeeper.SetPriceState(testWrapper.Ctx, dextypes.Price{ - SnapshotTimestampInSeconds: 3600, - Price: sdk.NewDec(20), - Pair: &dextypes.Pair{PriceDenom: "sei", AssetDenom: "atom"}, - }, app.TestContract) - testWrapper.App.OracleKeeper.SetBaseExchangeRate(testWrapper.Ctx, oracleutils.MicroAtomDenom, sdk.NewDec(12)) - testWrapper.Ctx = testWrapper.Ctx.WithBlockHeight(14).WithBlockTime(time.Unix(3700, 0)) - - res, err := customQuerier(testWrapper.Ctx, rawQuery) - require.NoError(t, err) - - var parsedRes dextypes.QueryGetTwapsResponse - err = json.Unmarshal(res, &parsedRes) - require.NoError(t, err) - require.Equal(t, 1, len(parsedRes.Twaps)) - twap := *parsedRes.Twaps[0] - require.Equal(t, "sei", twap.Pair.PriceDenom) - require.Equal(t, "atom", twap.Pair.AssetDenom) - require.Equal(t, sdk.NewDec(20), twap.Twap) -} - -func TestWasmDexGetOrderByIdErrorHandling(t *testing.T) { - testWrapper, customQuerier := SetupWasmbindingTest(t) - - req := dexbinding.SeiDexQuery{GetOrderByID: &dextypes.QueryGetOrderByIDRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Id: 1, - }} - queryData, err := json.Marshal(req) - require.NoError(t, err) - query := wasmbinding.SeiQueryWrapper{Route: wasmbinding.DexRoute, QueryData: queryData} - - rawQuery, err := json.Marshal(query) - require.NoError(t, err) - - _, err = customQuerier(testWrapper.Ctx, rawQuery) - require.Error(t, err) - require.IsType(t, dextypes.ErrInvalidOrderID, err) -} - -func TestWasmGetOrderSimulation(t *testing.T) { - testWrapper, customQuerier := SetupWasmbindingTest(t) - - order := dextypes.Order{ - PositionDirection: dextypes.PositionDirection_LONG, - OrderType: dextypes.OrderType_LIMIT, - PriceDenom: "USDC", - AssetDenom: "SEI", - Price: sdk.MustNewDecFromStr("10"), - Quantity: sdk.OneDec(), - Data: "{\"position_effect\":\"OPEN\", \"leverage\":\"1\"}", - } - - req := dexbinding.SeiDexQuery{GetOrderSimulation: &dextypes.QueryOrderSimulationRequest{ - Order: &order, - }} - queryData, err := json.Marshal(req) - require.NoError(t, err) - query := wasmbinding.SeiQueryWrapper{Route: wasmbinding.DexRoute, QueryData: queryData} - - rawQuery, err := json.Marshal(query) - require.NoError(t, err) - - testWrapper.Ctx = testWrapper.Ctx.WithBlockHeight(11).WithBlockTime(time.Unix(3600, 0)) - testWrapper.Ctx = testWrapper.Ctx.WithContext(context.WithValue(testWrapper.Ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testWrapper.App.GetMemKey(dextypes.MemStoreKey)))) - testWrapper.App.DexKeeper.AddRegisteredPair( - testWrapper.Ctx, - app.TestContract, - dextypes.Pair{PriceDenom: "sei", AssetDenom: "atom"}, - ) - testWrapper.App.DexKeeper.SetPriceState(testWrapper.Ctx, dextypes.Price{ - SnapshotTimestampInSeconds: 3600, - Price: sdk.NewDec(20), - Pair: &dextypes.Pair{PriceDenom: "sei", AssetDenom: "atom"}, - }, app.TestContract) - testWrapper.App.OracleKeeper.SetBaseExchangeRate(testWrapper.Ctx, oracleutils.MicroAtomDenom, sdk.NewDec(12)) - testWrapper.Ctx = testWrapper.Ctx.WithBlockHeight(14).WithBlockTime(time.Unix(3700, 0)) - testWrapper.Ctx = testWrapper.Ctx.WithContext(context.WithValue(testWrapper.Ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testWrapper.App.GetMemKey(dextypes.MemStoreKey)))) - - res, err := customQuerier(testWrapper.Ctx, rawQuery) - require.NoError(t, err) - - var parsedRes dextypes.QueryOrderSimulationResponse - err = json.Unmarshal(res, &parsedRes) - require.NoError(t, err) - require.Equal(t, sdk.NewDec(0), *parsedRes.ExecutedQuantity) -} - func TestWasmGetEpoch(t *testing.T) { testWrapper, customQuerier := SetupWasmbindingTest(t) diff --git a/wasmbinding/wasm.go b/wasmbinding/wasm.go index 0d50fb0cb..bc2d492f2 100644 --- a/wasmbinding/wasm.go +++ b/wasmbinding/wasm.go @@ -7,8 +7,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" aclkeeper "github.com/cosmos/cosmos-sdk/x/accesscontrol/keeper" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - dexwasm "github.com/sei-protocol/sei-chain/x/dex/client/wasm" - dexkeeper "github.com/sei-protocol/sei-chain/x/dex/keeper" epochwasm "github.com/sei-protocol/sei-chain/x/epoch/client/wasm" epochkeeper "github.com/sei-protocol/sei-chain/x/epoch/keeper" evmwasm "github.com/sei-protocol/sei-chain/x/evm/client/wasm" @@ -21,7 +19,6 @@ import ( func RegisterCustomPlugins( oracle *oraclekeeper.Keeper, - dex *dexkeeper.Keeper, epoch *epochkeeper.Keeper, tokenfactory *tokenfactorykeeper.Keeper, _ *authkeeper.AccountKeeper, @@ -34,12 +31,11 @@ func RegisterCustomPlugins( aclKeeper aclkeeper.Keeper, evmKeeper *evmkeeper.Keeper, ) []wasmkeeper.Option { - dexHandler := dexwasm.NewDexWasmQueryHandler(dex) oracleHandler := oraclewasm.NewOracleWasmQueryHandler(oracle) epochHandler := epochwasm.NewEpochWasmQueryHandler(epoch) tokenfactoryHandler := tokenfactorywasm.NewTokenFactoryWasmQueryHandler(tokenfactory) evmHandler := evmwasm.NewEVMQueryHandler(evmKeeper) - wasmQueryPlugin := NewQueryPlugin(oracleHandler, dexHandler, epochHandler, tokenfactoryHandler, evmHandler) + wasmQueryPlugin := NewQueryPlugin(oracleHandler, epochHandler, tokenfactoryHandler, evmHandler) queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{ Custom: CustomQuerier(wasmQueryPlugin), diff --git a/x/dex/README.md b/x/dex/README.md deleted file mode 100644 index fd623e859..000000000 --- a/x/dex/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## Abstract - -Provides fast order matching for CosmWasm contracts. - -## Contents -`dex` provides order placement/cancellation/settlement capabilities for registered contracts, as well as exchange price resulting from the order matching. The implementation of the exchange logic and store writes happen at the end of each block, based on in-memory data passed on by `dex` transactions in the same block. In other words, `DeliverTx` only adds data to memory (a custom data structure, not Cosmos's cache store), and -`EndBlock` uses those in-memory data to perform batched order matching. The `EndBlock` order matching process also involves calling `Sudo` endpoints defined on the registerd contracts, as long as those endpoints conform with the expected interface, so that the registered contracts can perform custom logic based on the exchange information. - -## Concepts -Contract Registration -A contract can be registered with `MsgRegisterContract` type. There are a few related concepts: -### Order-related Sudo Calls -For `dex` to perform order matching for a registered contract, it MUST define 3 `Sudo` endpoints: -- "bulk_order_placements": payload expected can be found in [x/dex/types/order_placement.go] -- "bulk_order_cancellations": payload expected can be found in [x/dex/types/order_cancellation.go] -- "settlement": payload expected can be found in [x/dex/types/settlement.go] -If any of the three endpoints is missing, or if the endpoint is ill-defined, `dex` will skip the contract's order matching. -### Asset Pair Registration -A contract may define one or more tradable pairs with `dex`. For example, a spot trading contract may define a pair with price denomination `USDC` and asset denomination `BTC`. The exact semantics for asset pair registration can be found in the `Governance` section below. A contract with no registered pair is valid - it simply won't have any trading activity in `dex`. -### Rent -A contract must deposit a certain amount of `usei` into `dex` upon registration or through subsequent top-ups. Those `usei`, also known as rent, will be consumed when the contract's `Sudo` endpoints are called based on the gas meter reading, and distributed to Sei validators. Note that if a `Sudo` endpoint fails, it would still charge rent for whatever the gas meter has already recorded before the failure happens. -### Contract Dependencies -A contract may dispatch messages to other contracts as part of its `Sudo` call responses. If that is the case, the contract must declare those other contracts as `Dependencies` in its registration. No circular dependency is allowed. `dex` will check if a dispatched message is against a declared dependency contract, and reject it if it's not declared. -## Batch Order Matching -Orders submitted via MsgPlaceOrders are aggregated at the end of a block and matched in batch. -### Sequence -TODO -### Clearing/Settlement Rules -TODO -## State - -## Governance - -Token pairs can be whitelisted with a contract address to the `dex` module via governance. The following is an example -proposal json to whitelist a token pair. - -```json - "dex": { - "params": { - "code_upload_access": { - "permission": "Everybody" - }, - "instantiate_default_permission": "Everybody" - } - }, -``` - -## Messages - -## Events - -## Parameters - -## Transactions - -## Queries - diff --git a/x/dex/ante.go b/x/dex/ante.go deleted file mode 100644 index 07e891f42..000000000 --- a/x/dex/ante.go +++ /dev/null @@ -1,178 +0,0 @@ -package dex - -import ( - "errors" - "math/big" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkacltypes "github.com/cosmos/cosmos-sdk/types/accesscontrol" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/sei-protocol/sei-chain/x/dex/utils" -) - -// TickSizeMultipleDecorator check if the place order tx's price is multiple of -// tick size -type TickSizeMultipleDecorator struct { - dexKeeper keeper.Keeper -} - -// NewTickSizeMultipleDecorator returns new ticksize multiple check decorator instance -func NewTickSizeMultipleDecorator(dexKeeper keeper.Keeper) TickSizeMultipleDecorator { - return TickSizeMultipleDecorator{ - dexKeeper: dexKeeper, - } -} - -// AnteHandle is the interface called in RunTx() function, which CheckTx() calls with the runTxModeCheck mode -func (tsmd TickSizeMultipleDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { - if ctx.IsReCheckTx() { - return next(ctx, tx, simulate) - } - if !simulate { - if ctx.IsCheckTx() { - err := tsmd.CheckTickSizeMultiple(ctx, tx.GetMsgs()) - if err != nil { - return ctx, err - } - } - } - return next(ctx, tx, simulate) -} - -// CheckTickSizeMultiple checks whether the msgs comply with ticksize -func (tsmd TickSizeMultipleDecorator) CheckTickSizeMultiple(ctx sdk.Context, msgs []sdk.Msg) error { - for _, msg := range msgs { - switch msg.(type) { //nolint:gocritic,gosimple // the linter is telling us we can make this faster, and this should be addressed later. - case *types.MsgPlaceOrders: - msgPlaceOrders := msg.(*types.MsgPlaceOrders) //nolint:gosimple // the linter is telling us we can make this faster, and this should be addressed later. - contractAddr := msgPlaceOrders.ContractAddr - for _, order := range msgPlaceOrders.Orders { - priceTickSize, found := tsmd.dexKeeper.GetPriceTickSizeForPair(ctx, contractAddr, - types.Pair{ - PriceDenom: order.PriceDenom, - AssetDenom: order.AssetDenom, - }) - if !found { - return sdkerrors.Wrapf(sdkerrors.ErrKeyNotFound, "the pair {price:%s,asset:%s} has no price ticksize configured", order.PriceDenom, order.AssetDenom) - } - if !IsDecimalMultipleOf(order.Price, priceTickSize) { - // Allow Market Orders with Price 0 - if !(IsMarketOrder(order) && order.Price.IsZero()) { - return sdkerrors.Wrapf(errors.New("ErrPriceNotMultipleOfTickSize"), "price needs to be non-zero and multiple of price tick size") - } - } - quantityTickSize, found := tsmd.dexKeeper.GetQuantityTickSizeForPair(ctx, contractAddr, - types.Pair{ - PriceDenom: order.PriceDenom, - AssetDenom: order.AssetDenom, - }) - if !found { - return sdkerrors.Wrapf(sdkerrors.ErrKeyNotFound, "the pair {price:%s,asset:%s} has no quantity ticksize configured", order.PriceDenom, order.AssetDenom) - } - if !IsDecimalMultipleOf(order.Quantity, quantityTickSize) { - return sdkerrors.Wrapf(errors.New("ErrQuantityNotMultipleOfTickSize"), "quantity needs to be non-zero and multiple of quantity tick size") - } - } - continue - default: - // e.g. liquidation order don't come with price so always pass this check - return nil - } - } - - return nil -} - -// Check whether order is market order type -func IsMarketOrder(order *types.Order) bool { - return order.OrderType == types.OrderType_MARKET || order.OrderType == types.OrderType_FOKMARKET || order.OrderType == types.OrderType_FOKMARKETBYVALUE -} - -// Check whether decimal a is multiple of decimal b -func IsDecimalMultipleOf(a, b sdk.Dec) bool { - if a.LT(b) { - return false - } - quotient := sdk.NewDecFromBigInt(a.Quo(b).RoundInt().BigInt()) - return quotient.Mul(b).Equal(a) -} - -const DexGasFeeUnit = "usei" - -type CheckDexGasDecorator struct { - dexKeeper keeper.Keeper - checkTxMemState *dexcache.MemState -} - -func NewCheckDexGasDecorator(dexKeeper keeper.Keeper, checkTxMemState *dexcache.MemState) CheckDexGasDecorator { - return CheckDexGasDecorator{ - dexKeeper: dexKeeper, - checkTxMemState: checkTxMemState, - } -} - -// for a TX that contains dex gas-incurring messages, check if it provides enough gas based on dex params -func (d CheckDexGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { - if ctx.IsReCheckTx() { - return next(ctx, tx, simulate) - } - params := d.dexKeeper.GetParams(ctx) - dexGasRequired := uint64(0) - var memState *dexcache.MemState - if ctx.IsCheckTx() { - memState = d.checkTxMemState - } else { - memState = utils.GetMemState(ctx.Context()) - } - for _, msg := range tx.GetMsgs() { - switch m := msg.(type) { - case *types.MsgPlaceOrders: - numDependencies := len(memState.GetContractToDependencies(ctx, m.ContractAddr, d.dexKeeper.GetContractWithoutGasCharge)) - dexGasRequired += params.DefaultGasPerOrder * uint64(len(m.Orders)*numDependencies) - for _, order := range m.Orders { - dexGasRequired += params.DefaultGasPerOrderDataByte * uint64(len(order.Data)) - } - case *types.MsgCancelOrders: - numDependencies := len(memState.GetContractToDependencies(ctx, m.ContractAddr, d.dexKeeper.GetContractWithoutGasCharge)) - dexGasRequired += params.DefaultGasPerCancel * uint64(len(m.Cancellations)*numDependencies) - } - } - if dexGasRequired == 0 { - return next(ctx, tx, simulate) - } - dexFeeRequired := sdk.NewDecFromBigInt(new(big.Int).SetUint64(dexGasRequired)).Mul(params.SudoCallGasPrice).RoundInt() - feeTx, ok := tx.(sdk.FeeTx) - if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") - } - for _, fee := range feeTx.GetFee() { - if fee.Denom == DexGasFeeUnit && fee.Amount.GTE(dexFeeRequired) { - return next(ctx, tx, simulate) - } - } - return ctx, sdkerrors.ErrInsufficientFee -} - -func (d CheckDexGasDecorator) AnteDeps(txDeps []sdkacltypes.AccessOperation, tx sdk.Tx, txIndex int, next sdk.AnteDepGenerator) (newTxDeps []sdkacltypes.AccessOperation, err error) { - deps := []sdkacltypes.AccessOperation{} - for _, msg := range tx.GetMsgs() { - // Error checking will be handled in AnteHandler - switch msg.(type) { - case *types.MsgPlaceOrders, *types.MsgCancelOrders: - deps = append(deps, []sdkacltypes.AccessOperation{ - // read the dex contract info - { - ResourceType: sdkacltypes.ResourceType_KV_DEX_CONTRACT, - AccessType: sdkacltypes.AccessType_READ, - IdentifierTemplate: "*", - }, - }...) - default: - continue - } - } - return next(append(txDeps, deps...), tx, txIndex) -} diff --git a/x/dex/ante_test.go b/x/dex/ante_test.go deleted file mode 100644 index 4d9ab4205..000000000 --- a/x/dex/ante_test.go +++ /dev/null @@ -1,283 +0,0 @@ -package dex_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type TestTx struct { - msgs []sdk.Msg - gas uint64 - fee sdk.Coins -} - -func (tx TestTx) GetMsgs() []sdk.Msg { - return tx.msgs -} - -func (tx TestTx) ValidateBasic() error { - return nil -} - -func (tx TestTx) GetGas() uint64 { - return tx.gas -} -func (tx TestTx) GetFee() sdk.Coins { - return tx.fee -} -func (tx TestTx) FeePayer() sdk.AccAddress { - return nil -} -func (tx TestTx) FeeGranter() sdk.AccAddress { - return nil -} - -func TestIsDecimalMultipleOf(t *testing.T) { - v1, _ := sdk.NewDecFromStr("2.4") - v2, _ := sdk.NewDecFromStr("1.2") - v3, _ := sdk.NewDecFromStr("2") - v4, _ := sdk.NewDecFromStr("100.5") - v5, _ := sdk.NewDecFromStr("0.5") - v6, _ := sdk.NewDecFromStr("1.5") - v7, _ := sdk.NewDecFromStr("1.01") - v8, _ := sdk.NewDecFromStr("3") - v9, _ := sdk.NewDecFromStr("5.4") - v10, _ := sdk.NewDecFromStr("0.3") - - assert.True(t, dex.IsDecimalMultipleOf(v1, v2)) - assert.True(t, !dex.IsDecimalMultipleOf(v2, v1)) - assert.True(t, !dex.IsDecimalMultipleOf(v3, v2)) - assert.True(t, dex.IsDecimalMultipleOf(v3, v5)) - assert.True(t, !dex.IsDecimalMultipleOf(v3, v6)) - assert.True(t, dex.IsDecimalMultipleOf(v4, v5)) - assert.True(t, !dex.IsDecimalMultipleOf(v2, v1)) - assert.True(t, dex.IsDecimalMultipleOf(v6, v5)) - assert.True(t, !dex.IsDecimalMultipleOf(v7, v3)) - assert.True(t, dex.IsDecimalMultipleOf(v8, v6)) - assert.True(t, dex.IsDecimalMultipleOf(v9, v10)) -} - -func TestCheckDexGasDecorator(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - decorator := dex.NewCheckDexGasDecorator(*keeper, dexcache.NewMemState(keeper.GetMemStoreKey())) - terminator := func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) { return ctx, nil } - tx := TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{}, {}}, keepertest.TestContract, sdk.NewCoins()), - types.NewMsgCancelOrders("someone", []*types.Cancellation{{}, {}, {}}, keepertest.TestContract), - }, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err := decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{}, {}}, keepertest.TestContract, sdk.NewCoins()), - types.NewMsgCancelOrders("someone", []*types.Cancellation{{}, {}, {}}, keepertest.TestContract), - }, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(25499))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.NotNil(t, err) - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{}}, keepertest.TestContract, sdk.NewCoins()), - }, - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.NotNil(t, err) - tx = TestTx{ - msgs: []sdk.Msg{}, - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) - tx = TestTx{ - msgs: []sdk.Msg{types.NewMsgContractDepositRent(keepertest.TestContract, 10, keepertest.TestAccount)}, - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) - - // with data (insufficient fee) - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{Data: "data"}, {}}, keepertest.TestContract, sdk.NewCoins()), - }, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(11011))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.NotNil(t, err) - - // with data (sufficient fee) - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{Data: "data"}, {}}, keepertest.TestContract, sdk.NewCoins()), - }, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(11012))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) -} - -func TestTickSizeMultipleDecorator(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithIsCheckTx(true) - decorator := dex.NewTickSizeMultipleDecorator(*keeper) - terminator := func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) { return ctx, nil } - - keeper.AddRegisteredPair(ctx, "contract", keepertest.TestPair) - keeper.SetPriceTickSizeForPair(ctx, "contract", keepertest.TestPair, *keepertest.TestPair.PriceTicksize) - keeper.SetQuantityTickSizeForPair(ctx, "contract", keepertest.TestPair, *keepertest.TestPair.PriceTicksize) - - price, _ := sdk.NewDecFromStr("25") - quantity, _ := sdk.NewDecFromStr("5") - smallerVal, _ := sdk.NewDecFromStr("0.01") - - // Market order with price zero allowed - tx := TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: sdk.ZeroDec(), - Quantity: quantity, - OrderType: types.OrderType_MARKET, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err := decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) - - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: sdk.ZeroDec(), - Quantity: quantity, - OrderType: types.OrderType_FOKMARKET, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) - - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: sdk.ZeroDec(), - Quantity: quantity, - OrderType: types.OrderType_FOKMARKETBYVALUE, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) - - // Non-market orders with price zero not allowed - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: sdk.ZeroDec(), - Quantity: quantity, - OrderType: types.OrderType_LIMIT, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.NotNil(t, err) - - // Non-zero Priced Market Order With Divisible Price - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: price, - Quantity: quantity, - OrderType: types.OrderType_MARKET, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) - - // Non-zero Priced Market Order Without Divisible Price - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: smallerVal, - Quantity: quantity, - OrderType: types.OrderType_MARKET, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.NotNil(t, err) - - // Limit Order With Divisible Price - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: price, - Quantity: quantity, - OrderType: types.OrderType_LIMIT, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.Nil(t, err) - - // Limit Orders without Divisible Price - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: smallerVal, - Quantity: quantity, - OrderType: types.OrderType_LIMIT, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.NotNil(t, err) - - // All order quantities must be divisible by quantity tick size - tx = TestTx{ - msgs: []sdk.Msg{ - types.NewMsgPlaceOrders("someone", []*types.Order{{ - ContractAddr: "contract", - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Price: price, - Quantity: smallerVal, - OrderType: types.OrderType_LIMIT, - }}, "contract", sdk.NewCoins())}, - fee: sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(27500))), - } - _, err = decorator.AnteHandle(ctx, tx, false, terminator) - require.NotNil(t, err) -} diff --git a/x/dex/cache/cache.go b/x/dex/cache/cache.go deleted file mode 100644 index 915843d9c..000000000 --- a/x/dex/cache/cache.go +++ /dev/null @@ -1,318 +0,0 @@ -package dex - -import ( - "fmt" - "sync" - "time" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/sei-protocol/sei-chain/utils/datastructures" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -const SynchronizationTimeoutInSeconds = 5 - -type MemState struct { - storeKey sdk.StoreKey - - // TODO: all of these need to be in the memstore - contractsToProcessMtx *sync.RWMutex - contractsToDepsMtx *sync.Mutex -} - -func NewMemState(storeKey sdk.StoreKey) *MemState { - return &MemState{ - storeKey: storeKey, - contractsToDepsMtx: &sync.Mutex{}, - contractsToProcessMtx: &sync.RWMutex{}, - } -} - -func (s *MemState) GetAllBlockOrders(ctx sdk.Context, contractAddr types.ContractAddress) (list []*types.Order) { - s.SynchronizeAccess(ctx, contractAddr) - store := prefix.NewStore( - ctx.KVStore(s.storeKey), - types.MemOrderPrefix( - string(contractAddr), - ), - ) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Order - if err := val.Unmarshal(iterator.Value()); err != nil { - panic(err) - } - list = append(list, &val) - } - return -} - -func (s *MemState) GetBlockOrders(ctx sdk.Context, contractAddr types.ContractAddress, pair types.Pair) *BlockOrders { - s.SynchronizeAccess(ctx, contractAddr) - return NewOrders( - prefix.NewStore( - ctx.KVStore(s.storeKey), - types.MemOrderPrefixForPair( - string(contractAddr), pair.PriceDenom, pair.AssetDenom, - ), - ), - ) -} - -func (s *MemState) GetBlockCancels(ctx sdk.Context, contractAddr types.ContractAddress, pair types.Pair) *BlockCancellations { - s.SynchronizeAccess(ctx, contractAddr) - return NewCancels( - prefix.NewStore( - ctx.KVStore(s.storeKey), - types.MemCancelPrefixForPair( - string(contractAddr), pair.PriceDenom, pair.AssetDenom, - ), - ), - ) -} - -func (s *MemState) GetDepositInfo(ctx sdk.Context, contractAddr types.ContractAddress) *DepositInfo { - s.SynchronizeAccess(ctx, contractAddr) - return NewDepositInfo( - prefix.NewStore( - ctx.KVStore(s.storeKey), - types.MemDepositPrefix(string(contractAddr)), - ), - ) -} - -func (s *MemState) GetContractToDependencies(ctx sdk.Context, contractAddress string, loader func(sdk.Context, string) (types.ContractInfoV2, error)) []string { - s.contractsToDepsMtx.Lock() - defer s.contractsToDepsMtx.Unlock() - - store := ctx.KVStore(s.storeKey) - - // GET from memstate - bz := store.Get(types.MemDownstreamContractsKey(contractAddress)) - if bz != nil { - var contracts types.DownsteamContracts - if err := contracts.Unmarshal(bz); err != nil { - panic(err) - } - return contracts.ContractAddrs - } - loadedDownstreams := GetAllDownstreamContracts(ctx, contractAddress, loader) - // if we have to get all downstreams, save them to memstate - downstreamContracts := types.DownsteamContracts{ - ContractAddrs: loadedDownstreams, - } - contractsBz, err := downstreamContracts.Marshal() - if err != nil { - panic(err) - } - store.Set(types.MemDownstreamContractsKey(contractAddress), contractsBz) - return loadedDownstreams -} - -func (s *MemState) ClearContractToDependencies(ctx sdk.Context) { - s.contractsToDepsMtx.Lock() - defer s.contractsToDepsMtx.Unlock() - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemDownstreamContracts), func(_ []byte) bool { return true }) -} - -func (s *MemState) SetDownstreamsToProcess(ctx sdk.Context, contractAddress string, loader func(sdk.Context, string) (types.ContractInfoV2, error)) { - s.contractsToProcessMtx.Lock() - defer s.contractsToProcessMtx.Unlock() - contracts := s.GetContractToDependencies(ctx, contractAddress, loader) - store := ctx.KVStore(s.storeKey) - for _, contract := range contracts { - // Add each to memstate instead - simply set to 1 for some value indicating presence - store.Set(types.MemContractsToProcessKey(contract), []byte{1}) - } -} - -func (s *MemState) ContractsToProcessContains(ctx sdk.Context, contractAddress string) bool { - s.contractsToProcessMtx.RLock() - defer s.contractsToProcessMtx.RUnlock() - store := ctx.KVStore(s.storeKey) - return store.Has(types.MemContractsToProcessKey(contractAddress)) -} - -func (s *MemState) GetContractToProcessOrderedSlice(ctx sdk.Context) []string { - s.contractsToProcessMtx.RLock() - defer s.contractsToProcessMtx.RUnlock() - orderedContracts := []string{} - store := ctx.KVStore(s.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.KeyPrefix(types.MemContractsToProcess)) - for ; iter.Valid(); iter.Next() { - // get key - key := iter.Key() - // because we know length prefix is 1 byte, and the rest of the key is ONLY the contract addr, this lets us get the contract address bytes - contractAddrBytes := key[len(types.KeyPrefix(types.MemContractsToProcess))+1:] - // parse contract address from key - contractAddr := sdk.AccAddress(contractAddrBytes).String() - orderedContracts = append(orderedContracts, contractAddr) - } - return orderedContracts -} - -func (s *MemState) Clear(ctx sdk.Context) { - s.contractsToProcessMtx.Lock() - defer s.contractsToProcessMtx.Unlock() - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemOrderKey), func(_ []byte) bool { return true }) - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemCancelKey), func(_ []byte) bool { return true }) - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemDepositKey), func(_ []byte) bool { return true }) - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemContractsToProcess), func(_ []byte) bool { return true }) -} - -func (s *MemState) ClearCancellationForPair(ctx sdk.Context, contractAddr types.ContractAddress, pair types.Pair) { - s.SynchronizeAccess(ctx, contractAddr) - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemCancelKey), func(v []byte) bool { - var c types.Cancellation - if err := c.Unmarshal(v); err != nil { - panic(err) - } - return c.ContractAddr == string(contractAddr) && c.PriceDenom == pair.PriceDenom && c.AssetDenom == pair.AssetDenom - }) -} - -func (s *MemState) DeepCopy() *MemState { - return &MemState{ - storeKey: s.storeKey, - contractsToDepsMtx: s.contractsToDepsMtx, // passing by pointer - contractsToProcessMtx: s.contractsToProcessMtx, // passing by pointer - } -} - -func (s *MemState) DeepFilterAccount(ctx sdk.Context, account string) { - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemOrderKey), func(v []byte) bool { - var o types.Order - if err := o.Unmarshal(v); err != nil { - panic(err) - } - return o.Account == account - }) - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemCancelKey), func(v []byte) bool { - var c types.Cancellation - if err := c.Unmarshal(v); err != nil { - panic(err) - } - return c.Creator == account - }) - DeepDelete(ctx.KVStore(s.storeKey), types.KeyPrefix(types.MemDepositKey), func(v []byte) bool { - var d types.DepositInfoEntry - if err := d.Unmarshal(v); err != nil { - panic(err) - } - return d.Creator == account - }) -} - -func (s *MemState) SynchronizeAccess(ctx sdk.Context, contractAddr types.ContractAddress) { - executingContract := GetExecutingContract(ctx) - if executingContract == nil { - // not accessed by contract. no need to synchronize - return - } - targetContractAddr := string(contractAddr) - if executingContract.ContractAddr == targetContractAddr { - // access by the contract itself does not need synchronization - return - } - for _, dependency := range executingContract.Dependencies { - if dependency.Dependency != targetContractAddr { - continue - } - terminationSignals := GetTerminationSignals(ctx) - if terminationSignals == nil { - // synchronization should fail in the case of no termination signal to prevent race conditions. - panic("no termination signal map found in context") - } - targetChannel, ok := terminationSignals.Load(dependency.ImmediateElderSibling) - if !ok { - // synchronization should fail in the case of no termination signal to prevent race conditions. - panic(fmt.Sprintf("no termination signal channel for contract %s in context", dependency.ImmediateElderSibling)) - } - - select { - case <-targetChannel: - // since buffered channel can only be consumed once, we need to - // requeue so that it can unblock other goroutines that waits for - // the same channel. - targetChannel <- struct{}{} - case <-time.After(SynchronizationTimeoutInSeconds * time.Second): - // synchronization should fail in the case of timeout to prevent race conditions. - panic(fmt.Sprintf("timing out waiting for termination of %s", dependency.ImmediateElderSibling)) - } - - return - } - - // fail loudly so that the offending contract can be rolled back. - // eventually we will automatically de-register contracts that have to be rolled back - // so that this would not become a point of attack in terms of performance. - panic(fmt.Sprintf("Contract %s trying to access state of %s which is not a registered dependency", executingContract.ContractAddr, targetContractAddr)) -} - -func DeepDelete(kvStore sdk.KVStore, storePrefix []byte, matcher func([]byte) bool) { - store := prefix.NewStore( - kvStore, - storePrefix, - ) - // Getting all KVs first before applying `matcher` in case `matcher` contains - // store read/write logics. - // Wrapping getter into its own function to make sure iterator is always closed - // before `matcher` logic runs. - keyValuesGetter := func() ([][]byte, [][]byte) { - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - defer iterator.Close() - keys, values := [][]byte{}, [][]byte{} - for ; iterator.Valid(); iterator.Next() { - keys = append(keys, iterator.Key()) - values = append(values, iterator.Value()) - } - return keys, values - } - keys, values := keyValuesGetter() - for i, key := range keys { - if matcher(values[i]) { - store.Delete(key) - } - } -} - -// BFS traversal over a acyclic graph -// Includes the root contract itself. -func GetAllDownstreamContracts(ctx sdk.Context, contractAddress string, loader func(sdk.Context, string) (types.ContractInfoV2, error)) []string { - res := []string{contractAddress} - seen := datastructures.NewSyncSet(res) - downstreams := []*types.ContractInfoV2{} - populater := func(target *types.ContractInfoV2) { - for _, dep := range target.Dependencies { - if downstream, err := loader(ctx, dep.Dependency); err == nil && !seen.Contains(downstream.ContractAddr) { - if !downstream.Suspended { - downstreams = append(downstreams, &downstream) - seen.Add(downstream.ContractAddr) - } - } else { - // either getting the dependency returned an error, or there is a cycle in the graph. Either way - // is bad and should cause the triggering tx to fail - panic(fmt.Sprintf("getting dependency %s for %s returned an error, or there is a cycle in the dependency graph", dep.Dependency, target.ContractAddr)) - } - } - } - // init first layer downstreams - if contract, err := loader(ctx, contractAddress); err == nil { - populater(&contract) - } else { - return res - } - - for len(downstreams) > 0 { - downstream := downstreams[0] - res = append(res, downstream.ContractAddr) - populater(downstream) - downstreams = downstreams[1:] - } - return res -} diff --git a/x/dex/cache/cache_test.go b/x/dex/cache/cache_test.go deleted file mode 100644 index c6603e791..000000000 --- a/x/dex/cache/cache_test.go +++ /dev/null @@ -1,225 +0,0 @@ -package dex_test - -import ( - "context" - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/utils/datastructures" - dex "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/sei-protocol/sei-chain/x/store" - "github.com/stretchr/testify/require" -) - -const ( - TEST_CONTRACT = "test" -) - -func TestDeepCopy(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - }) - stateTwo := stateOne.DeepCopy() - cachedCtx, _ := store.GetCachedContext(ctx) - stateTwo.GetBlockOrders(cachedCtx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 2, - Account: "test", - ContractAddr: TEST_CONTRACT, - }) - // old state must not be changed - require.Equal(t, 1, len(stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get())) - // new state must be changed - require.Equal(t, 2, len(stateTwo.GetBlockOrders(cachedCtx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get())) -} - -func TestDeepFilterAccounts(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 2, - Account: "test2", - ContractAddr: TEST_CONTRACT, - }) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 1, - Creator: "test", - }) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 2, - Creator: "test2", - }) - stateOne.GetDepositInfo(ctx, types.ContractAddress(TEST_CONTRACT)).Add(&types.DepositInfoEntry{ - Creator: "test", - }) - stateOne.GetDepositInfo(ctx, types.ContractAddress(TEST_CONTRACT)).Add(&types.DepositInfoEntry{ - Creator: "test2", - }) - - stateOne.DeepFilterAccount(ctx, "test") - require.Equal(t, 1, len(stateOne.GetAllBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT)))) - require.Equal(t, 1, len(stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get())) - require.Equal(t, 1, len(stateOne.GetDepositInfo(ctx, types.ContractAddress(TEST_CONTRACT)).Get())) -} - -func TestDeepDelete(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - }) - dex.DeepDelete(ctx.KVStore(keeper.GetStoreKey()), types.KeyPrefix(types.MemOrderKey), func(_ []byte) bool { return true }) -} - -func TestClear(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - }) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 2, - ContractAddr: TEST_CONTRACT, - }) - stateOne.Clear(ctx) - require.Equal(t, 0, len(stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get())) - require.Equal(t, 0, len(stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get())) -} - -func TestClearCancellationForPair(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 1, - ContractAddr: TEST_CONTRACT, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 2, - ContractAddr: TEST_CONTRACT, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 3, - ContractAddr: TEST_CONTRACT, - PriceDenom: "USDC", - AssetDenom: "SEI", - }) - stateOne.ClearCancellationForPair(ctx, TEST_CONTRACT, types.Pair{ - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - require.Equal(t, 1, len(stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get())) - require.Equal(t, uint64(3), stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get()[0].Id) -} - -func TestSynchronization(t *testing.T) { - k, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(k.GetMemStoreKey()) - targetContract := types.ContractAddress(TEST_CONTRACT) - // no go context - require.NotPanics(t, func() { stateOne.SynchronizeAccess(ctx, targetContract) }) - // no executing contract - goCtx := context.Background() - ctx = ctx.WithContext(goCtx) - require.NotPanics(t, func() { stateOne.SynchronizeAccess(ctx, targetContract) }) - // executing contract same as target contract - executingContract := types.ContractInfoV2{ContractAddr: TEST_CONTRACT} - ctx = ctx.WithContext(context.WithValue(goCtx, dex.CtxKeyExecutingContract, executingContract)) - require.NotPanics(t, func() { stateOne.SynchronizeAccess(ctx, targetContract) }) - // executing contract attempting to access non-dependency - executingContract.ContractAddr = "executing" - ctx = ctx.WithContext(context.WithValue(goCtx, dex.CtxKeyExecutingContract, executingContract)) - require.Panics(t, func() { stateOne.SynchronizeAccess(ctx, targetContract) }) - // no termination map - executingContract.Dependencies = []*types.ContractDependencyInfo{ - {Dependency: TEST_CONTRACT, ImmediateElderSibling: "elder"}, - } - ctx = ctx.WithContext(context.WithValue(goCtx, dex.CtxKeyExecutingContract, executingContract)) - require.Panics(t, func() { stateOne.SynchronizeAccess(ctx, targetContract) }) - // no termination signal channel for sibling - terminationSignals := datastructures.NewTypedSyncMap[string, chan struct{}]() - goCtx = context.WithValue(goCtx, dex.CtxKeyExecutingContract, executingContract) - goCtx = context.WithValue(goCtx, dex.CtxKeyExecTermSignal, terminationSignals) - ctx = ctx.WithContext(goCtx) - require.Panics(t, func() { stateOne.SynchronizeAccess(ctx, targetContract) }) - // termination signal times out - siblingChan := make(chan struct{}, 1) - terminationSignals.Store("elder", siblingChan) - require.Panics(t, func() { stateOne.SynchronizeAccess(ctx, targetContract) }) - // termination signal sent - go func() { - siblingChan <- struct{}{} - }() - require.NotPanics(t, func() { stateOne.SynchronizeAccess(ctx, targetContract) }) - <-siblingChan // the channel should be re-populated -} - -func TestGetAllDownstreamContracts(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.SetContract(ctx, &types.ContractInfoV2{ - ContractAddr: "sei1cnuw3f076wgdyahssdkd0g3nr96ckq8cwa2mh029fn5mgf2fmcmsae2elf", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1ery8l6jquynn9a4cz2pff6khg8c68f7urt33l5n9dng2cwzz4c4q4hncrd", - }, - }, - }) - keeper.SetContract(ctx, &types.ContractInfoV2{ - ContractAddr: "sei1ery8l6jquynn9a4cz2pff6khg8c68f7urt33l5n9dng2cwzz4c4q4hncrd", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1wl59k23zngj34l7d42y9yltask7rjlnxgccawc7ltrknp6n52fpsj6ctln", - }, { - Dependency: "sei1udfs22xpxle475m2nz7u47jfa3vngncdegmczwwdx00cmetypa3sman25q", - }, - }, - }) - keeper.SetContract(ctx, &types.ContractInfoV2{ - ContractAddr: "sei1wl59k23zngj34l7d42y9yltask7rjlnxgccawc7ltrknp6n52fpsj6ctln", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1stwdtk6ja0705v8qmtukcp4vd422p5vy4jr5wdc4qk44c57k955qcannhd", - }, - }, - }) - keeper.SetContract(ctx, &types.ContractInfoV2{ - ContractAddr: "sei1stwdtk6ja0705v8qmtukcp4vd422p5vy4jr5wdc4qk44c57k955qcannhd", - }) - keeper.SetContract(ctx, &types.ContractInfoV2{ - ContractAddr: "sei1udfs22xpxle475m2nz7u47jfa3vngncdegmczwwdx00cmetypa3sman25q", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei14rse3e7rkc3qt7drmlulwlkrlzqvh7hv277zv05kyfuwl74udx5s9r7lm3", - }, - }, - Suspended: true, - }) - keeper.SetContract(ctx, &types.ContractInfoV2{ - ContractAddr: "sei14rse3e7rkc3qt7drmlulwlkrlzqvh7hv277zv05kyfuwl74udx5s9r7lm3", - }) - keeper.SetContract(ctx, &types.ContractInfoV2{ - ContractAddr: "sei182jzjwdyl5fw43yujnlljddgtrkr04dpd30ywp2yn724u7qhtaqsjev6mv", - }) - - require.Equal(t, []string{ - "sei1ery8l6jquynn9a4cz2pff6khg8c68f7urt33l5n9dng2cwzz4c4q4hncrd", - "sei1wl59k23zngj34l7d42y9yltask7rjlnxgccawc7ltrknp6n52fpsj6ctln", - "sei1stwdtk6ja0705v8qmtukcp4vd422p5vy4jr5wdc4qk44c57k955qcannhd", - }, dex.GetAllDownstreamContracts(ctx, "sei1ery8l6jquynn9a4cz2pff6khg8c68f7urt33l5n9dng2cwzz4c4q4hncrd", keeper.GetContractWithoutGasCharge)) -} diff --git a/x/dex/cache/cancel.go b/x/dex/cache/cancel.go deleted file mode 100644 index ec195a46d..000000000 --- a/x/dex/cache/cancel.go +++ /dev/null @@ -1,65 +0,0 @@ -package dex - -import ( - "encoding/binary" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type BlockCancellations struct { - cancelStore *prefix.Store -} - -func NewCancels(cancelStore prefix.Store) *BlockCancellations { - return &BlockCancellations{cancelStore: &cancelStore} -} - -func (o *BlockCancellations) Has(cancel *types.Cancellation) bool { - keybz := make([]byte, 8) - binary.BigEndian.PutUint64(keybz, cancel.Id) - return o.cancelStore.Has(keybz) -} - -func (o *BlockCancellations) Get() (list []*types.Cancellation) { - iterator := sdk.KVStorePrefixIterator(o.cancelStore, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Cancellation - if err := val.Unmarshal(iterator.Value()); err != nil { - panic(err) - } - list = append(list, &val) - } - - return -} - -func (o *BlockCancellations) GetIdsToCancel() (list []uint64) { - iterator := sdk.KVStorePrefixIterator(o.cancelStore, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Cancellation - if err := val.Unmarshal(iterator.Value()); err != nil { - panic(err) - } - list = append(list, val.Id) - } - - return -} - -func (o *BlockCancellations) Add(newItem *types.Cancellation) { - keybz := make([]byte, 8) - binary.BigEndian.PutUint64(keybz, newItem.Id) - valbz, err := newItem.Marshal() - if err != nil { - panic(err) - } - o.cancelStore.Set(keybz, valbz) -} diff --git a/x/dex/cache/cancel_test.go b/x/dex/cache/cancel_test.go deleted file mode 100644 index 8f9d51d80..000000000 --- a/x/dex/cache/cancel_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package dex_test - -import ( - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dex "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestCancelGetIdsToCancel(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 1, - Creator: "abc", - ContractAddr: TEST_CONTRACT, - }) - ids := stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).GetIdsToCancel() - require.Equal(t, 1, len(ids)) - require.Equal(t, uint64(1), ids[0]) -} - -func TestCancelGetCancels(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 1, - Creator: "abc", - ContractAddr: TEST_CONTRACT, - }) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 2, - Creator: "def", - ContractAddr: TEST_CONTRACT, - }) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 3, - Creator: "efg", - ContractAddr: TEST_CONTRACT, - }) - stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Cancellation{ - Id: 4, - Creator: "efg", - ContractAddr: TEST_CONTRACT, - }) - - cancels := stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get() - require.Equal(t, 4, len(cancels)) - require.True(t, stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Has(&types.Cancellation{ - Id: 1, - Creator: "abc", - ContractAddr: TEST_CONTRACT, - })) - require.True(t, stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Has(&types.Cancellation{ - Id: 2, - Creator: "def", - ContractAddr: TEST_CONTRACT, - })) - require.True(t, stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Has(&types.Cancellation{ - Id: 3, - Creator: "efg", - ContractAddr: TEST_CONTRACT, - })) - require.True(t, stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Has(&types.Cancellation{ - Id: 4, - Creator: "efg", - ContractAddr: TEST_CONTRACT, - })) - require.False(t, stateOne.GetBlockCancels(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Has(&types.Cancellation{ - Id: 5, - Creator: "efg", - ContractAddr: TEST_CONTRACT, - })) -} diff --git a/x/dex/cache/context.go b/x/dex/cache/context.go deleted file mode 100644 index 8c427f577..000000000 --- a/x/dex/cache/context.go +++ /dev/null @@ -1,44 +0,0 @@ -package dex - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/utils/datastructures" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type CtxKeyType string - -const ( - CtxKeyExecTermSignal = CtxKeyType("execution-termination-signals") - CtxKeyExecutingContract = CtxKeyType("executing-contract") -) - -func GetExecutingContract(ctx sdk.Context) *types.ContractInfoV2 { - if ctx.Context() == nil { - return nil - } - executingContract := ctx.Context().Value(CtxKeyExecutingContract) - if executingContract == nil { - return nil - } - contract, ok := executingContract.(types.ContractInfoV2) - if !ok { - return nil - } - return &contract -} - -func GetTerminationSignals(ctx sdk.Context) *datastructures.TypedSyncMap[string, chan struct{}] { - if ctx.Context() == nil { - return nil - } - signals := ctx.Context().Value(CtxKeyExecTermSignal) - if signals == nil { - return nil - } - typedSignals, ok := signals.(*datastructures.TypedSyncMap[string, chan struct{}]) - if !ok { - return nil - } - return typedSignals -} diff --git a/x/dex/cache/deposit.go b/x/dex/cache/deposit.go deleted file mode 100644 index 1df6b2622..000000000 --- a/x/dex/cache/deposit.go +++ /dev/null @@ -1,51 +0,0 @@ -package dex - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type DepositInfo struct { - store *prefix.Store -} - -func NewDepositInfo(store prefix.Store) *DepositInfo { - return &DepositInfo{store: &store} -} - -func (d *DepositInfo) Get() (list []*types.DepositInfoEntry) { - iterator := sdk.KVStorePrefixIterator(d.store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.DepositInfoEntry - if err := val.Unmarshal(iterator.Value()); err != nil { - panic(err) - } - list = append(list, &val) - } - - return -} - -func (d *DepositInfo) Add(newItem *types.DepositInfoEntry) { - key := types.MemDepositSubprefix(newItem.Creator, newItem.Denom) - if val, err := newItem.Marshal(); err != nil { - panic(err) - } else if existing := d.store.Get(key); existing == nil { - d.store.Set(key, val) - } else { - existingItem := types.DepositInfoEntry{} - if err := existingItem.Unmarshal(existing); err != nil { - panic(err) - } - newItem.Amount = newItem.Amount.Add(existingItem.Amount) - newVal, err := newItem.Marshal() - if err != nil { - panic(err) - } - d.store.Set(key, newVal) - } -} diff --git a/x/dex/cache/deposit_test.go b/x/dex/cache/deposit_test.go deleted file mode 100644 index 364ffa3d1..000000000 --- a/x/dex/cache/deposit_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package dex_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dex "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestDepositAdd(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - deposits := dex.NewMemState(keeper.GetMemStoreKey()).GetDepositInfo(ctx, types.ContractAddress(keepertest.TestContract)) - deposit := types.DepositInfoEntry{ - Creator: "abc", - Amount: sdk.MustNewDecFromStr("1.2"), - } - deposits.Add(&deposit) - depositsState := deposits.Get() - require.Equal(t, 1, len(depositsState)) - require.Equal(t, sdk.MustNewDecFromStr("1.2"), depositsState[0].Amount) - - deposit = types.DepositInfoEntry{ - Creator: "abc", - Amount: sdk.MustNewDecFromStr("1.3"), - } - deposits.Add(&deposit) - depositsState = deposits.Get() - require.Equal(t, 1, len(depositsState)) - require.Equal(t, sdk.MustNewDecFromStr("2.5"), depositsState[0].Amount) - - deposit = types.DepositInfoEntry{ - Creator: "def", - Amount: sdk.MustNewDecFromStr("1.1"), - } - deposits.Add(&deposit) - depositsState = deposits.Get() - require.Equal(t, 2, len(depositsState)) - if depositsState[0].Creator == "abc" { - require.Equal(t, sdk.MustNewDecFromStr("2.5"), depositsState[0].Amount) - require.Equal(t, sdk.MustNewDecFromStr("1.1"), depositsState[1].Amount) - } else { - require.Equal(t, sdk.MustNewDecFromStr("2.5"), depositsState[1].Amount) - require.Equal(t, sdk.MustNewDecFromStr("1.1"), depositsState[0].Amount) - } -} diff --git a/x/dex/cache/order.go b/x/dex/cache/order.go deleted file mode 100644 index 03fac3aec..000000000 --- a/x/dex/cache/order.go +++ /dev/null @@ -1,142 +0,0 @@ -package dex - -import ( - "encoding/binary" - "sort" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type BlockOrders struct { - orderStore *prefix.Store -} - -func NewOrders(orderStore prefix.Store) *BlockOrders { - return &BlockOrders{orderStore: &orderStore} -} - -func (o *BlockOrders) Add(newItem *types.Order) { - keybz := make([]byte, 8) - binary.BigEndian.PutUint64(keybz, newItem.Id) - valbz, err := newItem.Marshal() - if err != nil { - panic(err) - } - o.orderStore.Set(keybz, valbz) -} - -func (o *BlockOrders) GetByID(id uint64) *types.Order { - keybz := make([]byte, 8) - binary.BigEndian.PutUint64(keybz, id) - var val types.Order - if err := val.Unmarshal(o.orderStore.Get(keybz)); err != nil { - panic(err) - } - return &val -} - -func (o *BlockOrders) Get() (list []*types.Order) { - iterator := sdk.KVStorePrefixIterator(o.orderStore, []byte{}) - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - var val types.Order - if err := val.Unmarshal(iterator.Value()); err != nil { - panic(err) - } - list = append(list, &val) - } - - return -} - -func (o *BlockOrders) MarkFailedToPlace(failedOrders []types.UnsuccessfulOrder) { - failedOrdersMap := map[uint64]types.UnsuccessfulOrder{} - for _, failedOrder := range failedOrders { - failedOrdersMap[failedOrder.ID] = failedOrder - } - - keys, vals := o.getKVsToSet(failedOrdersMap) - for i, key := range keys { - o.orderStore.Set(key, vals[i]) - } -} - -// getKVsToSet iterate through the kvstore and append the key,val items to a list. -// We should avoid writing or reading from the store directly within the iterator. -func (o *BlockOrders) getKVsToSet(failedOrdersMap map[uint64]types.UnsuccessfulOrder) ([][]byte, [][]byte) { - iterator := sdk.KVStorePrefixIterator(o.orderStore, []byte{}) - - defer iterator.Close() - - var keys [][]byte - var vals [][]byte - for ; iterator.Valid(); iterator.Next() { - var val types.Order - if err := val.Unmarshal(iterator.Value()); err != nil { - panic(err) - } - if failedOrder, ok := failedOrdersMap[val.Id]; ok { - val.Status = types.OrderStatus_FAILED_TO_PLACE - val.StatusDescription = failedOrder.Reason - } - bz, err := val.Marshal() - if err != nil { - panic(err) - } - keys = append(keys, iterator.Key()) - vals = append(vals, bz) - } - return keys, vals -} - -func (o *BlockOrders) GetSortedMarketOrders(direction types.PositionDirection) []*types.Order { - res := o.getOrdersByCriteria(types.OrderType_MARKET, direction) - res = append(res, o.getOrdersByCriteria(types.OrderType_FOKMARKET, direction)...) - res = append(res, o.getOrdersByCriteria(types.OrderType_FOKMARKETBYVALUE, direction)...) - sort.SliceStable(res, func(i, j int) bool { - // a price of 0 indicates that there is no worst price for the order, so it should - // always be ranked at the top. - if res[i].Price.IsZero() { - return true - } else if res[j].Price.IsZero() { - return false - } - switch direction { - case types.PositionDirection_LONG: - return res[i].Price.GT(res[j].Price) - case types.PositionDirection_SHORT: - return res[i].Price.LT(res[j].Price) - default: - panic("Unknown direction") - } - }) - return res -} - -func (o *BlockOrders) GetLimitOrders(direction types.PositionDirection) []*types.Order { - return o.getOrdersByCriteria(types.OrderType_LIMIT, direction) -} - -func (o *BlockOrders) getOrdersByCriteria(orderType types.OrderType, direction types.PositionDirection) []*types.Order { - res := []*types.Order{} - iterator := sdk.KVStorePrefixIterator(o.orderStore, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Order - if err := val.Unmarshal(iterator.Value()); err != nil { - panic(err) - } - if val.OrderType != orderType || val.PositionDirection != direction { - continue - } - if val.Status == types.OrderStatus_FAILED_TO_PLACE { - continue - } - res = append(res, &val) - } - return res -} diff --git a/x/dex/cache/order_test.go b/x/dex/cache/order_test.go deleted file mode 100644 index b5ab03715..000000000 --- a/x/dex/cache/order_test.go +++ /dev/null @@ -1,257 +0,0 @@ -package dex_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dex "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMarkFailedToPlace(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - }) - unsuccessfulOrder := types.UnsuccessfulOrder{ - ID: 1, - Reason: "some reason", - } - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).MarkFailedToPlace([]types.UnsuccessfulOrder{unsuccessfulOrder}) - require.Equal(t, types.OrderStatus_FAILED_TO_PLACE, - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get()[0].Status) - require.Equal(t, "some reason", - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Get()[0].StatusDescription) -} - -func TestGetByID(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 1, - Account: "test1", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_LIMIT, - Price: sdk.MustNewDecFromStr("150"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 2, - Account: "test2", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_MARKET, - Price: sdk.MustNewDecFromStr("100"), - }) - - order1 := stateOne.GetBlockOrders( - ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).GetByID(uint64(1)) - order2 := stateOne.GetBlockOrders( - ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).GetByID(uint64(2)) - require.Equal(t, uint64(1), order1.Id) - require.Equal(t, uint64(2), order2.Id) - require.Equal(t, "test1", order1.Account) - require.Equal(t, "test2", order2.Account) - require.Equal(t, TEST_CONTRACT, order1.ContractAddr) - require.Equal(t, TEST_CONTRACT, order2.ContractAddr) - require.Equal(t, types.PositionDirection_LONG, order1.PositionDirection) - require.Equal(t, types.PositionDirection_SHORT, order2.PositionDirection) - require.Equal(t, types.OrderType_LIMIT, order1.OrderType) - require.Equal(t, types.OrderType_MARKET, order2.OrderType) - require.Equal(t, sdk.MustNewDecFromStr("150"), order1.Price) - require.Equal(t, sdk.MustNewDecFromStr("100"), order2.Price) -} - -func TestGetSortedMarketOrders(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - stateOne := dex.NewMemState(keeper.GetMemStoreKey()) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_MARKET, - Price: sdk.MustNewDecFromStr("150"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 2, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_MARKET, - Price: sdk.MustNewDecFromStr("100"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 3, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_MARKET, - Price: sdk.MustNewDecFromStr("0"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 4, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_MARKET, - Price: sdk.MustNewDecFromStr("100"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 5, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_MARKET, - Price: sdk.MustNewDecFromStr("80"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 6, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_MARKET, - Price: sdk.MustNewDecFromStr("0"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 7, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_LIMIT, - Price: sdk.MustNewDecFromStr("100"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 8, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_LIMIT, - Price: sdk.MustNewDecFromStr("100"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 9, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_FOKMARKET, - Price: sdk.MustNewDecFromStr("100"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 10, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_FOKMARKET, - Price: sdk.MustNewDecFromStr("0"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 11, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_FOKMARKET, - Price: sdk.MustNewDecFromStr("150"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 12, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_FOKMARKET, - Price: sdk.MustNewDecFromStr("0"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 13, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_FOKMARKET, - Price: sdk.MustNewDecFromStr("150"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 14, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_FOKMARKET, - Price: sdk.MustNewDecFromStr("100"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 15, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_FOKMARKETBYVALUE, - Price: sdk.MustNewDecFromStr("100"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 16, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_FOKMARKETBYVALUE, - Price: sdk.MustNewDecFromStr("0"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 17, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_FOKMARKETBYVALUE, - Price: sdk.MustNewDecFromStr("150"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 18, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_FOKMARKETBYVALUE, - Price: sdk.MustNewDecFromStr("0"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 19, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_FOKMARKETBYVALUE, - Price: sdk.MustNewDecFromStr("150"), - }) - stateOne.GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).Add(&types.Order{ - Id: 20, - Account: "test", - ContractAddr: TEST_CONTRACT, - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_FOKMARKETBYVALUE, - Price: sdk.MustNewDecFromStr("100"), - }) - - marketBuys := stateOne.GetBlockOrders( - ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).GetSortedMarketOrders(types.PositionDirection_LONG) - require.Equal(t, uint64(16), marketBuys[0].Id) - require.Equal(t, uint64(10), marketBuys[1].Id) - require.Equal(t, uint64(3), marketBuys[2].Id) - require.Equal(t, uint64(1), marketBuys[3].Id) - require.Equal(t, uint64(11), marketBuys[4].Id) - require.Equal(t, uint64(17), marketBuys[5].Id) - require.Equal(t, uint64(2), marketBuys[6].Id) - require.Equal(t, uint64(9), marketBuys[7].Id) - require.Equal(t, uint64(15), marketBuys[8].Id) - - marketSells := stateOne.GetBlockOrders( - ctx, types.ContractAddress(TEST_CONTRACT), keepertest.TestPair).GetSortedMarketOrders(types.PositionDirection_SHORT) - require.Equal(t, uint64(18), marketSells[0].Id) - require.Equal(t, uint64(12), marketSells[1].Id) - require.Equal(t, uint64(6), marketSells[2].Id) - require.Equal(t, uint64(5), marketSells[3].Id) - require.Equal(t, uint64(4), marketSells[4].Id) - require.Equal(t, uint64(14), marketSells[5].Id) - require.Equal(t, uint64(20), marketSells[6].Id) - require.Equal(t, uint64(13), marketSells[7].Id) - require.Equal(t, uint64(19), marketSells[8].Id) -} diff --git a/x/dex/client/cli/query/query.go b/x/dex/client/cli/query/query.go deleted file mode 100644 index 9270b81c3..000000000 --- a/x/dex/client/cli/query/query.go +++ /dev/null @@ -1,48 +0,0 @@ -package query - -import ( - "fmt" - // "strings" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd() *cobra.Command { - // Group dex queries under a subcommand - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(CmdListLongBook()) - cmd.AddCommand(CmdShowLongBook()) - cmd.AddCommand(CmdListShortBook()) - cmd.AddCommand(CmdShowShortBook()) - cmd.AddCommand(CmdGetPrice()) - cmd.AddCommand(CmdGetLatestPrice()) - cmd.AddCommand(CmdGetPrices()) - cmd.AddCommand(CmdGetTwaps()) - cmd.AddCommand(CmdGetAssetList()) - cmd.AddCommand(CmdGetAssetMetadata()) - cmd.AddCommand(CmdGetRegisteredPairs()) - cmd.AddCommand(CmdGetRegisteredContract()) - cmd.AddCommand(CmdGetOrders()) - cmd.AddCommand(CmdGetOrdersByID()) - cmd.AddCommand(CmdGetMatchResult()) - cmd.AddCommand(CmdGetOrderCount()) - - // this line is used by starport scaffolding # 1 - - return cmd -} diff --git a/x/dex/client/cli/query/query_asset_list.go b/x/dex/client/cli/query/query_asset_list.go deleted file mode 100644 index 7615cbfed..000000000 --- a/x/dex/client/cli/query/query_asset_list.go +++ /dev/null @@ -1,80 +0,0 @@ -package query - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdGetAssetList() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-asset-list", - Short: "Query Asset List", - Long: strings.TrimSpace(` - Returns the metadata for all assets. Dex asset metadata includes information such as IBC info (for IBC assets), the asset type, and standard token metadata from the bank module. - `), - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAssetListRequest{} - - res, err := queryClient.AssetList(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdGetAssetMetadata() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-asset-metadata [denom]", - Short: "Query Asset Metadata", - Long: strings.TrimSpace(` - Returns the metadata for a specific asset based on the passed in denom. Dex asset metadata includes information such as IBC info (for IBC assets), the asset type, and standard token metadata from the bank module. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - denom := args[0] - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAssetMetadataRequest{ - Denom: denom, - } - - res, err := queryClient.AssetMetadata(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_get_latest_price.go b/x/dex/client/cli/query/query_get_latest_price.go deleted file mode 100644 index 52bbcb3f0..000000000 --- a/x/dex/client/cli/query/query_get_latest_price.go +++ /dev/null @@ -1,53 +0,0 @@ -package query - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdGetLatestPrice() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-latest-price [contract-address] [price-denom] [asset-denom]", - Short: "Query getLatestPrice", - Long: strings.TrimSpace(` - Get the latest price from a dex specified by the contract-address. The price and asset denom are used to specify the dex pair for which to return the latest price. For the price at a specific timestamp use get-price instead or for all prices use get-prices. - `), - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqContractAddr := args[0] - reqPriceDenom := args[1] - reqAssetDenom := args[2] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetLatestPriceRequest{ - ContractAddr: reqContractAddr, - PriceDenom: reqPriceDenom, - AssetDenom: reqAssetDenom, - } - - res, err := queryClient.GetLatestPrice(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_get_order_count.go b/x/dex/client/cli/query/query_get_order_count.go deleted file mode 100644 index 105fcbdaa..000000000 --- a/x/dex/client/cli/query/query_get_order_count.go +++ /dev/null @@ -1,52 +0,0 @@ -package query - -import ( - "context" - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -func CmdGetOrderCount() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-order-count [contract] [price denom] [asset denom] [LONG|SHORT] [price]", - Short: "get number of orders at a price leve", - Args: cobra.ExactArgs(5), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - var direction types.PositionDirection - switch args[3] { - case "LONG": - direction = types.PositionDirection_LONG - case "SHORT": - direction = types.PositionDirection_SHORT - default: - return fmt.Errorf("unknown direction %s", args[3]) - } - price := sdk.MustNewDecFromStr(args[4]) - res, err := queryClient.GetOrderCount(context.Background(), &types.QueryGetOrderCountRequest{ - ContractAddr: args[0], - PriceDenom: args[1], - AssetDenom: args[2], - PositionDirection: direction, - Price: &price, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_get_price.go b/x/dex/client/cli/query/query_get_price.go deleted file mode 100644 index 06c9d9dbd..000000000 --- a/x/dex/client/cli/query/query_get_price.go +++ /dev/null @@ -1,58 +0,0 @@ -package query - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdGetPrice() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-price [contract-address] [timestamp] [price-denom] [asset-denom]", - Short: "Query getPrice", - Long: strings.TrimSpace(` - Get the price for a pair from a dex specified by the contract-address. The price and asset denom are used to specify the dex pair for which to return the latest price. The timestamp is used to query the price for that specific timestamp. For the latest price use get-latest-price instead or for all prices use get-prices. - `), - Args: cobra.ExactArgs(4), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqContractAddr := args[0] - reqTimestamp, err := strconv.ParseUint(args[1], 10, 64) - if err != nil { - return err - } - reqPriceDenom := args[2] - reqAssetDenom := args[3] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetPriceRequest{ - ContractAddr: reqContractAddr, - PriceDenom: reqPriceDenom, - AssetDenom: reqAssetDenom, - Timestamp: reqTimestamp, - } - - res, err := queryClient.GetPrice(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_get_prices.go b/x/dex/client/cli/query/query_get_prices.go deleted file mode 100644 index 7637379b0..000000000 --- a/x/dex/client/cli/query/query_get_prices.go +++ /dev/null @@ -1,53 +0,0 @@ -package query - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdGetPrices() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-prices [contract-address] [price-denom] [asset-denom]", - Short: "Query getPrices", - Long: strings.TrimSpace(` - Get all the prices for a pair from a dex specified by the contract-address. The price and asset denom are used to specify the dex pair for which to return the latest price. For the latest price use get-latest-price instead or for a specific timestamp use get-price. - `), - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqContractAddr := args[0] - reqPriceDenom := args[1] - reqAssetDenom := args[2] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetPricesRequest{ - ContractAddr: reqContractAddr, - PriceDenom: reqPriceDenom, - AssetDenom: reqAssetDenom, - } - - res, err := queryClient.GetPrices(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_get_twaps.go b/x/dex/client/cli/query/query_get_twaps.go deleted file mode 100644 index 798394b3b..000000000 --- a/x/dex/client/cli/query/query_get_twaps.go +++ /dev/null @@ -1,53 +0,0 @@ -package query - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdGetTwaps() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-twaps [contract-address] [lookback]", - Short: "Query getPrice", - Long: strings.TrimSpace(` - Get the TWAPs (Time weighted average prices) for all registered dex pairs for a specific orderbook by [contract-address] with a specific lookback duration over which to compute the weighted average. - `), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqContractAddr := args[0] - reqLookback, err := strconv.ParseUint(args[1], 10, 64) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetTwapsRequest{ - ContractAddr: reqContractAddr, - LookbackSeconds: reqLookback, - } - - res, err := queryClient.GetTwaps(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_long_book.go b/x/dex/client/cli/query/query_long_book.go deleted file mode 100644 index bf735d901..000000000 --- a/x/dex/client/cli/query/query_long_book.go +++ /dev/null @@ -1,90 +0,0 @@ -package query - -import ( - "context" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -func CmdListLongBook() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-long-book [contract address] [price denom] [asset denom]", - Short: "list all longBook", - Long: strings.TrimSpace(` - Lists all of a long book's information for a given contract address and pair specified by price denom and asset denom. - `), - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - reqPriceDenom := args[1] - reqAssetDenom := args[2] - - params := &types.QueryAllLongBookRequest{ - Pagination: pageReq, - ContractAddr: args[0], - PriceDenom: reqPriceDenom, - AssetDenom: reqAssetDenom, - } - - res, err := queryClient.LongBookAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowLongBook() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-long-book [contract address] [price] [price denom] [asset denom]", - Short: "shows a longBook", - Long: strings.TrimSpace(` - Gets a long book's information at a specific price for a given contract address and pair specified by price denopm and asset denom. - `), - Args: cobra.ExactArgs(4), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - contractAddr := args[0] - reqPriceDenom := args[2] - reqAssetDenom := args[3] - - params := &types.QueryGetLongBookRequest{ - Price: args[1], - ContractAddr: contractAddr, - PriceDenom: reqPriceDenom, - AssetDenom: reqAssetDenom, - } - res, err := queryClient.LongBook(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_long_book_test.go b/x/dex/client/cli/query/query_long_book_test.go deleted file mode 100644 index cd878dc7b..000000000 --- a/x/dex/client/cli/query/query_long_book_test.go +++ /dev/null @@ -1,176 +0,0 @@ -package query_test - -import ( - "fmt" - "testing" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/testutil/network" - "github.com/sei-protocol/sei-chain/testutil/nullify" - "github.com/sei-protocol/sei-chain/x/dex/client/cli/query" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func networkWithLongBookObjects(t *testing.T, n int) (*network.Network, []types.LongBook) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - longBookList := []types.LongBook{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - longBook := types.LongBook{ - Price: sdk.NewDec(int64(1 + i)), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(int64(1 + i)), - Quantity: sdk.NewDec(int64(i)), - Allocations: []*types.Allocation{{Account: "abc", Quantity: sdk.NewDec(int64(i)), OrderId: 1}}, - PriceDenom: TEST_PAIR().PriceDenom, - AssetDenom: TEST_PAIR().AssetDenom, - }, - } - nullify.Fill(&longBook) - longBookList = append(longBookList, longBook) - } - - contractInfo := types.ContractInfoV2{ - CodeId: uint64(1), - ContractAddr: "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", - } - contractState := []types.ContractState{ - { - LongBookList: longBookList, - ContractInfo: contractInfo, - }, - } - state.ContractState = contractState - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.ContractState[0].LongBookList -} - -func TestShowLongBook(t *testing.T) { - net, objs := networkWithLongBookObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - price string - args []string - err error - obj types.LongBook - }{ - { - desc: "found", - price: objs[1].Entry.Price.String(), - args: common, - obj: objs[1], - }, - { - desc: "not found", - price: "not_found", - args: common, - err: status.Error(codes.InvalidArgument, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - // the longbook orders are from genesis contract as created from networkWithLongBookObjects - args := []string{"sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", tc.price, TEST_PAIR().PriceDenom, TEST_PAIR().AssetDenom} - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, query.CmdShowLongBook(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetLongBookResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.LongBook) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.LongBook), - ) - } - }) - } -} - -func TestListLongBook(t *testing.T) { - net, objs := networkWithLongBookObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", TEST_PAIR().PriceDenom, TEST_PAIR().AssetDenom, - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, query.CmdListLongBook(), args) - require.NoError(t, err) - var resp types.QueryAllLongBookResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.LongBook), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.LongBook), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, query.CmdListLongBook(), args) - require.NoError(t, err) - var resp types.QueryAllLongBookResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.LongBook), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.LongBook), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, query.CmdListLongBook(), args) - require.NoError(t, err) - var resp types.QueryAllLongBookResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.LongBook), - ) - }) -} diff --git a/x/dex/client/cli/query/query_match_result.go b/x/dex/client/cli/query/query_match_result.go deleted file mode 100644 index c1a3fe194..000000000 --- a/x/dex/client/cli/query/query_match_result.go +++ /dev/null @@ -1,49 +0,0 @@ -package query - -import ( - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -func CmdGetMatchResult() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-match-result [contract-address]", - Short: "Query get match result by contract", - Long: strings.TrimSpace(` - Gets the match result information for an orderbook specified by the given contract address. The match result information includes the orders, settlements, and cancellations for the orderbook. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - contractAddr := args[0] - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetMatchResultRequest{ - ContractAddr: contractAddr, - } - - res, err := queryClient.GetMatchResult(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_orders.go b/x/dex/client/cli/query/query_orders.go deleted file mode 100644 index 1c054c8b1..000000000 --- a/x/dex/client/cli/query/query_orders.go +++ /dev/null @@ -1,96 +0,0 @@ -package query - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdGetOrders() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-orders [contract-address] [account]", - Short: "Query get orders for account", - Long: strings.TrimSpace(` - Get all orders for an account and orderbook specified by contract address. - `), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqContractAddr := args[0] - reqAccount := args[1] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetOrdersRequest{ - ContractAddr: reqContractAddr, - Account: reqAccount, - } - - res, err := queryClient.GetOrders(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdGetOrdersByID() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-orders-by-id [contract-address] [price-denom] [asset-denom] [id]", - Short: "Query get order by ID", - Long: strings.TrimSpace(` - Get a specific order by ID for an account and orderbook specified by contract address. - `), - Args: cobra.ExactArgs(4), - RunE: func(cmd *cobra.Command, args []string) (err error) { - contractAddr := args[0] - priceDenom := args[1] - assetDenom := args[2] - orderID, err := strconv.ParseUint(args[3], 10, 64) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetOrderByIDRequest{ - ContractAddr: contractAddr, - PriceDenom: priceDenom, - AssetDenom: assetDenom, - Id: orderID, - } - - res, err := queryClient.GetOrder(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_params.go b/x/dex/client/cli/query/query_params.go deleted file mode 100644 index 052866740..000000000 --- a/x/dex/client/cli/query/query_params.go +++ /dev/null @@ -1,34 +0,0 @@ -package query - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_registered_contract.go b/x/dex/client/cli/query/query_registered_contract.go deleted file mode 100644 index f779c6fe3..000000000 --- a/x/dex/client/cli/query/query_registered_contract.go +++ /dev/null @@ -1,48 +0,0 @@ -package query - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdGetRegisteredContract() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-registered-contract [contract address]", - Short: "Query Registered Contract", - Long: strings.TrimSpace(` - List the registered contract information specified by contract address. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - contractAddr := args[0] - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryRegisteredContractRequest{ - ContractAddr: contractAddr, - } - - res, err := queryClient.GetRegisteredContract(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_registered_pairs.go b/x/dex/client/cli/query/query_registered_pairs.go deleted file mode 100644 index 2b854976c..000000000 --- a/x/dex/client/cli/query/query_registered_pairs.go +++ /dev/null @@ -1,48 +0,0 @@ -package query - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdGetRegisteredPairs() *cobra.Command { - cmd := &cobra.Command{ - Use: "get-registered-pairs [contract address]", - Short: "Query Registered Pairs", - Long: strings.TrimSpace(` - List all of the registered pairs for an orderbook specified by contract address. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - contractAddr := args[0] - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryRegisteredPairsRequest{ - ContractAddr: contractAddr, - } - - res, err := queryClient.GetRegisteredPairs(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_short_book.go b/x/dex/client/cli/query/query_short_book.go deleted file mode 100644 index b16e477ce..000000000 --- a/x/dex/client/cli/query/query_short_book.go +++ /dev/null @@ -1,92 +0,0 @@ -package query - -import ( - "context" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -func CmdListShortBook() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-short-book [contract address] [price denom] [asset denom]", - Short: "list all shortBook", - Long: strings.TrimSpace(` - Lists all of a short book's information for a given contract address and pair specified by price denopm and asset denom. - `), - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - reqPriceDenom := args[1] - reqAssetDenom := args[2] - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllShortBookRequest{ - Pagination: pageReq, - ContractAddr: args[0], - PriceDenom: reqPriceDenom, - AssetDenom: reqAssetDenom, - } - - res, err := queryClient.ShortBookAll(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowShortBook() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-short-book [contract address] [price] [price denom] [asset denom]", - Short: "shows a shortBook", - Long: strings.TrimSpace(` - Gets a short book's information at a specific price for a given contract address and pair specified by price denopm and asset denom. - `), - Args: cobra.ExactArgs(4), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - contractAddr := args[0] - reqPriceDenom := args[2] - reqAssetDenom := args[3] - - params := &types.QueryGetShortBookRequest{ - Price: args[1], - ContractAddr: contractAddr, - PriceDenom: reqPriceDenom, - AssetDenom: reqAssetDenom, - } - - res, err := queryClient.ShortBook(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/query/query_short_book_test.go b/x/dex/client/cli/query/query_short_book_test.go deleted file mode 100644 index 1bfe5bbbb..000000000 --- a/x/dex/client/cli/query/query_short_book_test.go +++ /dev/null @@ -1,181 +0,0 @@ -package query_test - -import ( - "fmt" - "testing" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/testutil/network" - "github.com/sei-protocol/sei-chain/testutil/nullify" - "github.com/sei-protocol/sei-chain/x/dex/client/cli/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func TEST_PAIR() types.Pair { - return types.Pair{ - PriceDenom: "usdc", - AssetDenom: "atom", - } -} - -func networkWithShortBookObjects(t *testing.T, n int) (*network.Network, []types.ShortBook) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - shortBookList := []types.ShortBook{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - shortBook := types.ShortBook{ - Price: sdk.NewDec(int64(1 + i)), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(int64(1 + i)), - Quantity: sdk.NewDec(int64(i)), - Allocations: []*types.Allocation{{Account: "abc", Quantity: sdk.NewDec(int64(i)), OrderId: 1}}, - PriceDenom: TEST_PAIR().PriceDenom, - AssetDenom: TEST_PAIR().AssetDenom, - }, - } - nullify.Fill(&shortBook) - shortBookList = append(shortBookList, shortBook) - } - - contractInfo := types.ContractInfoV2{ - CodeId: uint64(1), - ContractAddr: "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", - } - contractState := []types.ContractState{ - { - ShortBookList: shortBookList, - ContractInfo: contractInfo, - }, - } - state.ContractState = contractState - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.ContractState[0].ShortBookList -} - -func TestShowShortBook(t *testing.T) { - net, objs := networkWithShortBookObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - price string - args []string - err error - obj types.ShortBook - }{ - { - desc: "found", - price: objs[1].Entry.Price.String(), - args: common, - obj: objs[1], - }, - { - desc: "not found", - price: "not_found", - args: common, - err: status.Error(codes.InvalidArgument, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{"sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", tc.price, TEST_PAIR().PriceDenom, TEST_PAIR().AssetDenom} - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, query.CmdShowShortBook(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetShortBookResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.ShortBook) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.ShortBook), - ) - } - }) - } -} - -func TestListShortBook(t *testing.T) { - net, objs := networkWithShortBookObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", TEST_PAIR().PriceDenom, TEST_PAIR().AssetDenom, - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, query.CmdListShortBook(), args) - require.NoError(t, err) - var resp types.QueryAllShortBookResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.ShortBook), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.ShortBook), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, query.CmdListShortBook(), args) - require.NoError(t, err) - var resp types.QueryAllShortBookResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.ShortBook), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.ShortBook), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, query.CmdListShortBook(), args) - require.NoError(t, err) - var resp types.QueryAllShortBookResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.ShortBook), - ) - }) -} diff --git a/x/dex/client/cli/tx/gov_tx.go b/x/dex/client/cli/tx/gov_tx.go deleted file mode 100644 index 92e2c018a..000000000 --- a/x/dex/client/cli/tx/gov_tx.go +++ /dev/null @@ -1,60 +0,0 @@ -package tx - -import ( - "strings" - - "github.com/sei-protocol/sei-chain/x/dex/types" - - "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" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - cutils "github.com/sei-protocol/sei-chain/x/dex/client/utils" - - "github.com/spf13/cobra" -) - -// NewAddAssetProposalTxCmd returns a CLI command handler for creating -// a add asset proposal governance transaction. -func NewAddAssetProposalTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "add-asset-proposal [proposal-file]", - Args: cobra.ExactArgs(1), - Short: "Submit an add asset proposal", - Long: strings.TrimSpace(` - Submit a proposal to add a list of assets and corresponding metadata to dex assets. - `), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - proposal, err := cutils.ParseAddAssetMetadataProposalJSON(clientCtx.LegacyAmino, args[0]) - if err != nil { - return err - } - - // Convert proposal to RegisterPairsProposal Type - from := clientCtx.GetFromAddress() - - content := types.AddAssetMetadataProposal{Title: proposal.Title, Description: proposal.Description, AssetList: proposal.AssetList} - - deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) - if err != nil { - return err - } - - msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, from) - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx.go b/x/dex/client/cli/tx/tx.go deleted file mode 100644 index 9c7ab93e8..000000000 --- a/x/dex/client/cli/tx/tx.go +++ /dev/null @@ -1,40 +0,0 @@ -package tx - -import ( - "fmt" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -//nolint:deadcode,unused // I assume we'll use this later. -const ( - flagPacketTimeoutTimestamp = "packet-timeout-timestamp" - listSeparator = "," -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - cmd.AddCommand(CmdPlaceOrders()) - cmd.AddCommand(CmdCancelOrders()) - cmd.AddCommand(CmdRegisterContract()) - cmd.AddCommand(CmdRegisterPairs()) - cmd.AddCommand(CmdUnregisterContract()) - cmd.AddCommand(CmdContractDepositRent()) - cmd.AddCommand(CmdUpdatePriceTickSize()) - cmd.AddCommand(CmdUpdateQuantityTickSize()) - cmd.AddCommand(NewAddAssetProposalTxCmd()) - cmd.AddCommand(CmdUnsuspendContract()) - // this line is used by starport scaffolding # 1 - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_cancel_orders.go b/x/dex/client/cli/tx/tx_cancel_orders.go deleted file mode 100644 index 9ba16b5d5..000000000 --- a/x/dex/client/cli/tx/tx_cancel_orders.go +++ /dev/null @@ -1,75 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "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/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdCancelOrders() *cobra.Command { - cmd := &cobra.Command{ - Use: "cancel-orders [contract address] [cancellations...]", - Short: "Bulk cancel orders", - Long: strings.TrimSpace(` - Cancel orders placed on an orderbook specified by contract-address. Cancellations are represented as strings with the cancellation details separated by "?". Cancellation details format is OrderID?PositionDirection?Price?PriceDenom?AssetDenom. - - Example: "1234?LONG?1.01?USDC?ATOM" - `), - Args: cobra.MinimumNArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argContractAddr := args[0] - if err != nil { - return err - } - cancellations := []*types.Cancellation{} - for _, cancellation := range args[1:] { - newCancel := types.Cancellation{} - cancelDetails := strings.Split(cancellation, "?") - newCancel.Id, err = strconv.ParseUint(cancelDetails[0], 10, 64) - if err != nil { - return err - } - argPositionDir, err := types.GetPositionDirectionFromStr(cancelDetails[1]) - if err != nil { - return err - } - newCancel.PositionDirection = argPositionDir - argPrice, err := sdk.NewDecFromStr(cancelDetails[2]) - if err != nil { - return err - } - newCancel.Price = argPrice - newCancel.PriceDenom = cancelDetails[3] - newCancel.AssetDenom = cancelDetails[4] - cancellations = append(cancellations, &newCancel) - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgCancelOrders( - clientCtx.GetFromAddress().String(), - cancellations, - argContractAddr, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_contract_deposit_rent.go b/x/dex/client/cli/tx/tx_contract_deposit_rent.go deleted file mode 100644 index fd24176eb..000000000 --- a/x/dex/client/cli/tx/tx_contract_deposit_rent.go +++ /dev/null @@ -1,52 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cast" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdContractDepositRent() *cobra.Command { - cmd := &cobra.Command{ - Use: "contract-deposit-rent [contract address] [amount]", - Short: "Contract deposit rent", - Long: strings.TrimSpace(` - Deposit rent for an orderbook specified by contract-address. This rent allows the contract to be executed via dex hooks for calculating order updates and position settlement. - `), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argContractAddr := args[0] - argDeposit, err := cast.ToUint64E(args[1]) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgContractDepositRent( - argContractAddr, - argDeposit, - clientCtx.GetFromAddress().String(), - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_place_orders.go b/x/dex/client/cli/tx/tx_place_orders.go deleted file mode 100644 index 183a0efa2..000000000 --- a/x/dex/client/cli/tx/tx_place_orders.go +++ /dev/null @@ -1,98 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "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/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -const ( - flagAmount = "amount" -) - -func CmdPlaceOrders() *cobra.Command { - cmd := &cobra.Command{ - Use: "place-orders [contract address] [orders...] --amount [coins,optional]", - Short: "Bulk place orders", - Long: strings.TrimSpace(` - Place orders on an orderbook specified by contract-address. Orders are represented as strings with the order details separated by "?". Cancellation details format is OrderDirection?Quantity?Price?PriceAsset?QuoteAsset?OrderType?OrderData?AdditionalParams. - More info here: https://docs.seinetwork.io/smart-contracts-and-local-development/dex-module-tutorial#placeorders - `), - Args: cobra.MinimumNArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argContractAddr := args[0] - orders := []*types.Order{} - for _, order := range args[1:] { - newOrder := types.Order{} - orderDetails := strings.Split(order, "?") - argPositionDir, err := types.GetPositionDirectionFromStr(orderDetails[0]) - if err != nil { - return err - } - newOrder.PositionDirection = argPositionDir - argPrice, err := sdk.NewDecFromStr(orderDetails[1]) - if err != nil { - return err - } - newOrder.Price = argPrice - argQuantity, err := sdk.NewDecFromStr(orderDetails[2]) - if err != nil { - return err - } - newOrder.Quantity = argQuantity - newOrder.PriceDenom = orderDetails[3] - newOrder.AssetDenom = orderDetails[4] - argOrderType, err := types.GetOrderTypeFromStr(orderDetails[5]) - if err != nil { - return err - } - newOrder.OrderType = argOrderType - newOrder.Data = orderDetails[6] - if newOrder.OrderType == types.OrderType_FOKMARKETBYVALUE { - argNominal, err := sdk.NewDecFromStr(orderDetails[7]) - if err != nil { - return err - } - newOrder.Nominal = argNominal - } - orders = append(orders, &newOrder) - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - amountStr, err := cmd.Flags().GetString(flagAmount) - if err != nil { - return err - } - - amount, err := sdk.ParseCoinsNormalized(amountStr) - if err != nil { - return err - } - - msg := types.NewMsgPlaceOrders( - clientCtx.GetFromAddress().String(), - orders, - argContractAddr, - amount, - ) - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(flagAmount, "", "Coins to send to the contract along with command") - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_register_contract.go b/x/dex/client/cli/tx/tx_register_contract.go deleted file mode 100644 index 312435ab9..000000000 --- a/x/dex/client/cli/tx/tx_register_contract.go +++ /dev/null @@ -1,68 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cast" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdRegisterContract() *cobra.Command { - cmd := &cobra.Command{ - Use: "register-contract [contract address] [code id] [(deprecated)] [need order matching] [deposit] [dependency1,dependency2,...]", - Short: "Register exchange contract", - Long: strings.TrimSpace(` - Register a contract with the dex module for order matching hooks. The available order matching functions are BulkOrderPlacements, BulkOrderCancellations, Settlement. A deposit can also be specified as the initial rent to allocate for the execution of the order matching. - Other orderbooks that are dependencies can also be specified so that dex orderbook processing can be performed in the appropriate order. - `), - Args: cobra.MinimumNArgs(5), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argContractAddr := args[0] - argCodeID, err := cast.ToUint64E(args[1]) - if err != nil { - return err - } - argNeedMatching, err := strconv.ParseBool(args[3]) - if err != nil { - return err - } - argDeposit, err := cast.ToUint64E(args[4]) - if err != nil { - return err - } - var dependencies []*types.ContractDependencyInfo - for _, dependency := range args[5:] { - dependencies = append(dependencies, &types.ContractDependencyInfo{Dependency: dependency}) - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgRegisterContract( - clientCtx.GetFromAddress().String(), - argCodeID, - argContractAddr, - argNeedMatching, - dependencies, - argDeposit, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_register_pairs.go b/x/dex/client/cli/tx/tx_register_pairs.go deleted file mode 100644 index 61411c52c..000000000 --- a/x/dex/client/cli/tx/tx_register_pairs.go +++ /dev/null @@ -1,54 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - cutils "github.com/sei-protocol/sei-chain/x/dex/client/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdRegisterPairs() *cobra.Command { - cmd := &cobra.Command{ - Use: "register-pairs [register-pairs-file]", - Short: "Register pairs for a contract", - Long: strings.TrimSpace(` - This allows for registering new pairs with a json file representing the various pairs to be registered. The pairs are specified within the file using the contract address for the orderbook along with pair information. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - registerTx, err := cutils.ParseRegisterPairsTxJSON(clientCtx.LegacyAmino, args[0]) - if err != nil { - return err - } - - txBatchContractPair, err := registerTx.BatchContractPair.ToMultipleBatchContractPair() - if err != nil { - return err - } - - msg := types.NewMsgRegisterPairs( - clientCtx.GetFromAddress().String(), - txBatchContractPair, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_unregister_contract.go b/x/dex/client/cli/tx/tx_unregister_contract.go deleted file mode 100644 index 08c187658..000000000 --- a/x/dex/client/cli/tx/tx_unregister_contract.go +++ /dev/null @@ -1,46 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdUnregisterContract() *cobra.Command { - cmd := &cobra.Command{ - Use: "unregister-contract [contract address]", - Short: "Unregister exchange contract", - Long: strings.TrimSpace(` - Unregisters an exchange contract so it no longer receives the execution hooks or order matching hooks. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argContractAddr := args[0] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgUnregisterContract( - clientCtx.GetFromAddress().String(), - argContractAddr, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_unsuspend_contract.go b/x/dex/client/cli/tx/tx_unsuspend_contract.go deleted file mode 100644 index ce9203ca9..000000000 --- a/x/dex/client/cli/tx/tx_unsuspend_contract.go +++ /dev/null @@ -1,46 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdUnsuspendContract() *cobra.Command { - cmd := &cobra.Command{ - Use: "unsuspend-contract [contract address]", - Short: "Unsuspend exchange contract", - Long: strings.TrimSpace(` - Unsuspend an exchange contract which was suspended due to Sudo malfunctioning, at a cost to its rent. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argContractAddr := args[0] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgUnsuspendContract( - clientCtx.GetFromAddress().String(), - argContractAddr, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_update_price_tick_size.go b/x/dex/client/cli/tx/tx_update_price_tick_size.go deleted file mode 100644 index 44dfedfe8..000000000 --- a/x/dex/client/cli/tx/tx_update_price_tick_size.go +++ /dev/null @@ -1,54 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - cutils "github.com/sei-protocol/sei-chain/x/dex/client/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdUpdatePriceTickSize() *cobra.Command { - cmd := &cobra.Command{ - Use: "update-price-tick-size [update-price-tick-size-file]", - Short: "Update price tick size for a market", - Long: strings.TrimSpace(` - Updates the price tick size for a specific pair for an orderbook specified by contract address. The file contains a list of pair info, new tick size, and contract addresses to allow for updating multiple tick sizes in one transaction. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - tickTx, err := cutils.ParseUpdateTickSizeTxJSON(clientCtx.LegacyAmino, args[0]) - if err != nil { - return err - } - - txTick, err := tickTx.TickSizes.ToTickSizes() - if err != nil { - return err - } - - msg := types.NewMsgUpdatePriceTickSize( - clientCtx.GetFromAddress().String(), - txTick, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/cli/tx/tx_update_quantity_tick_size.go b/x/dex/client/cli/tx/tx_update_quantity_tick_size.go deleted file mode 100644 index 5e46f50a0..000000000 --- a/x/dex/client/cli/tx/tx_update_quantity_tick_size.go +++ /dev/null @@ -1,54 +0,0 @@ -package tx - -import ( - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - cutils "github.com/sei-protocol/sei-chain/x/dex/client/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdUpdateQuantityTickSize() *cobra.Command { - cmd := &cobra.Command{ - Use: "update-quantity-tick-size [update-quantity-tick-size-file]", - Short: "Update quantity tick size for a market", - Long: strings.TrimSpace(` - Updates the quantity tick size for a specific pair for an orderbook specified by contract address. The file contains a list of pair info, new tick size, and contract addresses to allow for updating multiple tick sizes in one transaction. - `), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - tickTx, err := cutils.ParseUpdateTickSizeTxJSON(clientCtx.LegacyAmino, args[0]) - if err != nil { - return err - } - - txTick, err := tickTx.TickSizes.ToTickSizes() - if err != nil { - return err - } - - msg := types.NewMsgUpdateQuantityTickSize( - clientCtx.GetFromAddress().String(), - txTick, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dex/client/utils/utils.go b/x/dex/client/utils/utils.go deleted file mode 100644 index a151b652c..000000000 --- a/x/dex/client/utils/utils.go +++ /dev/null @@ -1,203 +0,0 @@ -package utils - -import ( - "errors" - "os" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type ( - PairJSON struct { - PriceDenom string `json:"price_denom" yaml:"price_denom"` - AssetDenom string `json:"asset_denom" yaml:"asset_denom"` - PriceTickSize string `json:"price_tick_size" yaml:"tick_size"` - QuantityTickSize string `json:"quantity_tick_size" yaml:"tick_size"` - } - - TickSizeJSON struct { - Pair PairJSON `json:"pair" yaml:"pair"` - TickSize sdk.Dec `json:"tick_size" yaml:"tick_size"` - ContractAddr string `json:"contract_addr" yaml:"contract_addr"` - } - - PairsJSON []PairJSON - TickSizesJSON []TickSizeJSON - AssetListJSON []dextypes.AssetMetadata - - // ParamChangeJSON defines a parameter change used in JSON input. This - // allows values to be specified in raw JSON instead of being string encoded. - BatchContractPairJSON struct { - ContractAddr string `json:"contract_addr" yaml:"contract_addr"` - Pairs PairsJSON `json:"pairs" yaml:"pairs"` - } - - MultipleBatchContractPairJSON []BatchContractPairJSON - - // RegisterPairsTxJSON defines a RegisterPairsTx - // to parse register pair tx's from a JSON file. - RegisterPairsTxJSON struct { - BatchContractPair MultipleBatchContractPairJSON `json:"batch_contract_pair" yaml:"batch_contract_pair"` - } - - UpdateTickSizeTxJSON struct { - TickSizes TickSizesJSON `json:"tick_size_list" yaml:"tick_size_list"` - } - - AddAssetMetadataProposalJSON struct { - Title string `json:"title" yaml:"title"` - Description string `json:"description" yaml:"description"` - AssetList AssetListJSON `json:"asset_list" yaml:"asset_list"` - Deposit string `json:"deposit" yaml:"deposit"` - } -) - -// TODO: ADD utils to convert Each type to dex/type (string to denom) -func NewPair(pair PairJSON) (dextypes.Pair, error) { - PriceDenom := pair.PriceDenom - AssetDenom := pair.AssetDenom - priceTicksize, err := sdk.NewDecFromStr(pair.PriceTickSize) - if err != nil { - return dextypes.Pair{}, errors.New("price ticksize: str to decimal conversion err") - } - if priceTicksize.LTE(sdk.ZeroDec()) { - return dextypes.Pair{}, errors.New("price ticksize: value cannot be zero or negative") - } - quantityTicksize, err := sdk.NewDecFromStr(pair.QuantityTickSize) - if err != nil { - return dextypes.Pair{}, errors.New("quantity ticksize: str to decimal conversion err") - } - if quantityTicksize.LTE(sdk.ZeroDec()) { - return dextypes.Pair{}, errors.New("quantity ticksize: value cannot be zero or negative") - } - return dextypes.Pair{PriceDenom: PriceDenom, AssetDenom: AssetDenom, PriceTicksize: &priceTicksize, QuantityTicksize: &quantityTicksize}, nil -} - -// ToParamChange converts a ParamChangeJSON object to ParamChange. -func (bcp BatchContractPairJSON) ToBatchContractPair() (dextypes.BatchContractPair, error) { - pairs := make([]*dextypes.Pair, len(bcp.Pairs)) - for i, p := range bcp.Pairs { - newPair, err := NewPair(p) - if err != nil { - return dextypes.BatchContractPair{}, nil - } - pairs[i] = &newPair - } - return dextypes.BatchContractPair{ContractAddr: bcp.ContractAddr, Pairs: pairs}, nil -} - -func (ts TickSizeJSON) ToTickSize() (dextypes.TickSize, error) { - // validate the tick size here - pair, err := NewPair(ts.Pair) - if err != nil { - return dextypes.TickSize{}, err - } - return dextypes.TickSize{ - Pair: &pair, - Ticksize: ts.TickSize, - ContractAddr: ts.ContractAddr, - }, nil -} - -// ToParamChanges converts a slice of ParamChangeJSON objects to a slice of -// ParamChange. -func (mbcp MultipleBatchContractPairJSON) ToMultipleBatchContractPair() ([]dextypes.BatchContractPair, error) { - res := make([]dextypes.BatchContractPair, len(mbcp)) - for i, bcp := range mbcp { - newBatch, err := bcp.ToBatchContractPair() - if err != nil { - return res, nil - } - res[i] = newBatch - } - return res, nil -} - -func (tss TickSizesJSON) ToTickSizes() ([]dextypes.TickSize, error) { - res := make([]dextypes.TickSize, len(tss)) - for i, ts := range tss { - ticksize, err := ts.ToTickSize() - if err != nil { - return res, nil - } - res[i] = ticksize - } - return res, nil -} - -// ParseRegisterPairsTxJSON reads and parses a RegisterPairsTxJSON from -// a file. -func ParseRegisterPairsTxJSON(cdc *codec.LegacyAmino, txFile string) (RegisterPairsTxJSON, error) { - registerTx := RegisterPairsTxJSON{} - - contents, err := os.ReadFile(txFile) - if err != nil { - return registerTx, err - } - - if err := cdc.UnmarshalJSON(contents, ®isterTx); err != nil { - return registerTx, err - } - - return registerTx, nil -} - -// ParseUpdateTickSizeTxJSON reads and parses a UpdateTickSizeTxJSON from -// a file. -func ParseUpdateTickSizeTxJSON(cdc *codec.LegacyAmino, txFile string) (UpdateTickSizeTxJSON, error) { - tickTx := UpdateTickSizeTxJSON{} - - contents, err := os.ReadFile(txFile) - if err != nil { - return tickTx, err - } - - if err := cdc.UnmarshalJSON(contents, &tickTx); err != nil { - return tickTx, err - } - - return tickTx, nil -} - -// ParseAddAssetMetadataProposalJSON reads and parses an AddAssetMetadataProposalJSON from -// a file. -func ParseAddAssetMetadataProposalJSON(cdc *codec.LegacyAmino, proposalFile string) (AddAssetMetadataProposalJSON, error) { - proposal := AddAssetMetadataProposalJSON{} - - contents, err := os.ReadFile(proposalFile) - if err != nil { - return proposal, err - } - - if err := cdc.UnmarshalJSON(contents, &proposal); err != nil { - return proposal, err - } - - // Verify base denoms specified in proposal are well formed - // Additionally verify that the asset "display" field is included in denom unit - for _, asset := range proposal.AssetList { - err := sdk.ValidateDenom(asset.Metadata.Base) - if err != nil { - return AddAssetMetadataProposalJSON{}, err - } - - // The display denom must have an associated DenomUnit field - display := asset.Metadata.Display - found := false - for _, denomUnit := range asset.Metadata.DenomUnits { - if denomUnit.Denom == display { - found = true - break - } - } - - if !found { - return AddAssetMetadataProposalJSON{}, errors.New("Display denom " + display + " has no associated DenomUnit in Metadata.") - } - - } - - return proposal, nil -} diff --git a/x/dex/client/wasm/bindings/queries.go b/x/dex/client/wasm/bindings/queries.go deleted file mode 100644 index 12fbe2a10..000000000 --- a/x/dex/client/wasm/bindings/queries.go +++ /dev/null @@ -1,12 +0,0 @@ -package bindings - -import "github.com/sei-protocol/sei-chain/x/dex/types" - -type SeiDexQuery struct { - // queries the dex TWAPs - DexTwaps *types.QueryGetTwapsRequest `json:"dex_twaps,omitempty"` - GetOrders *types.QueryGetOrdersRequest `json:"get_orders,omitempty"` - GetOrderByID *types.QueryGetOrderByIDRequest `json:"get_order_by_id,omitempty"` - GetOrderSimulation *types.QueryOrderSimulationRequest `json:"order_simulation,omitempty"` - GetLatestPrice *types.QueryGetLatestPriceRequest `json:"get_latest_price,omitempty"` -} diff --git a/x/dex/client/wasm/encoder.go b/x/dex/client/wasm/encoder.go deleted file mode 100644 index 0a56156a4..000000000 --- a/x/dex/client/wasm/encoder.go +++ /dev/null @@ -1,36 +0,0 @@ -package wasm - -import ( - "encoding/json" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/wasmbinding/bindings" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func EncodeDexPlaceOrders(rawMsg json.RawMessage, sender sdk.AccAddress) ([]sdk.Msg, error) { - encodedPlaceOrdersMsg := bindings.PlaceOrders{} - if err := json.Unmarshal(rawMsg, &encodedPlaceOrdersMsg); err != nil { - return []sdk.Msg{}, types.ErrEncodeDexPlaceOrders - } - placeOrdersMsg := types.MsgPlaceOrders{ - Creator: sender.String(), - Orders: encodedPlaceOrdersMsg.Orders, - ContractAddr: encodedPlaceOrdersMsg.ContractAddr, - Funds: encodedPlaceOrdersMsg.Funds, - } - return []sdk.Msg{&placeOrdersMsg}, nil -} - -func EncodeDexCancelOrders(rawMsg json.RawMessage, sender sdk.AccAddress) ([]sdk.Msg, error) { - encodedCancelOrdersMsg := bindings.CancelOrders{} - if err := json.Unmarshal(rawMsg, &encodedCancelOrdersMsg); err != nil { - return []sdk.Msg{}, types.ErrEncodeDexCancelOrders - } - cancelOrdersMsg := types.MsgCancelOrders{ - Creator: sender.String(), - Cancellations: encodedCancelOrdersMsg.Cancellations, - ContractAddr: encodedCancelOrdersMsg.ContractAddr, - } - return []sdk.Msg{&cancelOrdersMsg}, nil -} diff --git a/x/dex/client/wasm/query.go b/x/dex/client/wasm/query.go deleted file mode 100644 index 41f86f162..000000000 --- a/x/dex/client/wasm/query.go +++ /dev/null @@ -1,48 +0,0 @@ -package wasm - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type DexWasmQueryHandler struct { - dexKeeper keeper.Keeper -} - -func NewDexWasmQueryHandler(keeper *keeper.Keeper) *DexWasmQueryHandler { - return &DexWasmQueryHandler{ - dexKeeper: *keeper, - } -} - -func (handler DexWasmQueryHandler) GetDexTwap(ctx sdk.Context, req *types.QueryGetTwapsRequest) (*types.QueryGetTwapsResponse, error) { - c := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: &handler.dexKeeper} - return wrapper.GetTwaps(c, req) -} - -func (handler DexWasmQueryHandler) GetOrders(ctx sdk.Context, req *types.QueryGetOrdersRequest) (*types.QueryGetOrdersResponse, error) { - c := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: &handler.dexKeeper} - return wrapper.GetOrders(c, req) -} - -func (handler DexWasmQueryHandler) GetOrderByID(ctx sdk.Context, req *types.QueryGetOrderByIDRequest) (*types.QueryGetOrderByIDResponse, error) { - c := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: &handler.dexKeeper} - return wrapper.GetOrder(c, req) -} - -func (handler DexWasmQueryHandler) GetOrderSimulation(ctx sdk.Context, req *types.QueryOrderSimulationRequest) (*types.QueryOrderSimulationResponse, error) { - c := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: &handler.dexKeeper} - return wrapper.GetOrderSimulation(c, req) -} - -func (handler DexWasmQueryHandler) GetLatestPrice(ctx sdk.Context, req *types.QueryGetLatestPriceRequest) (*types.QueryGetLatestPriceResponse, error) { - c := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: &handler.dexKeeper} - return wrapper.GetLatestPrice(c, req) -} diff --git a/x/dex/contract/abci.go b/x/dex/contract/abci.go deleted file mode 100644 index 712c01c67..000000000 --- a/x/dex/contract/abci.go +++ /dev/null @@ -1,323 +0,0 @@ -package contract - -import ( - "context" - "errors" - "fmt" - "sync" - "time" - - "github.com/cosmos/cosmos-sdk/telemetry" - "github.com/cosmos/cosmos-sdk/utils/tracing" - "github.com/sei-protocol/sei-chain/utils/logging" - - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/sei-protocol/sei-chain/store/whitelist/multi" - seisync "github.com/sei-protocol/sei-chain/sync" - "github.com/sei-protocol/sei-chain/utils/datastructures" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - dexkeeperabci "github.com/sei-protocol/sei-chain/x/dex/keeper/abci" - dexkeeperutils "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/sei-protocol/sei-chain/x/store" - otrace "go.opentelemetry.io/otel/trace" -) - -const LogRunnerRunAfter = 10 * time.Second -const LogExecSigSendAfter = 2 * time.Second - -type environment struct { - validContractsInfo []types.ContractInfoV2 - failedContractAddressesToErrors *datastructures.TypedSyncMap[string, error] - outOfRentContractAddresses datastructures.SyncSet[string] - settlementsByContract *datastructures.TypedSyncMap[string, []*types.SettlementEntry] - executionTerminationSignals *datastructures.TypedSyncMap[string, chan struct{}] - registeredPairs *datastructures.TypedSyncMap[string, []types.Pair] - orderBooks *datastructures.TypedNestedSyncMap[string, types.PairString, *types.OrderBook] - - finalizeMsgMutex *sync.Mutex - eventManagerMutex *sync.Mutex -} - -func EndBlockerAtomic(ctx sdk.Context, keeper *keeper.Keeper, validContractsInfo []types.ContractInfoV2, tracingInfo *tracing.Info) ([]types.ContractInfoV2, []types.ContractInfoV2, map[string]string, sdk.Context, bool) { - tracer := tracingInfo.Tracer - spanCtx, span := tracingInfo.Start("DexEndBlockerAtomic") - defer span.End() - defer telemetry.MeasureSince(time.Now(), "dex", "end_blocker_atomic") - - env := newEnv(ctx, validContractsInfo, keeper) - cachedCtx, msCached := cacheContext(ctx, env) - memStateCopy := dexutils.GetMemState(cachedCtx.Context()).DeepCopy() - contractsToProcess := memStateCopy.GetContractToProcessOrderedSlice(cachedCtx) - preRunRents := keeper.GetRentsForContracts(cachedCtx, contractsToProcess) - - handleDeposits(spanCtx, cachedCtx, env, keeper, tracer) - - runner := NewParallelRunner(func(contract types.ContractInfoV2) { - OrderMatchingRunnable(spanCtx, cachedCtx, env, keeper, contract, tracer) - }, validContractsInfo, cachedCtx) - - _, err := logging.LogIfNotDoneAfter(ctx.Logger(), func() (struct{}, error) { - runner.Run() - return struct{}{}, nil - }, LogRunnerRunAfter, "runner run") - if err != nil { - // this should never happen - panic(err) - } - - handleSettlements(spanCtx, cachedCtx, env, keeper, tracer) - handleUnfulfilledMarketOrders(spanCtx, cachedCtx, env, keeper, tracer) - - telemetry.IncrCounter(float32(env.failedContractAddressesToErrors.Len()), "dex", "total_failed_contracts") - // No error is thrown for any contract. This should happen most of the time. - if env.failedContractAddressesToErrors.Len() == 0 { - postRunRents := keeper.GetRentsForContracts(cachedCtx, contractsToProcess) - TransferRentFromDexToCollector(cachedCtx, keeper.BankKeeper, preRunRents, postRunRents) - msCached.Write() - return env.validContractsInfo, []types.ContractInfoV2{}, map[string]string{}, ctx, true - } - - failedContractsToReasons := map[string]string{} - failedContractsPreRents := map[string]uint64{} - failedContractsPostRents := map[string]uint64{} - // persistent contract rent charges for failed contracts and discard everything else - env.failedContractAddressesToErrors.Range(func(failedContractAddress string, failedReason error) bool { - cachedContract, err := keeper.GetContract(cachedCtx, failedContractAddress) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error %s when getting updated contract %s to persist rent balance", err, failedContractAddress)) - return true - } - contract, err := keeper.GetContract(ctx, failedContractAddress) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error %s when getting contract %s to persist rent balance", err, failedContractAddress)) - return true - } - contract.RentBalance = cachedContract.RentBalance - failedContractsPreRents[failedContractAddress] = preRunRents[failedContractAddress] - failedContractsPostRents[failedContractAddress] = contract.RentBalance - err = keeper.SetContract(ctx, &contract) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error %s when persisting contract %s's rent balance", err, failedContractAddress)) - return true - } - failedContractsToReasons[failedContractAddress] = dexutils.GetTruncatedErrors(failedReason) - return true - }) - TransferRentFromDexToCollector(ctx, keeper.BankKeeper, failedContractsPreRents, failedContractsPostRents) - - // restore keeper in-memory state - newGoContext := context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, memStateCopy) - return filterNewValidContracts(ctx, env), getOutOfRentContracts(env), failedContractsToReasons, ctx.WithContext(newGoContext), false -} - -func newEnv(ctx sdk.Context, validContractsInfo []types.ContractInfoV2, keeper *keeper.Keeper) *environment { - settlementsByContract := datastructures.NewTypedSyncMap[string, []*types.SettlementEntry]() - executionTerminationSignals := datastructures.NewTypedSyncMap[string, chan struct{}]() - registeredPairs := datastructures.NewTypedSyncMap[string, []types.Pair]() - allContractAndPairs := map[string][]types.Pair{} - for _, contract := range validContractsInfo { - settlementsByContract.Store(contract.ContractAddr, []*types.SettlementEntry{}) - executionTerminationSignals.Store(contract.ContractAddr, make(chan struct{}, 1)) - contractPairs := keeper.GetAllRegisteredPairs(ctx, contract.ContractAddr) - registeredPairs.Store(contract.ContractAddr, contractPairs) - allContractAndPairs[contract.ContractAddr] = contractPairs - } - // Parallelize populating orderbooks for performance improvements - orderBooks := dexkeeperutils.PopulateAllOrderbooks(ctx, keeper, allContractAndPairs) - return &environment{ - validContractsInfo: validContractsInfo, - failedContractAddressesToErrors: datastructures.NewTypedSyncMap[string, error](), - outOfRentContractAddresses: datastructures.NewSyncSet([]string{}), - settlementsByContract: settlementsByContract, - executionTerminationSignals: executionTerminationSignals, - registeredPairs: registeredPairs, - orderBooks: orderBooks, - finalizeMsgMutex: &sync.Mutex{}, - eventManagerMutex: &sync.Mutex{}, - } -} - -func (e *environment) addError(contractAddr string, err error) { - if err == types.ErrInsufficientRent { - e.outOfRentContractAddresses.Add(contractAddr) - return - } - e.failedContractAddressesToErrors.Store(contractAddr, err) -} - -func cacheContext(ctx sdk.Context, env *environment) (sdk.Context, sdk.CacheMultiStore) { - cachedCtx, msCached := store.GetCachedContext(ctx) - goCtx := context.WithValue(cachedCtx.Context(), dexcache.CtxKeyExecTermSignal, env.executionTerminationSignals) - cachedCtx = cachedCtx.WithContext(goCtx) - return cachedCtx, msCached -} - -func decorateContextForContract(ctx sdk.Context, contractInfo types.ContractInfoV2) sdk.Context { - goCtx := context.WithValue(ctx.Context(), dexcache.CtxKeyExecutingContract, contractInfo) - whitelistedStore := multi.NewStore(ctx.MultiStore(), GetWhitelistMap(contractInfo.ContractAddr)) - newEventManager := sdk.NewEventManager() - return ctx.WithContext(goCtx).WithMultiStore(whitelistedStore).WithEventManager(newEventManager).WithGasMeter( - seisync.NewGasWrapper(sdk.NewInfiniteGasMeterWithMultiplier(ctx)), - ) -} - -func handleDeposits(spanCtx context.Context, ctx sdk.Context, env *environment, keeper *keeper.Keeper, tracer *otrace.Tracer) { - // Handle deposit sequentially since they mutate `bank` state which is shared by all contracts - _, span := (*tracer).Start(spanCtx, "handleDeposits") - defer span.End() - defer telemetry.MeasureSince(time.Now(), "dex", "handle_deposits") - keeperWrapper := dexkeeperabci.KeeperWrapper{Keeper: keeper} - for _, contract := range env.validContractsInfo { - if !dexutils.GetMemState(ctx.Context()).ContractsToProcessContains(ctx, contract.ContractAddr) { - continue - } - if !contract.NeedOrderMatching { - continue - } - if err := keeperWrapper.HandleEBDeposit(spanCtx, ctx, tracer, contract.ContractAddr); err != nil { - env.addError(contract.ContractAddr, err) - } - } -} - -func handleSettlements(ctx context.Context, sdkCtx sdk.Context, env *environment, keeper *keeper.Keeper, tracer *otrace.Tracer) { - _, span := (*tracer).Start(ctx, "DexEndBlockerHandleSettlements") - defer span.End() - defer telemetry.MeasureSince(time.Now(), "dex", "handle_settlements") - contractsNeedOrderMatching := datastructures.NewSyncSet([]string{}) - for _, contract := range env.validContractsInfo { - if contract.NeedOrderMatching { - contractsNeedOrderMatching.Add(contract.ContractAddr) - } - } - env.settlementsByContract.Range(func(contractAddr string, settlements []*types.SettlementEntry) bool { - if !contractsNeedOrderMatching.Contains(contractAddr) { - return true - } - if err := HandleSettlements(sdkCtx, contractAddr, keeper, settlements); err != nil { - sdkCtx.Logger().Error(fmt.Sprintf("Error handling settlements for %s", contractAddr)) - env.addError(contractAddr, err) - } - return true - }) -} - -func handleUnfulfilledMarketOrders(ctx context.Context, sdkCtx sdk.Context, env *environment, keeper *keeper.Keeper, tracer *otrace.Tracer) { - // Cancel unfilled market orders - defer telemetry.MeasureSince(time.Now(), "dex", "handle_unfulfilled_market_orders") - for _, contract := range env.validContractsInfo { - if !dexutils.GetMemState(sdkCtx.Context()).ContractsToProcessContains(sdkCtx, contract.ContractAddr) { - return - } - if contract.NeedOrderMatching { - registeredPairs, found := env.registeredPairs.Load(contract.ContractAddr) - if !found { - continue - } - if err := CancelUnfulfilledMarketOrders(ctx, sdkCtx, contract.ContractAddr, keeper, registeredPairs, tracer); err != nil { - sdkCtx.Logger().Error(fmt.Sprintf("Error cancelling unfulfilled market orders for %s", contract.ContractAddr)) - env.addError(contract.ContractAddr, err) - } - } - } -} - -func OrderMatchingRunnable(ctx context.Context, sdkContext sdk.Context, env *environment, keeper *keeper.Keeper, contractInfo types.ContractInfoV2, tracer *otrace.Tracer) { - defer func() { - if err := recover(); err != nil { - telemetry.IncrCounter(1, "recovered_panics") - msg := fmt.Sprintf("PANIC RECOVERED during order matching: %s", err) - sdkContext.Logger().Error(msg) - if env != nil { - env.addError(contractInfo.ContractAddr, errors.New(msg)) - } - } - }() - _, span := (*tracer).Start(ctx, "OrderMatchingRunnable") - defer span.End() - defer telemetry.MeasureSince(time.Now(), "dex", "order_matching_runnable") - defer func() { - if channel, ok := env.executionTerminationSignals.Load(contractInfo.ContractAddr); ok { - _, err := logging.LogIfNotDoneAfter(sdkContext.Logger(), func() (struct{}, error) { - channel <- struct{}{} - return struct{}{}, nil - }, LogExecSigSendAfter, fmt.Sprintf("send execution terminal signal for %s", contractInfo.ContractAddr)) - if err != nil { - // this should never happen - panic(err) - } - } - }() - if !dexutils.GetMemState(sdkContext.Context()).ContractsToProcessContains(sdkContext, contractInfo.ContractAddr) { - return - } - if !contractInfo.NeedOrderMatching { - return - } - parentSdkContext := sdkContext - sdkContext = decorateContextForContract(sdkContext, contractInfo) - sdkContext.Logger().Debug(fmt.Sprintf("End block for %s with balance of %d", contractInfo.ContractAddr, contractInfo.RentBalance)) - pairs, pairFound := env.registeredPairs.Load(contractInfo.ContractAddr) - orderBooks, found := env.orderBooks.Load(contractInfo.ContractAddr) - - if !pairFound || !found { - sdkContext.Logger().Error(fmt.Sprintf("No pair or order book for %s", contractInfo.ContractAddr)) - env.addError(contractInfo.ContractAddr, errors.New("no pair found (internal error)")) - } else if settlements, err := HandleExecutionForContract(ctx, sdkContext, contractInfo, keeper, pairs, orderBooks, tracer); err != nil { - sdkContext.Logger().Error(fmt.Sprintf("Error for EndBlock of %s", contractInfo.ContractAddr)) - env.addError(contractInfo.ContractAddr, err) - } else { - env.settlementsByContract.Store(contractInfo.ContractAddr, settlements) - } - - // ordering of events doesn't matter since events aren't part of consensus - env.eventManagerMutex.Lock() - defer env.eventManagerMutex.Unlock() - parentSdkContext.EventManager().EmitEvents(sdkContext.EventManager().Events()) -} - -func filterNewValidContracts(ctx sdk.Context, env *environment) []types.ContractInfoV2 { - newValidContracts := []types.ContractInfoV2{} - for _, contract := range env.validContractsInfo { - if _, ok := env.failedContractAddressesToErrors.Load(contract.ContractAddr); !ok && !env.outOfRentContractAddresses.Contains(contract.ContractAddr) { - newValidContracts = append(newValidContracts, contract) - } - } - env.failedContractAddressesToErrors.Range(func(failedContractAddress string, _ error) bool { - dexutils.GetMemState(ctx.Context()).DeepFilterAccount(ctx, failedContractAddress) - return true - }) - for _, outOfRentContractAddress := range env.outOfRentContractAddresses.ToOrderedSlice(datastructures.StringComparator) { - dexutils.GetMemState(ctx.Context()).DeepFilterAccount(ctx, outOfRentContractAddress) - } - return newValidContracts -} - -func getOutOfRentContracts(env *environment) []types.ContractInfoV2 { - outOfRentContracts := []types.ContractInfoV2{} - for _, contract := range env.validContractsInfo { - if env.outOfRentContractAddresses.Contains(contract.ContractAddr) { - outOfRentContracts = append(outOfRentContracts, contract) - } - } - return outOfRentContracts -} - -func TransferRentFromDexToCollector(ctx sdk.Context, bankKeeper bankkeeper.Keeper, preRents map[string]uint64, postRents map[string]uint64) { - total := uint64(0) - for addr, preRent := range preRents { - if postRent, ok := postRents[addr]; ok { - total += preRent - postRent - } else { - total += preRent - } - } - if err := bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, authtypes.FeeCollectorName, sdk.NewCoins(sdk.NewCoin("usei", sdk.NewIntFromUint64(total)))); err != nil { - ctx.Logger().Error("sending coins from dex to fee collector failed due to %s", err) - } -} diff --git a/x/dex/contract/abci_test.go b/x/dex/contract/abci_test.go deleted file mode 100644 index 3d0b7650b..000000000 --- a/x/dex/contract/abci_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package contract_test - -import ( - "context" - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/contract" - "github.com/sei-protocol/sei-chain/x/dex/types" - minttypes "github.com/sei-protocol/sei-chain/x/mint/types" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -func TestTransferRentFromDexToCollector(t *testing.T) { - preRents := map[string]uint64{"abc": 100, "def": 50} - postRents := map[string]uint64{"abc": 70} - - // expected total is (100 - 70) + 50 = 80 - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - bankkeeper := testApp.BankKeeper - err := bankkeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100)))) - require.Nil(t, err) - err = bankkeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.ModuleName, sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100)))) - require.Nil(t, err) - contract.TransferRentFromDexToCollector(ctx, bankkeeper, preRents, postRents) - dexBalance := bankkeeper.GetBalance(ctx, testApp.AccountKeeper.GetModuleAddress(types.ModuleName), "usei") - require.Equal(t, int64(20), dexBalance.Amount.Int64()) - collectorBalance := bankkeeper.GetBalance(ctx, testApp.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName), "usei") - require.Equal(t, int64(80), collectorBalance.Amount.Int64()) -} - -func TestOrderMatchingRunnablePanicHandler(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - require.NotPanics(t, func() { - contract.OrderMatchingRunnable(context.Background(), ctx, nil, nil, types.ContractInfoV2{}, nil) - }) -} diff --git a/x/dex/contract/dag.go b/x/dex/contract/dag.go deleted file mode 100644 index 761a9d7c2..000000000 --- a/x/dex/contract/dag.go +++ /dev/null @@ -1,78 +0,0 @@ -package contract - -import ( - "github.com/sei-protocol/sei-chain/utils/datastructures" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type node struct { - contractAddr string - incomingNodes *datastructures.SyncSet[string] -} - -// Kahn's algorithm -func TopologicalSortContractInfo(contracts []types.ContractInfoV2) ([]types.ContractInfoV2, error) { - contractAddrToContractInfo := map[string]types.ContractInfoV2{} - for _, contract := range contracts { - contractAddrToContractInfo[contract.ContractAddr] = contract - } - - res := []types.ContractInfoV2{} - nodes := initNodes(contracts) - frontierNodes, nonFrontierNodes := splitNodesByFrontier(nodes) - for len(frontierNodes) > 0 { - for _, frontierNode := range frontierNodes { - if contract, ok := contractAddrToContractInfo[frontierNode.contractAddr]; ok { - res = append(res, contract) - } - for _, nonFrontierNode := range nonFrontierNodes { - nonFrontierNode.incomingNodes.Remove(frontierNode.contractAddr) - } - } - frontierNodes, nonFrontierNodes = splitNodesByFrontier(nonFrontierNodes) - } - if len(nonFrontierNodes) > 0 { - return []types.ContractInfoV2{}, types.ErrCircularContractDependency - } - return res, nil -} - -func initNodes(contracts []types.ContractInfoV2) map[string]node { - res := map[string]node{} - for _, contract := range contracts { - if _, ok := res[contract.ContractAddr]; !ok { - emptyIncomingNodes := datastructures.NewSyncSet([]string{}) - res[contract.ContractAddr] = node{ - contractAddr: contract.ContractAddr, - incomingNodes: &emptyIncomingNodes, - } - } - if contract.Dependencies == nil { - continue - } - for _, dependentContract := range contract.Dependencies { - dependentAddr := dependentContract.Dependency - if _, ok := res[dependentAddr]; !ok { - emptyIncomingNodes := datastructures.NewSyncSet([]string{}) - res[dependentAddr] = node{ - contractAddr: dependentAddr, - incomingNodes: &emptyIncomingNodes, - } - } - res[dependentAddr].incomingNodes.Add(contract.ContractAddr) - } - } - return res -} - -func splitNodesByFrontier(nodes map[string]node) (map[string]node, map[string]node) { - frontierNodes, nonFrontierNodes := map[string]node{}, map[string]node{} - for contractAddr, node := range nodes { - if node.incomingNodes.Size() == 0 { - frontierNodes[contractAddr] = node - } else { - nonFrontierNodes[contractAddr] = node - } - } - return frontierNodes, nonFrontierNodes -} diff --git a/x/dex/contract/dag_test.go b/x/dex/contract/dag_test.go deleted file mode 100644 index a5842ca21..000000000 --- a/x/dex/contract/dag_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package contract_test - -import ( - "testing" - - "github.com/sei-protocol/sei-chain/x/dex/contract" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -// A -> B -> C -func TestTopologicalSortContractInfoSimple(t *testing.T) { - a := types.ContractInfoV2{ - ContractAddr: "A", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "B", - }, - }, - } - b := types.ContractInfoV2{ - ContractAddr: "B", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "C", - }, - }, - } - c := types.ContractInfoV2{ - ContractAddr: "C", - } - res, err := contract.TopologicalSortContractInfo([]types.ContractInfoV2{b, c, a}) - require.Nil(t, err) - require.Equal(t, "A", res[0].ContractAddr) - require.Equal(t, "B", res[1].ContractAddr) - require.Equal(t, "C", res[2].ContractAddr) -} - -// A -> B, C -> D -func TestTopologicalSortContractInfoIsolated(t *testing.T) { - a := types.ContractInfoV2{ - ContractAddr: "A", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "B", - }, - }, - } - b := types.ContractInfoV2{ - ContractAddr: "B", - } - c := types.ContractInfoV2{ - ContractAddr: "C", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "D", - }, - }, - } - d := types.ContractInfoV2{ - ContractAddr: "D", - } - res, err := contract.TopologicalSortContractInfo([]types.ContractInfoV2{b, c, a, d}) - require.Nil(t, err) - aidx, bidx, cidx, didx := -1, -1, -1, -1 - for i, c := range res { - if c.ContractAddr == "A" { - aidx = i - } else if c.ContractAddr == "B" { - bidx = i - } else if c.ContractAddr == "C" { - cidx = i - } else if c.ContractAddr == "D" { - didx = i - } - } - require.True(t, aidx != -1 && aidx < bidx) - require.True(t, cidx != -1 && cidx < didx) -} - -// A -> B -> C -> A -func TestTopologicalSortContractInfoCircular(t *testing.T) { - a := types.ContractInfoV2{ - ContractAddr: "A", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "B", - }, - }, - } - b := types.ContractInfoV2{ - ContractAddr: "B", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "C", - }, - }, - } - c := types.ContractInfoV2{ - ContractAddr: "C", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "A", - }, - }, - } - res, err := contract.TopologicalSortContractInfo([]types.ContractInfoV2{b, c, a}) - require.NotNil(t, err) - require.Equal(t, 0, len(res)) -} diff --git a/x/dex/contract/execution.go b/x/dex/contract/execution.go deleted file mode 100644 index 2c1614f1e..000000000 --- a/x/dex/contract/execution.go +++ /dev/null @@ -1,219 +0,0 @@ -package contract - -import ( - "context" - "fmt" - "time" - - otrace "go.opentelemetry.io/otel/trace" - - "github.com/cosmos/cosmos-sdk/telemetry" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/store/whitelist/multi" - "github.com/sei-protocol/sei-chain/utils/datastructures" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - dexkeeperabci "github.com/sei-protocol/sei-chain/x/dex/keeper/abci" - dexkeeperutils "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "go.opentelemetry.io/otel/attribute" -) - -func CallPreExecutionHooks( - ctx context.Context, - sdkCtx sdk.Context, - contractAddr string, - dexkeeper *keeper.Keeper, - registeredPairs []types.Pair, - tracer *otrace.Tracer, -) error { - spanCtx, span := (*tracer).Start(ctx, "PreExecutionHooks") - defer span.End() - span.SetAttributes(attribute.String("contract", contractAddr)) - abciWrapper := dexkeeperabci.KeeperWrapper{Keeper: dexkeeper} - if err := abciWrapper.HandleEBCancelOrders(spanCtx, sdkCtx, tracer, contractAddr, registeredPairs); err != nil { - return err - } - return abciWrapper.HandleEBPlaceOrders(spanCtx, sdkCtx, tracer, contractAddr, registeredPairs) -} - -func ExecutePair( - ctx sdk.Context, - contractAddr string, - pair types.Pair, - dexkeeper *keeper.Keeper, - orderbook *types.OrderBook, -) []*types.SettlementEntry { - typedContractAddr := types.ContractAddress(contractAddr) - - // First cancel orders - cancelForPair(ctx, dexkeeper, typedContractAddr, pair) - // Add all limit orders to the orderbook - orders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, typedContractAddr, pair) - limitBuys := orders.GetLimitOrders(types.PositionDirection_LONG) - limitSells := orders.GetLimitOrders(types.PositionDirection_SHORT) - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, limitBuys, limitSells) - // Fill market orders - marketOrderOutcome := matchMarketOrderForPair(ctx, typedContractAddr, pair, orderbook) - // Fill limit orders - limitOrderOutcome := exchange.MatchLimitOrders(ctx, orderbook) - totalOutcome := marketOrderOutcome.Merge(&limitOrderOutcome) - - dexkeeperutils.SetPriceStateFromExecutionOutcome(ctx, dexkeeper, typedContractAddr, pair, totalOutcome) - - return totalOutcome.Settlements -} - -func cancelForPair( - ctx sdk.Context, - keeper *keeper.Keeper, - contractAddress types.ContractAddress, - pair types.Pair, -) { - cancels := dexutils.GetMemState(ctx.Context()).GetBlockCancels(ctx, contractAddress, pair) - exchange.CancelOrders(ctx, keeper, contractAddress, pair, cancels.Get()) -} - -func matchMarketOrderForPair( - ctx sdk.Context, - typedContractAddr types.ContractAddress, - pair types.Pair, - orderbook *types.OrderBook, -) exchange.ExecutionOutcome { - orders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, typedContractAddr, pair) - marketBuys := orders.GetSortedMarketOrders(types.PositionDirection_LONG) - marketSells := orders.GetSortedMarketOrders(types.PositionDirection_SHORT) - marketBuyOutcome := exchange.MatchMarketOrders( - ctx, - marketBuys, - orderbook.Shorts, - types.PositionDirection_LONG, - orders, - ) - marketSellOutcome := exchange.MatchMarketOrders( - ctx, - marketSells, - orderbook.Longs, - types.PositionDirection_SHORT, - orders, - ) - return marketBuyOutcome.Merge(&marketSellOutcome) -} - -func GetMatchResults( - ctx sdk.Context, - typedContractAddr types.ContractAddress, - pair types.Pair, -) ([]*types.Order, []*types.Cancellation) { - orderResults := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, typedContractAddr, pair).Get() - cancelResults := dexutils.GetMemState(ctx.Context()).GetBlockCancels(ctx, typedContractAddr, pair).Get() - return orderResults, cancelResults -} - -func GetOrderIDToSettledQuantities(settlements []*types.SettlementEntry) map[uint64]sdk.Dec { - res := map[uint64]sdk.Dec{} - for _, settlement := range settlements { - if _, ok := res[settlement.OrderId]; !ok { - res[settlement.OrderId] = sdk.ZeroDec() - } - res[settlement.OrderId] = res[settlement.OrderId].Add(settlement.Quantity) - } - return res -} - -func ExecutePairsInParallel(ctx sdk.Context, contractAddr string, dexkeeper *keeper.Keeper, registeredPairs []types.Pair, orderBooks *datastructures.TypedSyncMap[types.PairString, *types.OrderBook]) []*types.SettlementEntry { - typedContractAddr := types.ContractAddress(contractAddr) - orderResults := []*types.Order{} - cancelResults := []*types.Cancellation{} - settlements := []*types.SettlementEntry{} - - // mu := sync.Mutex{} - // wg := sync.WaitGroup{} - - for _, pair := range registeredPairs { - // wg.Add(1) - - pair := pair - pairCtx := ctx.WithMultiStore(multi.NewStore(ctx.MultiStore(), GetPerPairWhitelistMap(contractAddr, pair))).WithEventManager(sdk.NewEventManager()) - // go func() { - func() { - // defer wg.Done() - pairCopy := pair - pairStr := types.GetPairString(&pairCopy) - orderbook, found := orderBooks.Load(pairStr) - if !found { - panic(fmt.Sprintf("Orderbook not found for %s", pairCopy.String())) - } - pairSettlements := ExecutePair(pairCtx, contractAddr, pair, dexkeeper, orderbook) - orderIDToSettledQuantities := GetOrderIDToSettledQuantities(pairSettlements) - PrepareCancelUnfulfilledMarketOrders(pairCtx, typedContractAddr, pairCopy, orderIDToSettledQuantities) - - // mu.Lock() - // defer mu.Unlock() - orders, cancels := GetMatchResults(ctx, typedContractAddr, pairCopy) - orderResults = append(orderResults, orders...) - cancelResults = append(cancelResults, cancels...) - settlements = append(settlements, pairSettlements...) - // ordering of events doesn't matter since events aren't part of consensus - ctx.EventManager().EmitEvents(pairCtx.EventManager().Events()) - }() - } - // wg.Wait() - dexkeeper.SetMatchResult(ctx, contractAddr, types.NewMatchResult(orderResults, cancelResults, settlements)) - - return settlements -} - -func HandleExecutionForContract( - ctx context.Context, - sdkCtx sdk.Context, - contract types.ContractInfoV2, - dexkeeper *keeper.Keeper, - registeredPairs []types.Pair, - orderBooks *datastructures.TypedSyncMap[types.PairString, *types.OrderBook], - tracer *otrace.Tracer, -) ([]*types.SettlementEntry, error) { - executionStart := time.Now() - defer telemetry.ModuleMeasureSince(types.ModuleName, executionStart, "handle_execution_for_contract_ms") - contractAddr := contract.ContractAddr - - // Call contract hooks so that contracts can do internal bookkeeping - if err := CallPreExecutionHooks(ctx, sdkCtx, contractAddr, dexkeeper, registeredPairs, tracer); err != nil { - return []*types.SettlementEntry{}, err - } - settlements := ExecutePairsInParallel(sdkCtx, contractAddr, dexkeeper, registeredPairs, orderBooks) - defer EmitSettlementMetrics(settlements) - - return settlements, nil -} - -// Emit metrics for settlements -func EmitSettlementMetrics(settlements []*types.SettlementEntry) { - if len(settlements) > 0 { - telemetry.ModuleSetGauge( - types.ModuleName, - float32(len(settlements)), - "num_settlements", - ) - for _, s := range settlements { - telemetry.IncrCounter( - 1, - "num_settlements_order_type_"+s.GetOrderType(), - ) - telemetry.IncrCounter( - 1, - "num_settlements_position_direction"+s.GetPositionDirection(), - ) - telemetry.IncrCounter( - 1, - "num_settlements_asset_denom_"+s.GetAssetDenom(), - ) - telemetry.IncrCounter( - 1, - "num_settlements_price_denom_"+s.GetPriceDenom(), - ) - } - } -} diff --git a/x/dex/contract/execution_test.go b/x/dex/contract/execution_test.go deleted file mode 100644 index fea46b35f..000000000 --- a/x/dex/contract/execution_test.go +++ /dev/null @@ -1,373 +0,0 @@ -package contract_test - -import ( - "testing" - "time" - - "github.com/sei-protocol/sei-chain/utils/datastructures" - dexutil "github.com/sei-protocol/sei-chain/x/dex/utils" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/contract" - keeperutil "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TEST_PAIR() types.Pair { - return types.Pair{ - PriceDenom: "usdc", - AssetDenom: "atom", - } -} - -const ( - TEST_ACCOUNT = "test_account" - TEST_CONTRACT = "test" - TestTimestamp uint64 = 10000 - TestHeight uint64 = 1 -) - -func TestExecutePair(t *testing.T) { - pair := types.Pair{ - PriceDenom: "USDC", - AssetDenom: "ATOM", - } - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(98), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(98), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "def", - Quantity: sdk.NewDec(3), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, l := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, keepertest.TestContract, l) - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(101), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(101), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 7, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(115), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(115), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 8, - Account: "def", - Quantity: sdk.NewDec(3), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, s := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, keepertest.TestContract, s) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress(keepertest.TestContract), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - - settlements := contract.ExecutePair( - ctx, - TEST_CONTRACT, - pair, - dexkeeper, - orderbook, - ) - require.Equal(t, len(settlements), 0) - - // add Market orders to the orderbook - dexutil.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), pair).Add( - &types.Order{ - Id: 1, - Account: TEST_ACCOUNT, - ContractAddr: TEST_CONTRACT, - Price: sdk.MustNewDecFromStr("97"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutil.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), pair).Add( - &types.Order{ - Id: 2, - Account: TEST_ACCOUNT, - ContractAddr: TEST_CONTRACT, - Price: sdk.MustNewDecFromStr("100"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutil.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), pair).Add( - &types.Order{ - Id: 3, - Account: TEST_ACCOUNT, - ContractAddr: TEST_CONTRACT, - Price: sdk.MustNewDecFromStr("200"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_MARKET, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - - settlements = contract.ExecutePair( - ctx, - TEST_CONTRACT, - pair, - dexkeeper, - orderbook, - ) - - require.Equal(t, 2, len(settlements)) - require.Equal(t, uint64(7), settlements[0].OrderId) - require.Equal(t, uint64(3), settlements[1].OrderId) - - // get match results - matches, cancels := contract.GetMatchResults( - ctx, - TEST_CONTRACT, - pair, - ) - require.Equal(t, 3, len(matches)) - require.Equal(t, 0, len(cancels)) -} - -func TestExecutePairInParallel(t *testing.T) { - pair := types.Pair{ - PriceDenom: "USDC", - AssetDenom: "ATOM", - } - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(98), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(98), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "def", - Quantity: sdk.NewDec(3), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, l := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, TEST_CONTRACT, l) - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(101), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(101), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 7, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(115), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(115), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 8, - Account: "def", - Quantity: sdk.NewDec(3), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, s := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, TEST_CONTRACT, s) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress(TEST_CONTRACT), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - - // execute in parallel simple path - orderbooks := datastructures.NewTypedSyncMap[types.PairString, *types.OrderBook]() - orderbooks.Store(types.GetPairString(&pair), orderbook) - settlements := contract.ExecutePairsInParallel( - ctx, - TEST_CONTRACT, - dexkeeper, - []types.Pair{pair}, - orderbooks, - ) - - require.Equal(t, len(settlements), 0) - - // add Market orders to the orderbook - dexutil.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), pair).Add( - &types.Order{ - Id: 1, - Account: TEST_ACCOUNT, - ContractAddr: TEST_CONTRACT, - Price: sdk.MustNewDecFromStr("97"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutil.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), pair).Add( - &types.Order{ - Id: 2, - Account: TEST_ACCOUNT, - ContractAddr: TEST_CONTRACT, - Price: sdk.MustNewDecFromStr("100"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutil.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), pair).Add( - &types.Order{ - Id: 3, - Account: TEST_ACCOUNT, - ContractAddr: TEST_CONTRACT, - Price: sdk.MustNewDecFromStr("200"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_MARKET, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutil.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(TEST_CONTRACT), pair).Add( - &types.Order{ - Id: 11, - Account: TEST_ACCOUNT, - ContractAddr: TEST_CONTRACT, - Price: sdk.MustNewDecFromStr("20"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_MARKET, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - - settlements = contract.ExecutePairsInParallel( - ctx, - TEST_CONTRACT, - dexkeeper, - []types.Pair{pair}, - orderbooks, - ) - - require.Equal(t, 2, len(settlements)) - require.Equal(t, uint64(7), settlements[0].OrderId) - require.Equal(t, uint64(3), settlements[1].OrderId) -} - -func TestGetOrderIDToSettledQuantities(t *testing.T) { - settlements := []*types.SettlementEntry{ - { - OrderId: 1, - Quantity: sdk.MustNewDecFromStr("100"), - }, - { - OrderId: 2, - Quantity: sdk.MustNewDecFromStr("200"), - }, - } - - idMapping := contract.GetOrderIDToSettledQuantities(settlements) - - require.Equal(t, 2, len(idMapping)) - require.Equal(t, sdk.MustNewDecFromStr("100"), idMapping[1]) - require.Equal(t, sdk.MustNewDecFromStr("200"), idMapping[2]) -} - -func TestEmitSettlementMetrics(t *testing.T) { - settlements := []*types.SettlementEntry{ - { - OrderId: 1, - Quantity: sdk.MustNewDecFromStr("100"), - }, - { - OrderId: 2, - Quantity: sdk.MustNewDecFromStr("200"), - }, - } - - require.NotPanics(t, func() { contract.EmitSettlementMetrics(settlements) }) -} diff --git a/x/dex/contract/market_order.go b/x/dex/contract/market_order.go deleted file mode 100644 index 3901f83e8..000000000 --- a/x/dex/contract/market_order.go +++ /dev/null @@ -1,68 +0,0 @@ -package contract - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - dexkeeperabci "github.com/sei-protocol/sei-chain/x/dex/keeper/abci" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "go.opentelemetry.io/otel/attribute" - otrace "go.opentelemetry.io/otel/trace" -) - -func PrepareCancelUnfulfilledMarketOrders( - ctx sdk.Context, - typedContractAddr types.ContractAddress, - pair types.Pair, - orderIDToSettledQuantities map[uint64]sdk.Dec, -) { - dexutils.GetMemState(ctx.Context()).ClearCancellationForPair(ctx, typedContractAddr, pair) - for _, marketOrderID := range getUnfulfilledPlacedMarketOrderIds(ctx, typedContractAddr, pair, orderIDToSettledQuantities) { - dexutils.GetMemState(ctx.Context()).GetBlockCancels(ctx, typedContractAddr, pair).Add(&types.Cancellation{ - Id: marketOrderID, - Initiator: types.CancellationInitiator_USER, - }) - } -} - -func getUnfulfilledPlacedMarketOrderIds( - ctx sdk.Context, - typedContractAddr types.ContractAddress, - pair types.Pair, - orderIDToSettledQuantities map[uint64]sdk.Dec, -) []uint64 { - res := []uint64{} - for _, order := range dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, typedContractAddr, pair).Get() { - if order.Status == types.OrderStatus_FAILED_TO_PLACE { - continue - } - if order.OrderType == types.OrderType_MARKET || order.OrderType == types.OrderType_FOKMARKET { - if settledQuantity, ok := orderIDToSettledQuantities[order.Id]; !ok || settledQuantity.LT(order.Quantity) { - res = append(res, order.Id) - } - } else if order.OrderType == types.OrderType_FOKMARKETBYVALUE { - // cancel market order by nominal if zero quantity is executed - if _, ok := orderIDToSettledQuantities[order.Id]; !ok { - res = append(res, order.Id) - } - } - } - return res -} - -func CancelUnfulfilledMarketOrders( - ctx context.Context, - sdkCtx sdk.Context, - contractAddr string, - dexkeeper *keeper.Keeper, - registeredPairs []types.Pair, - tracer *otrace.Tracer, -) error { - spanCtx, span := (*tracer).Start(ctx, "CancelUnfulfilledMarketOrders") - span.SetAttributes(attribute.String("contract", contractAddr)) - defer span.End() - abciWrapper := dexkeeperabci.KeeperWrapper{Keeper: dexkeeper} - return abciWrapper.HandleEBCancelOrders(spanCtx, sdkCtx, tracer, contractAddr, registeredPairs) -} diff --git a/x/dex/contract/runner.go b/x/dex/contract/runner.go deleted file mode 100644 index 6e3797f3f..000000000 --- a/x/dex/contract/runner.go +++ /dev/null @@ -1,178 +0,0 @@ -package contract - -import ( - "fmt" - "sync/atomic" - "time" - - "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/utils/datastructures" - "github.com/sei-protocol/sei-chain/utils/logging" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -const LogAfter = 10 * time.Second - -type ParallelRunner struct { - runnable func(contract types.ContractInfoV2) - - contractAddrToInfo *datastructures.TypedSyncMap[types.ContractAddress, *types.ContractInfoV2] - readyContracts *datastructures.TypedSyncMap[types.ContractAddress, struct{}] - readyCnt int64 - inProgressCnt int64 - someContractFinished chan struct{} - done chan struct{} - sdkCtx sdk.Context -} - -func NewParallelRunner(runnable func(contract types.ContractInfoV2), contracts []types.ContractInfoV2, ctx sdk.Context) ParallelRunner { - contractAddrToInfo := datastructures.NewTypedSyncMap[types.ContractAddress, *types.ContractInfoV2]() - contractsFrontier := datastructures.NewTypedSyncMap[types.ContractAddress, struct{}]() - for _, contract := range contracts { - // runner will mutate ContractInfo fields - copyContract := contract - typedContractAddr := types.ContractAddress(contract.ContractAddr) - contractAddrToInfo.Store(typedContractAddr, ©Contract) - if copyContract.NumIncomingDependencies == 0 { - contractsFrontier.Store(typedContractAddr, struct{}{}) - } - } - return ParallelRunner{ - runnable: runnable, - contractAddrToInfo: contractAddrToInfo, - readyContracts: contractsFrontier, - readyCnt: int64(contractsFrontier.Len()), - inProgressCnt: 0, - someContractFinished: make(chan struct{}), - done: make(chan struct{}, 1), - sdkCtx: ctx, - } -} - -// We define "frontier contract" as a contract which: -// 1. Has not finished running yet, and -// 2. either: -// a. has no other contracts depending on it, or -// b. for which all contracts that depend on it have already finished. -// -// Consequently, the set of frontier contracts will mutate throughout the -// `Run` method, until all contracts finish their runs. -// The key principle here is that at any moment, we can have all frontier -// contracts running concurrently, since there must be no ancestral -// relationships among them due to the definition above. -// The simplest implementation would be: -// ``` -// while there is any contract left: -// -// run all frontier contracts concurrently -// wait for all runs to finish -// update the frontier set -// -// ``` -// We can illustrate why this implementation is not optimal with the following -// example: -// -// Suppose we have four contracts, where A depends on B, and C depends on -// D. The run for A, B, C, D takes 5s, 5s, 8s, 2s, respectively. -// With the implementation above, the first iteration would take 8s since -// it runs A and C, and the second iteration would take 5s since it runs -// B and D. However C doesn't actually need to wait for B to finish, and -// if C runs immediately after A finishes, the whole process would take -// max(5 + 5, 8 + 2) = 10s, which is 3s faster than the implementation -// above. -// -// So we can optimize the implementation to be: -// ``` -// while there is any contract left: -// -// run all frontier contracts concurrently -// wait for any existing run (could be from previous iteration) to finish -// update the frontier set -// -// ``` -// With the example above, the whole process would take 3 iterations: -// Iter 1 (A, C run): 5s since it finishes when A finishes -// Iter 2 (B run): 3s since it finishes when C finishes -// Iter 3 (D run): 2s since it finishes when B, D finish -// -// The following `Run` method implements the pseudocode above. -func (r *ParallelRunner) Run() { - if atomic.LoadInt64(&r.inProgressCnt) == 0 && atomic.LoadInt64(&r.readyCnt) == 0 { - return - } - // The ordering of the two conditions below matters, since readyCnt - // is updated before inProgressCnt. - for atomic.LoadInt64(&r.inProgressCnt) > 0 || atomic.LoadInt64(&r.readyCnt) > 0 { - // r.readyContracts represent all frontier contracts that have - // not started running yet. - r.readyContracts.Range(func(key types.ContractAddress, _ struct{}) bool { - atomic.AddInt64(&r.inProgressCnt, 1) - go r.wrapRunnable(key) - // Since the frontier contract has started running, we need - // to remove it from r.readyContracts so that it won't - // double-run. - r.readyContracts.Delete(key) - // The reason we use a separate readyCnt is because `sync.Map` - // doesn't provide an atomic way to get its length. - atomic.AddInt64(&r.readyCnt, -1) - return true - }) - // This corresponds to the "wait for any existing run (could be - // from previous iteration) to finish" part in the pseudocode above. - _, err := logging.LogIfNotDoneAfter(r.sdkCtx.Logger(), func() (struct{}, error) { - <-r.someContractFinished - return struct{}{}, nil - }, LogAfter, "dex_parallel_runner_wait") - if err != nil { - // this should never happen - panic(err) - } - } - - // make sure there is no orphaned goroutine blocked on channel send - r.done <- struct{}{} -} - -func (r *ParallelRunner) wrapRunnable(contractAddr types.ContractAddress) { - defer func() { - if err := recover(); err != nil { - telemetry.IncrCounter(1, "recovered_panics") - r.sdkCtx.Logger().Error(fmt.Sprintf("panic in parallel runner recovered: %s", err)) - } - - atomic.AddInt64(&r.inProgressCnt, -1) // this has to happen after any potential increment to readyCnt - select { - case r.someContractFinished <- struct{}{}: - case <-r.done: - // make sure other goroutines can also receive from 'done' - r.done <- struct{}{} - } - }() - - contractInfo, _ := r.contractAddrToInfo.Load(contractAddr) - r.runnable(*contractInfo) - - // Check if there is any contract that should be promoted to the frontier set. - if contractInfo.Dependencies != nil { - for _, dependency := range contractInfo.Dependencies { - dependentContract := dependency.Dependency - typedDependentContract := types.ContractAddress(dependentContract) - dependentInfo, ok := r.contractAddrToInfo.Load(typedDependentContract) - if !ok { - // If we cannot find the dependency in the contract address info, then it's not a valid contract in this round - r.sdkCtx.Logger().Error(fmt.Sprintf("Couldn't find dependency %s of contract %s in the contract address info", contractInfo.ContractAddr, dependentContract)) - continue - } - // It's okay to mutate ContractInfo here since it's a copy made in the runner's - // constructor. - newNumIncomingPaths := atomic.AddInt64(&dependentInfo.NumIncomingDependencies, -1) - // This corresponds to the "for which all contracts that depend on it have - // already finished." definition for frontier contract. - if newNumIncomingPaths == 0 { - r.readyContracts.Store(typedDependentContract, struct{}{}) - atomic.AddInt64(&r.readyCnt, 1) - } - } - } -} diff --git a/x/dex/contract/runner_test.go b/x/dex/contract/runner_test.go deleted file mode 100644 index bf7e8c1d7..000000000 --- a/x/dex/contract/runner_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package contract_test - -import ( - "sync" - "sync/atomic" - "testing" - "time" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/contract" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -var ( - counter int64 = 0 - dependencyCheck = sync.Map{} - testApp = keepertest.TestApp() - sdkCtx = testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) -) - -func noopRunnable(_ types.ContractInfoV2) { - atomic.AddInt64(&counter, 1) -} - -func idleRunnable(_ types.ContractInfoV2) { - time.Sleep(5 * time.Second) - atomic.AddInt64(&counter, 1) -} - -func panicRunnable(_ types.ContractInfoV2) { - panic("") -} - -func dependencyCheckRunnable(contractInfo types.ContractInfoV2) { - if contractInfo.ContractAddr == "C" { - _, hasA := dependencyCheck.Load("A") - _, hasB := dependencyCheck.Load("B") - if !hasA || !hasB { - return - } - } - dependencyCheck.Store(contractInfo.ContractAddr, struct{}{}) -} - -func TestRunnerSingleContract(t *testing.T) { - counter = 0 - contractInfo := types.ContractInfoV2{ - ContractAddr: "A", - NumIncomingDependencies: 0, - } - runner := contract.NewParallelRunner(noopRunnable, []types.ContractInfoV2{contractInfo}, sdkCtx) - runner.Run() - require.Equal(t, int64(1), counter) -} - -func TestRunnerParallelContract(t *testing.T) { - counter = 0 - contractInfoA := types.ContractInfoV2{ - ContractAddr: "A", - NumIncomingDependencies: 0, - } - contractInfoB := types.ContractInfoV2{ - ContractAddr: "B", - NumIncomingDependencies: 0, - } - runner := contract.NewParallelRunner(idleRunnable, []types.ContractInfoV2{contractInfoA, contractInfoB}, sdkCtx) - start := time.Now() - runner.Run() - end := time.Now() - duration := end.Sub(start) - require.Equal(t, int64(2), counter) - require.True(t, duration.Seconds() < 10) // would not be flaky unless it's running on really slow hardware -} - -func TestRunnerParallelContractWithDependency(t *testing.T) { - counter = 0 - contractInfoA := types.ContractInfoV2{ - ContractAddr: "A", - NumIncomingDependencies: 0, - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "C", - }, - }, - } - contractInfoB := types.ContractInfoV2{ - ContractAddr: "B", - NumIncomingDependencies: 0, - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "C", - }, - }, - } - contractInfoC := types.ContractInfoV2{ - ContractAddr: "C", - NumIncomingDependencies: 2, - } - runner := contract.NewParallelRunner(dependencyCheckRunnable, []types.ContractInfoV2{contractInfoC, contractInfoB, contractInfoA}, sdkCtx) - runner.Run() - _, hasC := dependencyCheck.Load("C") - require.True(t, hasC) -} - -func TestRunnerParallelContractWithInvalidDependency(t *testing.T) { - dependencyCheck = sync.Map{} - counter = 0 - contractInfoA := types.ContractInfoV2{ - ContractAddr: "A", - NumIncomingDependencies: 0, - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "C", - }, - }, - } - contractInfoB := types.ContractInfoV2{ - ContractAddr: "B", - NumIncomingDependencies: 0, - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "C", - }, - }, - } - runner := contract.NewParallelRunner(dependencyCheckRunnable, []types.ContractInfoV2{contractInfoB, contractInfoA}, sdkCtx) - runner.Run() - _, hasC := dependencyCheck.Load("C") - require.False(t, hasC) -} - -func TestRunnerPanicContract(t *testing.T) { - contractInfo := types.ContractInfoV2{ - ContractAddr: "A", - NumIncomingDependencies: 0, - } - runner := contract.NewParallelRunner(panicRunnable, []types.ContractInfoV2{contractInfo}, sdkCtx) - require.NotPanics(t, runner.Run) -} diff --git a/x/dex/contract/settlement.go b/x/dex/contract/settlement.go deleted file mode 100644 index e840388e4..000000000 --- a/x/dex/contract/settlement.go +++ /dev/null @@ -1,39 +0,0 @@ -package contract - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - dexkeeperutils "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func HandleSettlements( - ctx sdk.Context, - contractAddr string, - dexkeeper *keeper.Keeper, - settlements []*types.SettlementEntry, -) error { - return callSettlementHook(ctx, contractAddr, dexkeeper, settlements) -} - -func callSettlementHook( - ctx sdk.Context, - contractAddr string, - dexkeeper *keeper.Keeper, - settlementEntries []*types.SettlementEntry, -) error { - if len(settlementEntries) == 0 { - return nil - } - _, currentEpoch := dexkeeper.IsNewEpoch(ctx) - nativeSettlementMsg := types.SudoSettlementMsg{ - Settlement: types.Settlements{ - Epoch: int64(currentEpoch), - Entries: settlementEntries, - }, - } - if _, err := dexkeeperutils.CallContractSudo(ctx, dexkeeper, contractAddr, nativeSettlementMsg, dexkeeper.GetSettlementGasAllowance(ctx, len(settlementEntries))); err != nil { - return err - } - return nil -} diff --git a/x/dex/contract/whitelist.go b/x/dex/contract/whitelist.go deleted file mode 100644 index d6ab9a8a9..000000000 --- a/x/dex/contract/whitelist.go +++ /dev/null @@ -1,91 +0,0 @@ -package contract - -import ( - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -var DexWhitelistedKeys = []string{ - types.LongBookKey, - types.ShortBookKey, - types.OrderKey, - types.AccountActiveOrdersKey, - types.CancelKey, - types.TwapKey, - types.PriceKey, - types.NextOrderIDKey, - types.MatchResultKey, - types.LongOrderCountKey, - types.ShortOrderCountKey, - keeper.ContractPrefixKey, -} - -var DexMemWhitelistedKeys = []string{ - types.MemOrderKey, - types.MemDepositKey, - types.MemCancelKey, -} - -var WasmWhitelistedKeys = []string{ - string(wasmtypes.ContractStorePrefix), -} - -func GetWhitelistMap(contractAddr string) map[string][]string { - res := map[string][]string{} - res[storetypes.NewKVStoreKey(types.StoreKey).Name()] = GetDexWhitelistedPrefixes(contractAddr) - res[storetypes.NewKVStoreKey(wasmtypes.StoreKey).Name()] = GetWasmWhitelistedPrefixes(contractAddr) - res[storetypes.NewKVStoreKey(types.MemStoreKey).Name()] = GetDexMemWhitelistedPrefixes(contractAddr) - return res -} - -func GetPerPairWhitelistMap(contractAddr string, pair types.Pair) map[string][]string { - res := map[string][]string{} - res[storetypes.NewKVStoreKey(types.StoreKey).Name()] = GetDexPerPairWhitelistedPrefixes(contractAddr, pair) - res[storetypes.NewKVStoreKey(types.MemStoreKey).Name()] = GetDexMemPerPairWhitelistedPrefixes(contractAddr, pair) - return res -} - -func GetDexWhitelistedPrefixes(contractAddr string) []string { - return utils.Map(DexWhitelistedKeys, func(key string) string { - return string(append( - types.KeyPrefix(key), types.AddressKeyPrefix(contractAddr)..., - )) - }) -} - -func GetDexMemWhitelistedPrefixes(contractAddr string) []string { - return utils.Map(DexMemWhitelistedKeys, func(key string) string { - return string(append( - types.KeyPrefix(key), types.AddressKeyPrefix(contractAddr)..., - )) - }) -} - -func GetWasmWhitelistedPrefixes(contractAddr string) []string { - addr, _ := sdk.AccAddressFromBech32(contractAddr) - return utils.Map(WasmWhitelistedKeys, func(key string) string { - return string(append( - []byte(key), addr..., - )) - }) -} - -func GetDexPerPairWhitelistedPrefixes(contractAddr string, pair types.Pair) []string { - return utils.Map(DexWhitelistedKeys, func(key string) string { - return string(append(append( - types.KeyPrefix(key), types.AddressKeyPrefix(contractAddr)..., - ), types.PairPrefix(pair.PriceDenom, pair.AssetDenom)...)) - }) -} - -func GetDexMemPerPairWhitelistedPrefixes(contractAddr string, pair types.Pair) []string { - return utils.Map(DexMemWhitelistedKeys, func(key string) string { - return string(append(append( - types.KeyPrefix(key), types.AddressKeyPrefix(contractAddr)..., - ), types.PairPrefix(pair.PriceDenom, pair.AssetDenom)...)) - }) -} diff --git a/x/dex/contract/whitelist_test.go b/x/dex/contract/whitelist_test.go deleted file mode 100644 index 79fb70174..000000000 --- a/x/dex/contract/whitelist_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package contract_test - -import ( - "encoding/hex" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/contract" - "github.com/stretchr/testify/require" -) - -func TestGetWasmPrefixes(t *testing.T) { - wasmWhitelistedPrefixes := contract.GetWasmWhitelistedPrefixes("sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m") - - wasmPrefixBytes, _ := hex.DecodeString("03" + "ade4a5f5803a439835c636395a8d648dee57b2fc90d98dc17fa887159b69638b") - require.Equal(t, []byte(wasmWhitelistedPrefixes[0]), wasmPrefixBytes) -} - -func TestGetDexPrefixes(t *testing.T) { - dexWhitelistedPrefixes := contract.GetDexWhitelistedPrefixes("sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m") - addr, _ := sdk.AccAddressFromBech32("sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m") - - for i, dexKeys := range contract.DexWhitelistedKeys { - len := []byte{byte(32)} - prefix := append(append([]byte(dexKeys), len...), addr...) - require.Equal(t, string(prefix), dexWhitelistedPrefixes[i]) - } -} diff --git a/x/dex/example/add-asset-metadata-proposal.json b/x/dex/example/add-asset-metadata-proposal.json deleted file mode 100644 index 80365fad2..000000000 --- a/x/dex/example/add-asset-metadata-proposal.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "title": "Add usdc asset to asset list", - "description": "gov proposal to update asset list", - "asset_list": [ - { - "ibc_info": { - "source_channel": "channel-1", - "dst_channel": "channel-2", - "source_denom": "uusdc", - "source_chain_id": "axelar" - }, - "type_asset": "erc20", - "metadata": { - "description": "Circle's stablecoin on Axelar", - "denom_units": [ - { - "denom": "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", - "exponent": 0, - "aliases": ["uusdc"] - }, - { - "denom": "axlusdc", - "exponent": 6 - } - ], - "base": "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", - "name": "USD Coin", - "display": "axlusdc", - "symbol": "USDC" - } - }, - { - "type_asset": "native", - "metadata": { - "description": "Native token of Sei Network", - "denom_units": [ - { - "denom": "usei", - "exponent": 0, - "aliases": ["usei"] - }, - { - "denom": "sei", - "exponent": 6 - } - ], - "base": "SEI", - "name": "sei", - "display": "usei", - "symbol": "SEI" - } - } - ], - "deposit": "500000usei" -} diff --git a/x/dex/example/register-pair-tx.json b/x/dex/example/register-pair-tx.json deleted file mode 100644 index 61d285599..000000000 --- a/x/dex/example/register-pair-tx.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "batch_contract_pair": [ - { - "contract_addr": "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m", - "pairs": [ - { - "price_denom": "usei", - "asset_denom": "uatom", - "price_tick_size": "0.0000001", - "quantity_tick_size": "0.0000001" - } - ] - } - ] -} \ No newline at end of file diff --git a/x/dex/example/update-tick-size-tx.json b/x/dex/example/update-tick-size-tx.json deleted file mode 100644 index 746e819d2..000000000 --- a/x/dex/example/update-tick-size-tx.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "tick_size_list": [ - { - "pair": { - "price_denom": "uatom", - "asset_denom": "usei" - }, - "tick_size": "1.5", - "contract_addr": "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m" - } - ] -} \ No newline at end of file diff --git a/x/dex/exchange/cancel_order.go b/x/dex/exchange/cancel_order.go deleted file mode 100644 index c50d6be96..000000000 --- a/x/dex/exchange/cancel_order.go +++ /dev/null @@ -1,53 +0,0 @@ -package exchange - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func CancelOrders( - ctx sdk.Context, keeper *keeper.Keeper, contract types.ContractAddress, pair types.Pair, - cancels []*types.Cancellation, -) { - for _, cancel := range cancels { - cancelOrder(ctx, keeper, cancel, contract, pair) - } -} - -func cancelOrder(ctx sdk.Context, keeper *keeper.Keeper, cancellation *types.Cancellation, contract types.ContractAddress, pair types.Pair) { - getter, setter, deleter := keeper.GetLongOrderBookEntryByPrice, keeper.SetLongOrderBookEntry, keeper.RemoveLongBookByPrice - if cancellation.PositionDirection == types.PositionDirection_SHORT { - getter, setter, deleter = keeper.GetShortOrderBookEntryByPrice, keeper.SetShortOrderBookEntry, keeper.RemoveShortBookByPrice - } - entry, found := getter(ctx, string(contract), cancellation.Price, pair.PriceDenom, pair.AssetDenom) - if !found { - return - } - newEntry := *entry.GetOrderEntry() - newAllocations := []*types.Allocation{} - newQuantity := sdk.ZeroDec() - for _, allocation := range newEntry.Allocations { - if allocation.OrderId != cancellation.Id { - newAllocations = append(newAllocations, allocation) - newQuantity = newQuantity.Add(allocation.Quantity) - } - } - numAllocationsRemoved := len(newEntry.Allocations) - len(newAllocations) - if numAllocationsRemoved > 0 { - err := keeper.DecreaseOrderCount(ctx, string(contract), pair.PriceDenom, pair.AssetDenom, cancellation.PositionDirection, entry.GetPrice(), uint64(numAllocationsRemoved)) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error decreasing order count: %s", err)) - } - } - if newQuantity.IsZero() { - deleter(ctx, string(contract), entry.GetPrice(), pair.PriceDenom, pair.AssetDenom) - return - } - newEntry.Quantity = newQuantity - newEntry.Allocations = newAllocations - entry.SetEntry(&newEntry) - setter(ctx, string(contract), entry) -} diff --git a/x/dex/exchange/cancel_order_test.go b/x/dex/exchange/cancel_order_test.go deleted file mode 100644 index 43701f9f6..000000000 --- a/x/dex/exchange/cancel_order_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package exchange_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" -) - -func TestCancelOrder(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(98), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(98), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, s := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", s) - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(101), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(101), - Quantity: sdk.NewDec(12), - Allocations: []*types.Allocation{{ - OrderId: 7, - Account: "abc", - Quantity: sdk.NewDec(5), - }, { - OrderId: 8, - Account: "def", - Quantity: sdk.NewDec(7), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, s := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", s) - } - - // Allocations before cancellation contains id 5 - assert.Equal(t, (*longBook[0].GetOrderEntry()).Allocations, []*types.Allocation{{ - OrderId: 5, - Account: "abc", - Quantity: sdk.NewDec(5), - }}) - - // Cancel Long Id 5 - cancellation := types.Cancellation{ - Id: 5, - Creator: "abc", - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - PositionDirection: types.PositionDirection_LONG, - Price: sdk.NewDec(98), - } - // Cancel short Id 7 - cancellationShort := types.Cancellation{ - Id: 7, - Creator: "abc", - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - PositionDirection: types.PositionDirection_SHORT, - Price: sdk.NewDec(101), - } - cancels := []*types.Cancellation{&cancellation, &cancellationShort} - exchange.CancelOrders(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}, - cancels, - ) - - // No allocations after cancellation - _, found := dexkeeper.GetLongBookByPrice(ctx, "test", sdk.NewDec(98), "USDC", "ATOM") - require.False(t, found) - entry, found := dexkeeper.GetShortBookByPrice(ctx, "test", sdk.NewDec(101), "USDC", "ATOM") - require.True(t, found) - require.Equal(t, sdk.NewDec(7), entry.GetOrderEntry().Quantity) - require.Equal(t, []*types.Allocation{{ - OrderId: 8, - Account: "def", - Quantity: sdk.NewDec(7), - }}, entry.GetOrderEntry().Allocations) -} diff --git a/x/dex/exchange/helpers.go b/x/dex/exchange/helpers.go deleted file mode 100644 index eeb39a8ee..000000000 --- a/x/dex/exchange/helpers.go +++ /dev/null @@ -1,24 +0,0 @@ -package exchange - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type ExecutionOutcome struct { - TotalNotional sdk.Dec - TotalQuantity sdk.Dec - Settlements []*types.SettlementEntry - MinPrice sdk.Dec // deprecate? - MaxPrice sdk.Dec // deprecate? -} - -func (o *ExecutionOutcome) Merge(other *ExecutionOutcome) ExecutionOutcome { - return ExecutionOutcome{ - TotalNotional: o.TotalNotional.Add(other.TotalNotional), - TotalQuantity: o.TotalQuantity.Add(other.TotalQuantity), - Settlements: append(o.Settlements, other.Settlements...), - MinPrice: sdk.MinDec(o.MinPrice, other.MinPrice), - MaxPrice: sdk.MaxDec(o.MaxPrice, other.MaxPrice), - } -} diff --git a/x/dex/exchange/helpers_test.go b/x/dex/exchange/helpers_test.go deleted file mode 100644 index 3b271c389..000000000 --- a/x/dex/exchange/helpers_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package exchange_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMergeExecutionOutcomes(t *testing.T) { - s1 := types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - } - - s2 := types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - } - - e1 := exchange.ExecutionOutcome{ - TotalNotional: sdk.MustNewDecFromStr("1"), - TotalQuantity: sdk.MustNewDecFromStr("2"), - Settlements: []*types.SettlementEntry{&s1, &s2, &s1}, - MinPrice: sdk.MustNewDecFromStr("1"), - MaxPrice: sdk.MustNewDecFromStr("4"), - } - - e2 := exchange.ExecutionOutcome{ - TotalNotional: sdk.MustNewDecFromStr("4"), - TotalQuantity: sdk.MustNewDecFromStr("4"), - Settlements: []*types.SettlementEntry{&s1, &s2}, - MinPrice: sdk.MustNewDecFromStr("0.5"), - MaxPrice: sdk.MustNewDecFromStr("3"), - } - - outcome := e1.Merge(&e2) - - require.Equal(t, outcome.TotalNotional, sdk.MustNewDecFromStr("5")) - require.Equal(t, outcome.TotalQuantity, sdk.MustNewDecFromStr("6")) - require.Equal(t, len(outcome.Settlements), 5) - require.Equal(t, outcome.MinPrice, sdk.MustNewDecFromStr("0.5")) - require.Equal(t, outcome.MaxPrice, sdk.MustNewDecFromStr("4")) -} diff --git a/x/dex/exchange/limit_order.go b/x/dex/exchange/limit_order.go deleted file mode 100644 index 65f249d02..000000000 --- a/x/dex/exchange/limit_order.go +++ /dev/null @@ -1,103 +0,0 @@ -package exchange - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func MatchLimitOrders( - ctx sdk.Context, - orderbook *types.OrderBook, -) ExecutionOutcome { - settlements := []*types.SettlementEntry{} - totalExecuted, totalPrice := sdk.ZeroDec(), sdk.ZeroDec() - minPrice, maxPrice := sdk.OneDec().Neg(), sdk.OneDec().Neg() - - for longEntry, shortEntry := orderbook.Longs.Next(ctx), orderbook.Shorts.Next(ctx); longEntry != nil && shortEntry != nil && longEntry.GetPrice().GTE(shortEntry.GetPrice()); longEntry, shortEntry = orderbook.Longs.Next(ctx), orderbook.Shorts.Next(ctx) { - var executed sdk.Dec - if longEntry.GetOrderEntry().Quantity.LT(shortEntry.GetOrderEntry().Quantity) { - executed = longEntry.GetOrderEntry().Quantity - } else { - executed = shortEntry.GetOrderEntry().Quantity - } - totalExecuted = totalExecuted.Add(executed).Add(executed) - totalPrice = totalPrice.Add( - executed.Mul( - longEntry.GetPrice().Add(shortEntry.GetPrice()), - ), - ) - if minPrice.IsNegative() || minPrice.GT(shortEntry.GetPrice()) { - minPrice = shortEntry.GetPrice() - } - maxPrice = sdk.MaxDec(maxPrice, longEntry.GetPrice()) - - newSettlements := SettleFromBook( - ctx, - orderbook, - executed, - longEntry.GetPrice(), - shortEntry.GetPrice(), - ) - settlements = append(settlements, newSettlements...) - } - - orderbook.Longs.Flush(ctx) - orderbook.Shorts.Flush(ctx) - return ExecutionOutcome{ - TotalNotional: totalPrice, - TotalQuantity: totalExecuted, - Settlements: settlements, - MinPrice: minPrice, - MaxPrice: maxPrice, - } -} - -func addOrderToOrderBookEntry( - ctx sdk.Context, keeper *keeper.Keeper, - order *types.Order, -) { - getter, setter := keeper.GetLongOrderBookEntryByPrice, keeper.SetLongOrderBookEntry - if order.PositionDirection == types.PositionDirection_SHORT { - getter, setter = keeper.GetShortOrderBookEntryByPrice, keeper.SetShortOrderBookEntry - } - entry, exist := getter(ctx, order.ContractAddr, order.Price, order.PriceDenom, order.AssetDenom) - orderEntry := entry.GetOrderEntry() - if !exist { - orderEntry = &types.OrderEntry{ - Price: order.Price, - PriceDenom: order.PriceDenom, - AssetDenom: order.AssetDenom, - Quantity: sdk.ZeroDec(), - } - } - orderEntry.Quantity = orderEntry.Quantity.Add(order.Quantity) - orderEntry.Allocations = append(orderEntry.Allocations, &types.Allocation{ - OrderId: order.Id, - Quantity: order.Quantity, - Account: order.Account, - }) - entry.SetPrice(order.Price) - entry.SetEntry(orderEntry) - setter(ctx, order.ContractAddr, entry) - - err := keeper.IncreaseOrderCount(ctx, order.ContractAddr, order.PriceDenom, order.AssetDenom, order.PositionDirection, order.Price, 1) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error increasing order count: %s", err)) - } -} - -func AddOutstandingLimitOrdersToOrderbook( - ctx sdk.Context, keeper *keeper.Keeper, - limitBuys []*types.Order, - limitSells []*types.Order, -) { - for _, order := range limitBuys { - addOrderToOrderBookEntry(ctx, keeper, order) - } - for _, order := range limitSells { - addOrderToOrderBookEntry(ctx, keeper, order) - } -} diff --git a/x/dex/exchange/limit_order_fuzz_test.go b/x/dex/exchange/limit_order_fuzz_test.go deleted file mode 100644 index 3e14f3184..000000000 --- a/x/dex/exchange/limit_order_fuzz_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package exchange_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/testutil/fuzzing" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - keeperutil "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -var TestFuzzLimitCtx = sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) -var TestFuzzLimitKeeper keeper.Keeper - -func FuzzMatchLimitOrders(f *testing.F) { - TestFuzzLimitCtx = TestFuzzLimitCtx.WithBlockHeight(1).WithBlockTime(time.Now()) - f.Fuzz(fuzzTargetMatchLimitOrders) -} - -func fuzzTargetMatchLimitOrders( - t *testing.T, - buyPrices []byte, - sellPrices []byte, - buyQuantities []byte, - sellQuantities []byte, - buyEntryWeights []byte, - sellEntryWeights []byte, - buyAccountIndices []byte, - sellAccountIndices []byte, - buyAllocationWeights []byte, - sellAllocationWeights []byte, -) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(1).WithBlockTime(time.Now()) - buyEntries := fuzzing.GetOrderBookEntries(true, keepertest.TestPriceDenom, keepertest.TestAssetDenom, buyEntryWeights, buyAccountIndices, buyAllocationWeights) - for _, entry := range buyEntries { - dexkeeper.SetLongOrderBookEntry(ctx, keepertest.TestContract, entry) - } - sellEntries := fuzzing.GetOrderBookEntries(false, keepertest.TestPriceDenom, keepertest.TestAssetDenom, sellEntryWeights, sellAccountIndices, sellAllocationWeights) - for _, entry := range sellEntries { - dexkeeper.SetShortOrderBookEntry(ctx, keepertest.TestContract, entry) - } - buyOrders := fuzzing.GetPlacedOrders(types.PositionDirection_LONG, types.OrderType_LIMIT, keepertest.TestPair, buyPrices, buyQuantities) - sellOrders := fuzzing.GetPlacedOrders(types.PositionDirection_SHORT, types.OrderType_LIMIT, keepertest.TestPair, sellPrices, sellQuantities) - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, buyOrders, sellOrders) - orderBook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress(keepertest.TestContract), types.Pair{PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}) - require.NotPanics(t, func() { exchange.MatchLimitOrders(ctx, orderBook) }) -} diff --git a/x/dex/exchange/limit_order_test.go b/x/dex/exchange/limit_order_test.go deleted file mode 100644 index f904ab91c..000000000 --- a/x/dex/exchange/limit_order_test.go +++ /dev/null @@ -1,1165 +0,0 @@ -package exchange_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - keeperutil "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/assert" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" -) - -func TEST_PAIR() types.Pair { - return types.Pair{ - PriceDenom: "usdc", - AssetDenom: "atom", - } -} - -func TestMatchSingleOrder(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - shortOrders := []*types.Order{ - { - Id: 2, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "def", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - longBook := []types.OrderBookEntry{} - shortBook := []types.OrderBookEntry{} - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, longOrders, shortOrders) - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - outcome := exchange.MatchLimitOrders( - ctx, orderbook, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - assert.Equal(t, totalPrice, sdk.NewDec(1000)) - assert.Equal(t, totalExecuted, sdk.NewDec(10)) - assert.Equal(t, outcome.MaxPrice, sdk.NewDec(100)) - assert.Equal(t, outcome.MinPrice, sdk.NewDec(100)) - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, len(longBook), 0) - assert.Equal(t, len(shortBook), 0) - assert.Equal(t, len(settlements), 2) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) -} - -func TestAddOrders(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "def", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - { - Id: 2, - Price: sdk.NewDec(95), - Quantity: sdk.NewDec(3), - Account: "def", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - shortOrders := []*types.Order{ - { - Id: 3, - Price: sdk.NewDec(105), - Quantity: sdk.NewDec(10), - Account: "ghi", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - { - Id: 4, - Price: sdk.NewDec(115), - Quantity: sdk.NewDec(2), - Account: "mno", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(98), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(98), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "def", - Quantity: sdk.NewDec(3), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(101), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(101), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 7, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(115), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(115), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 8, - Account: "def", - Quantity: sdk.NewDec(3), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, longOrders, shortOrders) - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - outcome := exchange.MatchLimitOrders( - ctx, orderbook, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - assert.Equal(t, totalPrice, sdk.NewDec(0)) - assert.Equal(t, totalExecuted, sdk.NewDec(0)) - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, len(longBook), 3) - assert.Equal(t, longBook[0].GetPrice(), sdk.NewDec(95)) - assert.Equal(t, *longBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(95), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 2, - Account: "def", - Quantity: sdk.NewDec(3), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, longBook[1].GetPrice(), sdk.NewDec(98)) - assert.Equal(t, *longBook[1].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(98), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, longBook[2].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *longBook[2].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(8), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "def", - Quantity: sdk.NewDec(3), - }, { - OrderId: 1, - Account: "def", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(shortBook), 3) - assert.Equal(t, shortBook[0].GetPrice(), sdk.NewDec(101)) - assert.Equal(t, *shortBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(101), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 7, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, shortBook[1].GetPrice(), sdk.NewDec(105)) - assert.Equal(t, *shortBook[1].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(105), - Quantity: sdk.NewDec(10), - Allocations: []*types.Allocation{{ - OrderId: 3, - Account: "ghi", - Quantity: sdk.NewDec(10), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, shortBook[2].GetPrice(), sdk.NewDec(115)) - assert.Equal(t, *shortBook[2].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(115), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 8, - Account: "def", - Quantity: sdk.NewDec(3), - }, { - OrderId: 4, - Account: "mno", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(settlements), 0) -} - -func TestMatchSingleOrderFromShortBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - shortOrders := []*types.Order{} - longBook := []types.OrderBookEntry{} - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 2, - Account: "def", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, longOrders, shortOrders) - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - outcome := exchange.MatchLimitOrders( - ctx, orderbook, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - assert.Equal(t, totalPrice, sdk.NewDec(1000)) - assert.Equal(t, totalExecuted, sdk.NewDec(10)) - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, len(longBook), 0) - assert.Equal(t, len(shortBook), 0) - assert.Equal(t, len(settlements), 2) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) -} - -func TestMatchSingleOrderFromLongBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{} - shortOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "def", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 2, - Account: "abc", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - shortBook := []types.OrderBookEntry{} - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, longOrders, shortOrders) - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - outcome := exchange.MatchLimitOrders( - ctx, orderbook, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - assert.Equal(t, totalPrice, sdk.NewDec(1000)) - assert.Equal(t, totalExecuted, sdk.NewDec(10)) - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, len(longBook), 0) - assert.Equal(t, len(shortBook), 0) - assert.Equal(t, len(settlements), 2) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) -} - -func TestMatchSingleOrderFromMultipleShortBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - shortOrders := []*types.Order{} - longBook := []types.OrderBookEntry{} - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(90), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(90), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 2, - Account: "def", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Allocations: []*types.Allocation{{ - OrderId: 3, - Account: "def", - Quantity: sdk.NewDec(4), - }, { - OrderId: 4, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, longOrders, shortOrders) - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - outcome := exchange.MatchLimitOrders( - ctx, orderbook, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - assert.Equal(t, totalPrice, sdk.NewDec(980)) - assert.Equal(t, totalExecuted, sdk.NewDec(10)) - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, len(longBook), 0) - assert.Equal(t, len(shortBook), 1) - assert.Equal(t, shortBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *shortBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 3, - Account: "def", - Quantity: sdk.NewDec(1), - }, { - OrderId: 4, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(settlements), 4) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(2), - ExecutionCostOrProceed: sdk.NewDec(95), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(2), - ExecutionCostOrProceed: sdk.NewDec(95), - ExpectedCostOrProceed: sdk.NewDec(90), - Account: "def", - OrderType: "Limit", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[2], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(3), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[3], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(3), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 3, - Timestamp: TestTimestamp, - Height: TestHeight, - }) -} - -func TestMatchSingleOrderFromMultipleLongBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{} - shortOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "def", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Allocations: []*types.Allocation{{ - OrderId: 2, - Account: "abc", - Quantity: sdk.NewDec(4), - }, { - OrderId: 3, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.LongBook{ - Price: sdk.NewDec(110), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(110), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 4, - Account: "abc", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - shortBook := []types.OrderBookEntry{} - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, longOrders, shortOrders) - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - outcome := exchange.MatchLimitOrders( - ctx, orderbook, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - assert.Equal(t, totalPrice, sdk.NewDec(1020)) - assert.Equal(t, totalExecuted, sdk.NewDec(10)) - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, len(longBook), 1) - assert.Equal(t, longBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *longBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 2, - Account: "abc", - Quantity: sdk.NewDec(1), - }, { - OrderId: 3, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(shortBook), 0) - assert.Equal(t, len(settlements), 4) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(2), - ExecutionCostOrProceed: sdk.NewDec(105), - ExpectedCostOrProceed: sdk.NewDec(110), - Account: "abc", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(2), - ExecutionCostOrProceed: sdk.NewDec(105), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[2], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(3), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[3], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(3), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) -} - -func TestMatchMultipleOrderFromMultipleShortBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - { - Id: 2, - Price: sdk.NewDec(104), - Quantity: sdk.NewDec(1), - Account: "jkl", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - { - Id: 3, - Price: sdk.NewDec(98), - Quantity: sdk.NewDec(2), - Account: "mno", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - shortOrders := []*types.Order{} - longBook := []types.OrderBookEntry{} - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(90), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(90), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 4, - Account: "def", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.NewDec(4), - }, { - OrderId: 6, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, longOrders, shortOrders) - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - outcome := exchange.MatchLimitOrders( - ctx, orderbook, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - assert.Equal(t, totalPrice, sdk.NewDec(1184)) - assert.Equal(t, totalExecuted, sdk.NewDec(12)) - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, len(longBook), 1) - assert.Equal(t, longBook[0].GetPrice(), sdk.NewDec(98)) - assert.Equal(t, *longBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(98), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 3, - Account: "mno", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(shortBook), 1) - assert.Equal(t, shortBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *shortBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(settlements), 6) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(97), - ExpectedCostOrProceed: sdk.NewDec(104), - Account: "jkl", - OrderType: "Limit", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(97), - ExpectedCostOrProceed: sdk.NewDec(90), - Account: "def", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[2], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(95), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[3], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(95), - ExpectedCostOrProceed: sdk.NewDec(90), - Account: "def", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[4], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(4), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[5], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(4), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) -} - -func TestMatchMultipleOrderFromMultipleLongBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{} - shortOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - { - Id: 2, - Price: sdk.NewDec(96), - Quantity: sdk.NewDec(1), - Account: "jkl", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - { - Id: 3, - Price: sdk.NewDec(102), - Quantity: sdk.NewDec(2), - Account: "mno", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - }, - } - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Allocations: []*types.Allocation{{ - OrderId: 4, - Account: "abc", - Quantity: sdk.NewDec(4), - }, { - OrderId: 5, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.LongBook{ - Price: sdk.NewDec(110), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(110), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "abc", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - shortBook := []types.OrderBookEntry{} - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - exchange.AddOutstandingLimitOrdersToOrderbook(ctx, dexkeeper, longOrders, shortOrders) - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - outcome := exchange.MatchLimitOrders( - ctx, orderbook, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - minPrice := outcome.MinPrice - maxPrice := outcome.MaxPrice - assert.Equal(t, totalPrice, sdk.NewDec(1216)) - assert.Equal(t, totalExecuted, sdk.NewDec(12)) - assert.Equal(t, minPrice, sdk.NewDec(96)) - assert.Equal(t, maxPrice, sdk.NewDec(110)) - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, len(longBook), 1) - assert.Equal(t, longBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *longBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(shortBook), 1) - assert.Equal(t, shortBook[0].GetPrice(), sdk.NewDec(102)) - assert.Equal(t, *shortBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(102), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 3, - Account: "mno", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(settlements), 6) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(103), - ExpectedCostOrProceed: sdk.NewDec(110), - Account: "abc", - OrderType: "Limit", - OrderId: 6, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(103), - ExpectedCostOrProceed: sdk.NewDec(96), - Account: "jkl", - OrderType: "Limit", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[2], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(105), - ExpectedCostOrProceed: sdk.NewDec(110), - Account: "abc", - OrderType: "Limit", - OrderId: 6, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[3], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(105), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[4], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(4), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[5], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(4), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) -} diff --git a/x/dex/exchange/market_order.go b/x/dex/exchange/market_order.go deleted file mode 100644 index c557ded25..000000000 --- a/x/dex/exchange/market_order.go +++ /dev/null @@ -1,273 +0,0 @@ -package exchange - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - cache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func MatchMarketOrders( - ctx sdk.Context, - marketOrders []*types.Order, - orderBookEntries *types.CachedSortedOrderBookEntries, - direction types.PositionDirection, - blockOrders *cache.BlockOrders, -) ExecutionOutcome { - totalExecuted, totalPrice := sdk.ZeroDec(), sdk.ZeroDec() - minPrice, maxPrice := sdk.OneDec().Neg(), sdk.OneDec().Neg() - settlements := []*types.SettlementEntry{} - allTakerSettlements := []*types.SettlementEntry{} - for _, marketOrder := range marketOrders { - switch marketOrder.OrderType { - case types.OrderType_FOKMARKETBYVALUE: - settlements, allTakerSettlements = MatchByValueFOKMarketOrder( - ctx, marketOrder, orderBookEntries, direction, &totalExecuted, &totalPrice, &minPrice, &maxPrice, settlements, allTakerSettlements, blockOrders) - case types.OrderType_FOKMARKET: - settlements, allTakerSettlements = MatchFOKMarketOrder( - ctx, marketOrder, orderBookEntries, direction, &totalExecuted, &totalPrice, &minPrice, &maxPrice, settlements, allTakerSettlements, blockOrders) - default: - settlements, allTakerSettlements = MatchMarketOrder( - ctx, marketOrder, orderBookEntries, direction, &totalExecuted, &totalPrice, &minPrice, &maxPrice, settlements, allTakerSettlements, blockOrders) - } - } - - if totalExecuted.IsPositive() { - clearingPrice := totalPrice.Quo(totalExecuted) - for _, settlement := range allTakerSettlements { - settlement.ExecutionCostOrProceed = clearingPrice - } - minPrice, maxPrice = clearingPrice, clearingPrice - settlements = append(settlements, allTakerSettlements...) - } - return ExecutionOutcome{ - TotalNotional: totalPrice, - TotalQuantity: totalExecuted, - Settlements: settlements, - MinPrice: minPrice, - MaxPrice: maxPrice, - } -} - -func MatchMarketOrder( - ctx sdk.Context, - marketOrder *types.Order, - orderBookEntries *types.CachedSortedOrderBookEntries, - direction types.PositionDirection, - totalExecuted *sdk.Dec, - totalPrice *sdk.Dec, - minPrice *sdk.Dec, - maxPrice *sdk.Dec, - settlements []*types.SettlementEntry, - allTakerSettlements []*types.SettlementEntry, - blockOrders *cache.BlockOrders, -) ([]*types.SettlementEntry, []*types.SettlementEntry) { - remainingQuantity := marketOrder.Quantity - for entry := orderBookEntries.Next(ctx); entry != nil; entry = orderBookEntries.Next(ctx) { - // If price is zero, it means the order sender - // doesn't want to specify a worst price, so - // we don't need to perform price check for such orders - if !marketOrder.Price.IsZero() { - // Check if worst price can be matched against order book - if (direction == types.PositionDirection_LONG && marketOrder.Price.LT(entry.GetPrice())) || - (direction == types.PositionDirection_SHORT && marketOrder.Price.GT(entry.GetPrice())) { - break - } - } - var executed sdk.Dec - if remainingQuantity.LTE(entry.GetOrderEntry().Quantity) { - executed = remainingQuantity - } else { - executed = entry.GetOrderEntry().Quantity - } - remainingQuantity = remainingQuantity.Sub(executed) - *totalExecuted = totalExecuted.Add(executed) - *totalPrice = totalPrice.Add( - executed.Mul(entry.GetPrice()), - ) - if minPrice.IsNegative() || minPrice.GT(entry.GetPrice()) { - *minPrice = entry.GetPrice() - } - *maxPrice = sdk.MaxDec(*maxPrice, entry.GetPrice()) - - takerSettlements, makerSettlements := Settle( - ctx, - marketOrder, - executed, - orderBookEntries, - marketOrder.Price, - entry.GetPrice(), - ) - // update the status of order in the memState - UpdateOrderData(marketOrder, executed, blockOrders) - settlements = append(settlements, makerSettlements...) - // taker settlements' clearing price will need to be adjusted after all market order executions finish - allTakerSettlements = append(allTakerSettlements, takerSettlements...) - if remainingQuantity.IsZero() { - break - } - } - - orderBookEntries.Flush(ctx) - - return settlements, allTakerSettlements -} - -func MatchFOKMarketOrder( - ctx sdk.Context, - marketOrder *types.Order, - orderBookEntries *types.CachedSortedOrderBookEntries, - direction types.PositionDirection, - totalExecuted *sdk.Dec, - totalPrice *sdk.Dec, - minPrice *sdk.Dec, - maxPrice *sdk.Dec, - settlements []*types.SettlementEntry, - allTakerSettlements []*types.SettlementEntry, - blockOrders *cache.BlockOrders, -) ([]*types.SettlementEntry, []*types.SettlementEntry) { - // check if there is enough liquidity for fill-or-kill market order, if not skip them - remainingQuantity := marketOrder.Quantity - newSettlements, newTakerSettlements := []*types.SettlementEntry{}, []*types.SettlementEntry{} - orders, executedQuantities, entryPrices := []*types.Order{}, []sdk.Dec{}, []sdk.Dec{} - for entry := orderBookEntries.Next(ctx); entry != nil; entry = orderBookEntries.Next(ctx) { - if !marketOrder.Price.IsZero() { - if (direction == types.PositionDirection_LONG && marketOrder.Price.LT(entry.GetPrice())) || - (direction == types.PositionDirection_SHORT && marketOrder.Price.GT(entry.GetPrice())) { - break - } - } - - var executed sdk.Dec - if remainingQuantity.LTE(entry.GetOrderEntry().Quantity) { - executed = remainingQuantity - } else { - executed = entry.GetOrderEntry().Quantity - } - remainingQuantity = remainingQuantity.Sub(executed) - - takerSettlements, makerSettlements := Settle( - ctx, - marketOrder, - executed, - orderBookEntries, - marketOrder.Price, - entry.GetPrice(), - ) - newSettlements = append(newSettlements, makerSettlements...) - newTakerSettlements = append(newTakerSettlements, takerSettlements...) - orders = append(orders, marketOrder) - executedQuantities = append(executedQuantities, executed) - entryPrices = append(entryPrices, entry.GetPrice()) - - if remainingQuantity.IsZero() { - break - } - } - - if remainingQuantity.IsZero() { - orderBookEntries.Flush(ctx) - settlements = append(settlements, newSettlements...) - allTakerSettlements = append(allTakerSettlements, newTakerSettlements...) - for i, order := range orders { - UpdateOrderData(order, executedQuantities[i], blockOrders) - *totalExecuted = totalExecuted.Add(executedQuantities[i]) - *totalPrice = totalPrice.Add( - executedQuantities[i].Mul(entryPrices[i]), - ) - if minPrice.IsNegative() || minPrice.GT(entryPrices[i]) { - *minPrice = entryPrices[i] - } - *maxPrice = sdk.MaxDec(*maxPrice, entryPrices[i]) - } - } else { - orderBookEntries.Refresh(ctx) - } - - return settlements, allTakerSettlements -} - -func MatchByValueFOKMarketOrder( - ctx sdk.Context, - marketOrder *types.Order, - orderBookEntries *types.CachedSortedOrderBookEntries, - direction types.PositionDirection, - totalExecuted *sdk.Dec, - totalPrice *sdk.Dec, - minPrice *sdk.Dec, - maxPrice *sdk.Dec, - settlements []*types.SettlementEntry, - allTakerSettlements []*types.SettlementEntry, - blockOrders *cache.BlockOrders, -) ([]*types.SettlementEntry, []*types.SettlementEntry) { - remainingFund := marketOrder.Nominal - remainingQuantity := marketOrder.Quantity - newSettlements, newTakerSettlements := []*types.SettlementEntry{}, []*types.SettlementEntry{} - orders, executedQuantities, entryPrices := []*types.Order{}, []sdk.Dec{}, []sdk.Dec{} - for entry := orderBookEntries.Next(ctx); entry != nil; entry = orderBookEntries.Next(ctx) { - if !marketOrder.Price.IsZero() { - if (direction == types.PositionDirection_LONG && marketOrder.Price.LT(entry.GetPrice())) || - (direction == types.PositionDirection_SHORT && marketOrder.Price.GT(entry.GetPrice())) { - break - } - } - var executed sdk.Dec - if remainingFund.LTE(entry.GetOrderEntry().Quantity.Mul(entry.GetPrice())) { - executed = remainingFund.Quo(entry.GetPrice()) - remainingFund = sdk.ZeroDec() - } else { - executed = entry.GetOrderEntry().Quantity - remainingFund = remainingFund.Sub(executed.Mul(entry.GetPrice())) - } - remainingQuantity = remainingQuantity.Sub(executed) - - takerSettlements, makerSettlements := Settle( - ctx, - marketOrder, - executed, - orderBookEntries, - marketOrder.Price, - entry.GetPrice(), - ) - newSettlements = append(newSettlements, makerSettlements...) - newTakerSettlements = MergeByNominalTakerSettlements(append(newTakerSettlements, takerSettlements...)) - orders = append(orders, marketOrder) - executedQuantities = append(executedQuantities, executed) - entryPrices = append(entryPrices, entry.GetPrice()) - if remainingFund.IsZero() || remainingQuantity.LTE(sdk.ZeroDec()) { - break - } - } - - // settle orders only when all fund are used - if remainingFund.IsZero() && remainingQuantity.GTE(sdk.ZeroDec()) { - orderBookEntries.Flush(ctx) - settlements = append(settlements, newSettlements...) - allTakerSettlements = append(allTakerSettlements, newTakerSettlements...) - for i, order := range orders { - UpdateOrderData(order, executedQuantities[i], blockOrders) - *totalExecuted = totalExecuted.Add(executedQuantities[i]) - *totalPrice = totalPrice.Add( - executedQuantities[i].Mul(entryPrices[i]), - ) - if minPrice.IsNegative() || minPrice.GT(entryPrices[i]) { - *minPrice = entryPrices[i] - } - *maxPrice = sdk.MaxDec(*maxPrice, entryPrices[i]) - } - } else { - orderBookEntries.Refresh(ctx) - } - - return settlements, allTakerSettlements -} - -func MergeByNominalTakerSettlements(settlements []*types.SettlementEntry) []*types.SettlementEntry { - aggregatedSettlement := types.SettlementEntry{Quantity: sdk.ZeroDec()} - for _, settlement := range settlements { - quantity := settlement.Quantity.Add(aggregatedSettlement.Quantity) - aggregatedSettlement = *settlement - aggregatedSettlement.Quantity = quantity - } - - return []*types.SettlementEntry{&aggregatedSettlement} -} diff --git a/x/dex/exchange/market_order_fuzz_test.go b/x/dex/exchange/market_order_fuzz_test.go deleted file mode 100644 index 2cc64f446..000000000 --- a/x/dex/exchange/market_order_fuzz_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package exchange_test - -import ( - "sort" - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/testutil/fuzzing" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - keeperutil "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -var TestFuzzMarketCtx = sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) - -func FuzzMatchMarketOrders(f *testing.F) { - f.Fuzz(fuzzTargetMatchMarketOrders) -} - -func fuzzTargetMatchMarketOrders( - t *testing.T, - takerLong bool, - orderSorted bool, - orderbookSorted bool, - prices []byte, - quantities []byte, - entryWeights []byte, - accountIndices []byte, - allocationWeights []byte, -) { - dexkeeper, TestFuzzMarketCtx := keepertest.DexKeeper(t) - TestFuzzMarketCtx = TestFuzzMarketCtx.WithBlockHeight(1).WithBlockTime(time.Now()) - blockOrders := dexutils.GetMemState(TestFuzzMarketCtx.Context()).GetBlockOrders(TestFuzzMarketCtx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := fuzzing.GetOrderBookEntries(!takerLong, keepertest.TestPriceDenom, keepertest.TestAssetDenom, entryWeights, accountIndices, allocationWeights) - for _, entry := range entries { - if takerLong { - dexkeeper.SetShortOrderBookEntry(TestFuzzMarketCtx, keepertest.TestContract, entry) - } else { - dexkeeper.SetLongOrderBookEntry(TestFuzzMarketCtx, keepertest.TestContract, entry) - } - } - var direction types.PositionDirection - if takerLong { - direction = types.PositionDirection_LONG - } else { - direction = types.PositionDirection_SHORT - } - orders := fuzzing.GetPlacedOrders(direction, types.OrderType_MARKET, keepertest.TestPair, prices, quantities) - for _, order := range orders { - blockOrders.Add(order) - } - - if orderSorted { - sort.Slice(orders, func(i, j int) bool { - // a price of 0 indicates that there is no worst price for the order, so it should - // always be ranked at the top. - if orders[i].Price.IsZero() { - return true - } else if orders[j].Price.IsZero() { - return false - } - switch direction { - case types.PositionDirection_LONG: - return orders[i].Price.GT(orders[j].Price) - case types.PositionDirection_SHORT: - return orders[i].Price.LT(orders[j].Price) - default: - panic("Unknown direction") - } - }) - } - if orderbookSorted { - sort.Slice(entries, func(i, j int) bool { - return entries[i].GetPrice().LT(entries[j].GetPrice()) - }) - } - - require.NotPanics(t, func() { - orderbook := keeperutil.PopulateOrderbook(TestFuzzMarketCtx, dexkeeper, types.ContractAddress(keepertest.TestContract), types.Pair{PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}) - book := orderbook.Longs - if takerLong { - book = orderbook.Shorts - } - exchange.MatchMarketOrders(TestFuzzMarketCtx, orders, book, direction, blockOrders) - }) -} diff --git a/x/dex/exchange/market_order_test.go b/x/dex/exchange/market_order_test.go deleted file mode 100644 index 86339654b..000000000 --- a/x/dex/exchange/market_order_test.go +++ /dev/null @@ -1,1175 +0,0 @@ -package exchange_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - dex "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - keeperutil "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/assert" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" -) - -const ( - TestTimestamp uint64 = 10000 - TestHeight uint64 = 1 -) - -func TestMatchFoKMarketOrderFromShortBookNotEnoughLiquidity(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_FOKMARKET, - }, - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(4), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.NewDec(4), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(&types.Order{ - Id: 1, - Account: "abc", - ContractAddr: "test", - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_FOKMARKET, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }) - - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Shorts - outcome := exchange.MatchMarketOrders( - ctx, longOrders, entries, types.PositionDirection_LONG, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.ZeroDec()) - assert.Equal(t, totalExecuted, sdk.ZeroDec()) - assert.Equal(t, len(shortBook), 1) - assert.Equal(t, shortBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, shortBook[0].GetOrderEntry().Quantity, sdk.NewDec(4)) - assert.Equal(t, len(settlements), 0) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.NewDec(5)) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_PLACED) -} - -func TestMatchFoKMarketOrderFromShortBookHappyPath(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_FOKMARKET, - }, - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Shorts - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(&types.Order{ - Id: 1, - Account: "abc", - ContractAddr: "test", - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_FOKMARKET, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }) - outcome := exchange.MatchMarketOrders( - ctx, longOrders, entries, types.PositionDirection_LONG, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.NewDec(500)) - assert.Equal(t, totalExecuted, sdk.NewDec(5)) - assert.Equal(t, len(shortBook), 0) - assert.Equal(t, len(settlements), 2) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Fokmarket", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_FULFILLED) -} - -func TestMatchByValueFOKMarketOrderFromShortBookNotEnoughLiquidity(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_FOKMARKETBYVALUE, - Nominal: sdk.NewDec(500), - }, - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(90), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(90), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 4, - Account: "def", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.MustNewDecFromStr("0.4"), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.MustNewDecFromStr("0.4"), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(longOrders[0]) - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Shorts - outcome := exchange.MatchMarketOrders( - ctx, longOrders, entries, types.PositionDirection_LONG, &dex.BlockOrders{}, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.ZeroDec()) - assert.Equal(t, totalExecuted, sdk.ZeroDec()) - assert.Equal(t, len(shortBook), 2) - assert.Equal(t, shortBook[0].GetPrice(), sdk.NewDec(90)) - assert.Equal(t, shortBook[0].GetOrderEntry().Price, sdk.NewDec(90)) - assert.Equal(t, shortBook[0].GetOrderEntry().Quantity, sdk.NewDec(5)) - assert.Equal(t, len(settlements), 0) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.NewDec(5)) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_PLACED) -} - -func TestMatchByValueFOKMarketOrderFromShortBookHappyPath(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_FOKMARKETBYVALUE, - Nominal: sdk.NewDec(500), - }, - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(90), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(90), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 4, - Account: "def", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.MustNewDecFromStr("0.6"), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.MustNewDecFromStr("0.6"), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(longOrders[0]) - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Shorts - outcome := exchange.MatchMarketOrders( - ctx, longOrders, entries, types.PositionDirection_LONG, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.NewDec(500)) - assert.Equal(t, totalExecuted, sdk.MustNewDecFromStr("5.5")) - assert.Equal(t, len(shortBook), 1) - assert.Equal(t, len(settlements), 3) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(90), - ExpectedCostOrProceed: sdk.NewDec(90), - Account: "def", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.MustNewDecFromStr("0.5"), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.MustNewDecFromStr("0.5")) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_FULFILLED) -} - -func TestMatchSingleMarketOrderFromShortBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(longOrders[0]) - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Shorts - outcome := exchange.MatchMarketOrders( - ctx, longOrders, entries, types.PositionDirection_LONG, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.NewDec(500)) - assert.Equal(t, totalExecuted, sdk.NewDec(5)) - assert.Equal(t, len(shortBook), 0) - assert.Equal(t, len(settlements), 2) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Market", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_FULFILLED) -} - -func TestMatchSingleMarketOrderFromLongBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - shortOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - } - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.NewDec(5), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(shortOrders[0]) - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Longs - outcome := exchange.MatchMarketOrders( - ctx, shortOrders, entries, types.PositionDirection_SHORT, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.NewDec(500)) - assert.Equal(t, totalExecuted, sdk.NewDec(5)) - assert.Equal(t, len(longBook), 0) - assert.Equal(t, len(settlements), 2) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(5), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Market", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_FULFILLED) -} - -func TestMatchSingleMarketOrderFromMultipleShortBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(90), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(90), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "def", - Quantity: sdk.NewDec(4), - }, { - OrderId: 7, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(longOrders[0]) - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Shorts - outcome := exchange.MatchMarketOrders( - ctx, longOrders, entries, types.PositionDirection_LONG, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.NewDec(480)) - assert.Equal(t, totalExecuted, sdk.NewDec(5)) - assert.Equal(t, len(shortBook), 1) - assert.Equal(t, shortBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *shortBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "def", - Quantity: sdk.NewDec(1), - }, { - OrderId: 7, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(settlements), 4) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(2), - ExecutionCostOrProceed: sdk.NewDec(90), - ExpectedCostOrProceed: sdk.NewDec(90), - Account: "def", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(3), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 6, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[2], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(2), - ExecutionCostOrProceed: sdk.NewDec(96), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Market", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[3], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(3), - ExecutionCostOrProceed: sdk.NewDec(96), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Market", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_FULFILLED) -} - -func TestMatchSingleMarketOrderFromMultipleLongBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - shortOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "def", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - } - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "abc", - Quantity: sdk.NewDec(4), - }, { - OrderId: 7, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.LongBook{ - Price: sdk.NewDec(110), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(110), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "abc", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(shortOrders[0]) - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Longs - outcome := exchange.MatchMarketOrders( - ctx, shortOrders, entries, types.PositionDirection_SHORT, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.NewDec(520)) - assert.Equal(t, totalExecuted, sdk.NewDec(5)) - assert.Equal(t, len(longBook), 1) - assert.Equal(t, longBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *longBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(3), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "abc", - Quantity: sdk.NewDec(1), - }, { - OrderId: 7, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(settlements), 4) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(2), - ExecutionCostOrProceed: sdk.NewDec(110), - ExpectedCostOrProceed: sdk.NewDec(110), - Account: "abc", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(3), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 6, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[2], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(2), - ExecutionCostOrProceed: sdk.NewDec(104), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Market", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[3], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(3), - ExecutionCostOrProceed: sdk.NewDec(104), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Market", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_FULFILLED) -} - -func TestMatchMultipleMarketOrderFromMultipleShortBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - longOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(104), - Quantity: sdk.NewDec(1), - Account: "jkl", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - { - Id: 2, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - { - Id: 3, - Price: sdk.NewDec(98), - Quantity: sdk.NewDec(2), - Account: "mno", - PositionDirection: types.PositionDirection_LONG, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - } - shortBook := []types.OrderBookEntry{ - &types.ShortBook{ - Price: sdk.NewDec(90), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(90), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 4, - Account: "def", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.ShortBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "def", - Quantity: sdk.NewDec(4), - }, { - OrderId: 6, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(longOrders[0]) - blockOrders.Add(longOrders[1]) - blockOrders.Add(longOrders[2]) - for _, e := range shortBook { - dexkeeper.SetShortOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Shorts - outcome := exchange.MatchMarketOrders( - ctx, longOrders, entries, types.PositionDirection_LONG, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - - shortBook = dexkeeper.GetAllShortBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.NewDec(580)) - assert.Equal(t, totalExecuted, sdk.NewDec(6)) - assert.Equal(t, len(shortBook), 1) - assert.Equal(t, shortBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *shortBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(settlements), 6) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(90), - ExpectedCostOrProceed: sdk.NewDec(90), - Account: "def", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(90), - ExpectedCostOrProceed: sdk.NewDec(90), - Account: "def", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[2], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(4), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "def", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[3], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.MustNewDecFromStr("96.666666666666666667"), - ExpectedCostOrProceed: sdk.NewDec(104), - Account: "jkl", - OrderType: "Market", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[4], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.MustNewDecFromStr("96.666666666666666667"), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Market", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[5], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(4), - ExecutionCostOrProceed: sdk.MustNewDecFromStr("96.666666666666666667"), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Market", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_FULFILLED) - assert.Equal(t, blockOrders.Get()[1].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[1].Status, types.OrderStatus_FULFILLED) - assert.Equal(t, blockOrders.Get()[2].Quantity, sdk.NewDec(2)) - assert.Equal(t, blockOrders.Get()[2].Status, types.OrderStatus_PLACED) -} - -func TestMatchMultipleMarketOrderFromMultipleLongBook(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(int64(TestHeight)).WithBlockTime(time.Unix(int64(TestTimestamp), 0)) - shortOrders := []*types.Order{ - { - Id: 1, - Price: sdk.NewDec(96), - Quantity: sdk.NewDec(1), - Account: "jkl", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - { - Id: 2, - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(5), - Account: "abc", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - { - Id: 3, - Price: sdk.NewDec(102), - Quantity: sdk.NewDec(2), - Account: "mno", - PositionDirection: types.PositionDirection_SHORT, - ContractAddr: "test", - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_MARKET, - }, - } - longBook := []types.OrderBookEntry{ - &types.LongBook{ - Price: sdk.NewDec(100), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(6), - Allocations: []*types.Allocation{{ - OrderId: 5, - Account: "abc", - Quantity: sdk.NewDec(4), - }, { - OrderId: 6, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - &types.LongBook{ - Price: sdk.NewDec(110), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(110), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 4, - Account: "abc", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - } - blockOrders := dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, "testAccount", types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - blockOrders.Add(shortOrders[0]) - blockOrders.Add(shortOrders[1]) - blockOrders.Add(shortOrders[2]) - for _, e := range longBook { - dexkeeper.SetLongOrderBookEntry(ctx, "test", e) - } - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress("test"), types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"}) - entries := orderbook.Longs - outcome := exchange.MatchMarketOrders( - ctx, shortOrders, entries, types.PositionDirection_SHORT, blockOrders, - ) - totalPrice := outcome.TotalNotional - totalExecuted := outcome.TotalQuantity - settlements := outcome.Settlements - minPrice := outcome.MinPrice - maxPrice := outcome.MaxPrice - - longBook = dexkeeper.GetAllLongBookForPair(ctx, "test", "USDC", "ATOM") - assert.Equal(t, totalPrice, sdk.NewDec(620)) - assert.Equal(t, totalExecuted, sdk.NewDec(6)) - assert.Equal(t, minPrice, sdk.MustNewDecFromStr("103.333333333333333333")) - assert.Equal(t, maxPrice, sdk.MustNewDecFromStr("103.333333333333333333")) - assert.Equal(t, len(longBook), 1) - assert.Equal(t, longBook[0].GetPrice(), sdk.NewDec(100)) - assert.Equal(t, *longBook[0].GetOrderEntry(), types.OrderEntry{ - Price: sdk.NewDec(100), - Quantity: sdk.NewDec(2), - Allocations: []*types.Allocation{{ - OrderId: 6, - Account: "ghi", - Quantity: sdk.NewDec(2), - }}, - PriceDenom: "USDC", - AssetDenom: "ATOM", - }) - assert.Equal(t, len(settlements), 6) - assert.Equal(t, *settlements[0], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(110), - ExpectedCostOrProceed: sdk.NewDec(110), - Account: "abc", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[1], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.NewDec(110), - ExpectedCostOrProceed: sdk.NewDec(110), - Account: "abc", - OrderType: "Limit", - OrderId: 4, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[2], types.SettlementEntry{ - PositionDirection: "Long", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(4), - ExecutionCostOrProceed: sdk.NewDec(100), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Limit", - OrderId: 5, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[3], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.MustNewDecFromStr("103.333333333333333333"), - ExpectedCostOrProceed: sdk.NewDec(96), - Account: "jkl", - OrderType: "Market", - OrderId: 1, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[4], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(1), - ExecutionCostOrProceed: sdk.MustNewDecFromStr("103.333333333333333333"), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Market", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, *settlements[5], types.SettlementEntry{ - PositionDirection: "Short", - PriceDenom: "USDC", - AssetDenom: "ATOM", - Quantity: sdk.NewDec(4), - ExecutionCostOrProceed: sdk.MustNewDecFromStr("103.333333333333333333"), - ExpectedCostOrProceed: sdk.NewDec(100), - Account: "abc", - OrderType: "Market", - OrderId: 2, - Timestamp: TestTimestamp, - Height: TestHeight, - }) - assert.Equal(t, blockOrders.Get()[0].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[0].Status, types.OrderStatus_FULFILLED) - assert.Equal(t, blockOrders.Get()[1].Quantity, sdk.ZeroDec()) - assert.Equal(t, blockOrders.Get()[1].Status, types.OrderStatus_FULFILLED) - assert.Equal(t, blockOrders.Get()[2].Quantity, sdk.NewDec(2)) - assert.Equal(t, blockOrders.Get()[2].Status, types.OrderStatus_PLACED) -} diff --git a/x/dex/exchange/settlement.go b/x/dex/exchange/settlement.go deleted file mode 100644 index fe049808e..000000000 --- a/x/dex/exchange/settlement.go +++ /dev/null @@ -1,129 +0,0 @@ -package exchange - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - cache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// this function helps to settle market orders -func Settle( - ctx sdk.Context, - takerOrder *types.Order, - quantityTaken sdk.Dec, - orderbook *types.CachedSortedOrderBookEntries, - worstPrice sdk.Dec, - makerPrice sdk.Dec, -) ([]*types.SettlementEntry, []*types.SettlementEntry) { - // settlement of one liquidity taker's order is allocated on a FIFO basis - takerSettlements := []*types.SettlementEntry{} - makerSettlements := []*types.SettlementEntry{} - if quantityTaken.IsZero() { - return takerSettlements, makerSettlements - } - newToSettle, _ := orderbook.SettleQuantity(ctx, quantityTaken) - for _, toSettle := range newToSettle { - takerSettlements = append(takerSettlements, types.NewSettlementEntry( - ctx, - takerOrder.Id, - takerOrder.Account, - takerOrder.PositionDirection, - takerOrder.PriceDenom, - takerOrder.AssetDenom, - toSettle.Amount, - worstPrice, - worstPrice, - takerOrder.OrderType, - )) - makerSettlements = append(makerSettlements, types.NewSettlementEntry( - ctx, - toSettle.OrderID, - toSettle.Account, - types.OppositePositionDirection[takerOrder.PositionDirection], - takerOrder.PriceDenom, - takerOrder.AssetDenom, - toSettle.Amount, - makerPrice, - makerPrice, - types.OrderType_LIMIT, - )) - } - - return takerSettlements, makerSettlements -} - -// this function update the order data in the memState -// to be noted that the order status will only reflect for market orders that are settled -func UpdateOrderData( - takerOrder *types.Order, - quantityTaken sdk.Dec, - blockOrders *cache.BlockOrders, -) { - // update order data in the memstate - orderStored := blockOrders.GetByID(takerOrder.Id) - orderStored.Quantity = orderStored.Quantity.Sub(quantityTaken) - if orderStored.OrderType == types.OrderType_FOKMARKET || orderStored.OrderType == types.OrderType_FOKMARKETBYVALUE || orderStored.Quantity.IsZero() { - orderStored.Status = types.OrderStatus_FULFILLED - } - blockOrders.Add(orderStored) -} - -func SettleFromBook( - ctx sdk.Context, - orderbook *types.OrderBook, - executedQuantity sdk.Dec, - longPrice sdk.Dec, - shortPrice sdk.Dec, -) []*types.SettlementEntry { - // settlement from within the order book is also allocated on a FIFO basis - settlements := []*types.SettlementEntry{} - if executedQuantity.IsZero() { - return settlements - } - newLongToSettle, _ := orderbook.Longs.SettleQuantity(ctx, executedQuantity) - newShortToSettle, _ := orderbook.Shorts.SettleQuantity(ctx, executedQuantity) - avgPrice := longPrice.Add(shortPrice).Quo(sdk.NewDec(2)) - longPtr, shortPtr := 0, 0 - for longPtr < len(newLongToSettle) && shortPtr < len(newShortToSettle) { - longToSettle := newLongToSettle[longPtr] - shortToSettle := newShortToSettle[shortPtr] - var quantity sdk.Dec - if longToSettle.Amount.LT(shortToSettle.Amount) { - quantity = longToSettle.Amount - } else { - quantity = shortToSettle.Amount - } - settlements = append(settlements, types.NewSettlementEntry( - ctx, - longToSettle.OrderID, - longToSettle.Account, - types.PositionDirection_LONG, - orderbook.Pair.PriceDenom, - orderbook.Pair.AssetDenom, - quantity, - avgPrice, - longPrice, - types.OrderType_LIMIT, - ), types.NewSettlementEntry( - ctx, - shortToSettle.OrderID, - shortToSettle.Account, - types.PositionDirection_SHORT, - orderbook.Pair.PriceDenom, - orderbook.Pair.AssetDenom, - quantity, - avgPrice, - shortPrice, - types.OrderType_LIMIT, - )) - newLongToSettle[longPtr] = types.ToSettle{Account: longToSettle.Account, Amount: longToSettle.Amount.Sub(quantity), OrderID: longToSettle.OrderID} - newShortToSettle[shortPtr] = types.ToSettle{Account: shortToSettle.Account, Amount: shortToSettle.Amount.Sub(quantity), OrderID: shortToSettle.OrderID} - if newLongToSettle[longPtr].Amount.IsZero() { - longPtr++ - } - if newShortToSettle[shortPtr].Amount.IsZero() { - shortPtr++ - } - } - return settlements -} diff --git a/x/dex/exchange/settlement_fuzz_test.go b/x/dex/exchange/settlement_fuzz_test.go deleted file mode 100644 index afa1df5fb..000000000 --- a/x/dex/exchange/settlement_fuzz_test.go +++ /dev/null @@ -1,118 +0,0 @@ -package exchange_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/testutil/fuzzing" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - keeperutil "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -var TestFuzzSettleCtx = sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) - -func FuzzSettleMarketOrder(f *testing.F) { - TestFuzzSettleCtx = TestFuzzSettleCtx.WithBlockHeight(1).WithBlockTime(time.Now()) - f.Fuzz(fuzzTargetMatchMarketOrders) -} - -func fuzzTargetSettle( - t *testing.T, - long bool, - prices []byte, - quantities []byte, - entryWeights []byte, - accountIndices []byte, - allocationWeights []byte, - priceI int64, - priceIsNil bool, - quantityI int64, - quantityIsNil bool, -) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(1).WithBlockTime(time.Now()) - entries := fuzzing.GetOrderBookEntries(!long, keepertest.TestPriceDenom, keepertest.TestAssetDenom, entryWeights, accountIndices, allocationWeights) - for _, entry := range entries { - if long { - dexkeeper.SetShortOrderBookEntry(ctx, keepertest.TestContract, entry) - } else { - dexkeeper.SetLongOrderBookEntry(ctx, keepertest.TestContract, entry) - } - } - var direction types.PositionDirection - if long { - direction = types.PositionDirection_LONG - } else { - direction = types.PositionDirection_SHORT - } - orders := fuzzing.GetPlacedOrders(direction, types.OrderType_MARKET, keepertest.TestPair, prices, quantities) - - price := fuzzing.FuzzDec(priceI, priceIsNil) - quantity := fuzzing.FuzzDec(quantityI, quantityIsNil) - - if len(entries) > len(orders) { - entries = entries[:len(orders)] - } else { - orders = orders[:len(entries)] - } - - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress(keepertest.TestContract), types.Pair{PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}) - book := orderbook.Longs - if long { - book = orderbook.Shorts - } - for i, entry := range entries { - require.NotPanics(t, func() { - exchange.Settle(ctx, orders[i], quantity, book, price, entry.GetPrice()) - }) - } -} - -func FuzzSettleLimitOrder(f *testing.F) { - TestFuzzSettleCtx = TestFuzzSettleCtx.WithBlockHeight(1).WithBlockTime(time.Now()) - f.Fuzz(fuzzTargetMatchMarketOrders) -} - -func fuzzTargetSettleFromBook( - t *testing.T, - buyEntryWeights []byte, - sellEntryWeights []byte, - buyAccountIndices []byte, - sellAccountIndices []byte, - buyAllocationWeights []byte, - sellAllocationWeights []byte, - quantityI int64, - quantityIsNil bool, -) { - dexkeeper, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(1).WithBlockTime(time.Now()) - buyEntries := fuzzing.GetOrderBookEntries(true, keepertest.TestPriceDenom, keepertest.TestAssetDenom, buyEntryWeights, buyAccountIndices, buyAllocationWeights) - for _, entry := range buyEntries { - dexkeeper.SetLongOrderBookEntry(ctx, keepertest.TestContract, entry) - } - sellEntries := fuzzing.GetOrderBookEntries(false, keepertest.TestPriceDenom, keepertest.TestAssetDenom, sellEntryWeights, sellAccountIndices, sellAllocationWeights) - for _, entry := range sellEntries { - dexkeeper.SetShortOrderBookEntry(ctx, keepertest.TestContract, entry) - } - - quantity := fuzzing.FuzzDec(quantityI, quantityIsNil) - - if len(buyEntries) > len(sellEntries) { - buyEntries = buyEntries[:len(sellEntries)] - } else { - sellEntries = sellEntries[:len(buyEntries)] - } - - orderbook := keeperutil.PopulateOrderbook(ctx, dexkeeper, types.ContractAddress(keepertest.TestContract), types.Pair{PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}) - for i, longEntry := range buyEntries { - require.NotPanics(t, func() { - exchange.SettleFromBook(ctx, orderbook, quantity, longEntry.GetPrice(), sellEntries[i].GetPrice()) - }) - } -} diff --git a/x/dex/genesis.go b/x/dex/genesis.go deleted file mode 100644 index d5ef5c729..000000000 --- a/x/dex/genesis.go +++ /dev/null @@ -1,85 +0,0 @@ -package dex - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// InitGenesis initializes the dex module's state from a provided genesis -// state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - k.CreateModuleAccount(ctx) - - // Set all the longBook - for _, contractState := range genState.ContractState { - - contractInfo := contractState.ContractInfo - err := k.SetContract(ctx, &contractInfo) - if err != nil { - panic(err) - } - - for _, elem := range contractState.PairList { - k.AddRegisteredPair(ctx, contractState.ContractInfo.ContractAddr, elem) - } - - for _, elem := range contractState.LongBookList { - k.SetLongBook(ctx, contractState.ContractInfo.ContractAddr, elem) - } - - for _, elem := range contractState.ShortBookList { - k.SetShortBook(ctx, contractState.ContractInfo.ContractAddr, elem) - } - - for _, elem := range contractState.PriceList { - for _, priceElem := range elem.Prices { - k.SetPriceState(ctx, *priceElem, contractState.ContractInfo.ContractAddr) - } - } - - k.SetNextOrderID(ctx, contractState.ContractInfo.ContractAddr, contractState.NextOrderId) - - } - - // this line is used by starport scaffolding # genesis/module/init - k.SetParams(ctx, genState.Params) - - k.SetEpoch(ctx, genState.LastEpoch) -} - -// ExportGenesis returns the dex module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) - - allContractInfo := k.GetAllContractInfo(ctx) - contractStates := make([]types.ContractState, len(allContractInfo)) - for i, contractInfo := range allContractInfo { - contractAddr := contractInfo.ContractAddr - registeredPairs := k.GetAllRegisteredPairs(ctx, contractAddr) - // Save all price info for contract, for all its pairs - contractPrices := []types.ContractPairPrices{} - for _, elem := range registeredPairs { - pairPrices := k.GetAllPrices(ctx, contractAddr, elem) - contractPrices = append(contractPrices, types.ContractPairPrices{ - PricePair: elem, - Prices: pairPrices, - }) - } - contractStates[i] = types.ContractState{ - ContractInfo: contractInfo, - LongBookList: k.GetAllLongBook(ctx, contractAddr), - ShortBookList: k.GetAllShortBook(ctx, contractAddr), - PairList: registeredPairs, - PriceList: contractPrices, - NextOrderId: k.GetNextOrderID(ctx, contractAddr), - } - } - genesis.ContractState = contractStates - - _, currentEpoch := k.IsNewEpoch(ctx) - genesis.LastEpoch = currentEpoch - - return genesis -} diff --git a/x/dex/genesis_test.go b/x/dex/genesis_test.go deleted file mode 100644 index 4cbf0cf21..000000000 --- a/x/dex/genesis_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package dex_test - -import ( - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func TEST_PAIR() types.Pair { - return types.Pair{ - PriceDenom: "USDC", - AssetDenom: "ATOM", - } -} - -func TestGenesis(t *testing.T) { - contractList := []types.ContractState{} - contractDependencies := []*types.ContractDependencyInfo{ - { - Dependency: "dependency1", - }, - { - Dependency: "dependency2", - }, - } - - contractInfo := types.ContractInfoV2{ - CodeId: uint64(1), - ContractAddr: "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m", - Dependencies: contractDependencies, - } - - pairList := []types.Pair{ - { - PriceDenom: "USDC", - AssetDenom: "SEI", - PriceTicksize: &keepertest.TestTicksize, - QuantityTicksize: &keepertest.TestTicksize, - }, - } - - priceList := []types.ContractPairPrices{ - { - PricePair: pairList[0], - Prices: []*types.Price{ - { - SnapshotTimestampInSeconds: 2, - Pair: &(pairList[0]), - Price: sdk.MustNewDecFromStr("101"), - }, - }, - }, - } - - contractState := types.ContractState{ - LongBookList: []types.LongBook{ - { - Price: sdk.NewDec(1), - Entry: &types.OrderEntry{ - Price: sdk.ZeroDec(), - }, - }, - }, - ShortBookList: []types.ShortBook{ - { - Price: sdk.NewDec(1), - Entry: &types.OrderEntry{ - Price: sdk.ZeroDec(), - }, - }, - }, - ContractInfo: contractInfo, - PairList: pairList, - PriceList: priceList, - NextOrderId: 10, - } - contractList = append(contractList, contractState) - - genesisState := types.GenesisState{ - Params: types.DefaultParams(), - // this line is used by starport scaffolding # genesis/test/state - ContractState: contractList, - } - - k, ctx := keepertest.DexKeeper(t) - k.SetContract(ctx, &contractInfo) - dex.InitGenesis(ctx, *k, genesisState) - got := dex.ExportGenesis(ctx, *k) - require.NotNil(t, got) - - require.ElementsMatch(t, genesisState.ContractState[0].LongBookList, got.ContractState[0].LongBookList) - require.ElementsMatch(t, genesisState.ContractState[0].ShortBookList, got.ContractState[0].ShortBookList) - require.ElementsMatch(t, genesisState.ContractState[0].PairList, got.ContractState[0].PairList) - require.Equal(t, genesisState.ContractState[0].ContractInfo.CodeId, got.ContractState[0].ContractInfo.CodeId) - require.Equal(t, genesisState.ContractState[0].ContractInfo.ContractAddr, got.ContractState[0].ContractInfo.ContractAddr) - require.ElementsMatch(t, genesisState.ContractState[0].ContractInfo.Dependencies, got.ContractState[0].ContractInfo.Dependencies) - require.ElementsMatch(t, genesisState.ContractState[0].PriceList, got.ContractState[0].PriceList) - require.Equal(t, genesisState.ContractState[0].NextOrderId, got.ContractState[0].NextOrderId) - // this line is used by starport scaffolding # genesis/test/assert -} diff --git a/x/dex/gov.go b/x/dex/gov.go deleted file mode 100644 index 62fd39283..000000000 --- a/x/dex/gov.go +++ /dev/null @@ -1,14 +0,0 @@ -package dex - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func HandleAddAssetMetadataProposal(ctx sdk.Context, k *keeper.Keeper, p *types.AddAssetMetadataProposal) error { - for _, asset := range p.AssetList { - k.SetAssetMetadata(ctx, asset) - } - return nil -} diff --git a/x/dex/handler.go b/x/dex/handler.go deleted file mode 100644 index 623062b50..000000000 --- a/x/dex/handler.go +++ /dev/null @@ -1,67 +0,0 @@ -package dex - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := msgserver.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgPlaceOrders: - res, err := msgServer.PlaceOrders(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCancelOrders: - res, err := msgServer.CancelOrders(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRegisterContract: - res, err := msgServer.RegisterContract(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRegisterPairs: - res, err := msgServer.RegisterPairs(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdatePriceTickSize: - res, err := msgServer.UpdatePriceTickSize(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdateQuantityTickSize: - res, err := msgServer.UpdateQuantityTickSize(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUnregisterContract: - res, err := msgServer.UnregisterContract(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgContractDepositRent: - res, err := msgServer.ContractDepositRent(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUnsuspendContract: - res, err := msgServer.UnsuspendContract(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) - } - } -} - -func NewProposalHandler(k keeper.Keeper) govtypes.Handler { - return func(ctx sdk.Context, content govtypes.Content) error { - switch c := content.(type) { - case *types.AddAssetMetadataProposal: - return HandleAddAssetMetadataProposal(ctx, &k, c) - default: - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized dex proposal content type: %T", c) - } - } -} diff --git a/x/dex/keeper/abci/end_block_cancel_orders.go b/x/dex/keeper/abci/end_block_cancel_orders.go deleted file mode 100644 index 8c471124c..000000000 --- a/x/dex/keeper/abci/end_block_cancel_orders.go +++ /dev/null @@ -1,45 +0,0 @@ -package abci - -import ( - "context" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "go.opentelemetry.io/otel/attribute" - otrace "go.opentelemetry.io/otel/trace" -) - -func (w KeeperWrapper) HandleEBCancelOrders(ctx context.Context, sdkCtx sdk.Context, tracer *otrace.Tracer, contractAddr string, registeredPairs []types.Pair) error { - _, span := (*tracer).Start(ctx, "SudoCancelOrders") - span.SetAttributes(attribute.String("contractAddr", contractAddr)) - - typedContractAddr := types.ContractAddress(contractAddr) - msg := w.getCancelSudoMsg(sdkCtx, typedContractAddr, registeredPairs) - if len(msg.OrderCancellations.IdsToCancel) == 0 { - return nil - } - userProvidedGas := w.GetParams(sdkCtx).DefaultGasPerCancel * uint64(len(msg.OrderCancellations.IdsToCancel)) - if _, err := utils.CallContractSudo(sdkCtx, w.Keeper, contractAddr, msg, userProvidedGas); err != nil { - sdkCtx.Logger().Error(fmt.Sprintf("Error during cancellation: %s", err.Error())) - return err - } - span.End() - return nil -} - -func (w KeeperWrapper) getCancelSudoMsg(sdkCtx sdk.Context, typedContractAddr types.ContractAddress, registeredPairs []types.Pair) types.SudoOrderCancellationMsg { - idsToCancel := []uint64{} - for _, pair := range registeredPairs { - for _, cancel := range dexutils.GetMemState(sdkCtx.Context()).GetBlockCancels(sdkCtx, typedContractAddr, pair).Get() { - idsToCancel = append(idsToCancel, cancel.Id) - } - } - return types.SudoOrderCancellationMsg{ - OrderCancellations: types.OrderCancellationMsgDetails{ - IdsToCancel: idsToCancel, - }, - } -} diff --git a/x/dex/keeper/abci/end_block_deposit.go b/x/dex/keeper/abci/end_block_deposit.go deleted file mode 100644 index c0216e482..000000000 --- a/x/dex/keeper/abci/end_block_deposit.go +++ /dev/null @@ -1,58 +0,0 @@ -package abci - -import ( - "context" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - seiutils "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "go.opentelemetry.io/otel/attribute" - otrace "go.opentelemetry.io/otel/trace" -) - -func (w KeeperWrapper) HandleEBDeposit(ctx context.Context, sdkCtx sdk.Context, tracer *otrace.Tracer, contractAddr string) error { - _, span := (*tracer).Start(ctx, "SudoDeposit") - span.SetAttributes(attribute.String("contractAddr", contractAddr)) - defer span.End() - - typedContractAddr := types.ContractAddress(contractAddr) - msg := w.GetDepositSudoMsg(sdkCtx, typedContractAddr) - if msg.IsEmpty() { - return nil - } - _, err := utils.CallContractSudo(sdkCtx, w.Keeper, contractAddr, msg, 0) // deposit - if err != nil { - sdkCtx.Logger().Error(fmt.Sprintf("Error during deposit: %s", err.Error())) - return err - } - - return nil -} - -func (w KeeperWrapper) GetDepositSudoMsg(ctx sdk.Context, typedContractAddr types.ContractAddress) types.SudoOrderPlacementMsg { - depositMemState := dexutils.GetMemState(ctx.Context()).GetDepositInfo(ctx, typedContractAddr).Get() - contractDepositInfo := seiutils.Map( - depositMemState, - func(d *types.DepositInfoEntry) types.ContractDepositInfo { return d.ToContractDepositInfo() }, - ) - escrowed := sdk.NewCoins() - for _, deposit := range depositMemState { - escrowed = escrowed.Add(sdk.NewCoin(deposit.Denom, deposit.Amount.TruncateInt())) - } - contractAddr, err := sdk.AccAddressFromBech32(string(typedContractAddr)) - if err != nil { - panic(err) - } - if err := w.BankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, contractAddr, escrowed); err != nil { - panic(err) - } - return types.SudoOrderPlacementMsg{ - OrderPlacements: types.OrderPlacementMsgDetails{ - Orders: []types.Order{}, - Deposits: contractDepositInfo, - }, - } -} diff --git a/x/dex/keeper/abci/end_block_place_orders.go b/x/dex/keeper/abci/end_block_place_orders.go deleted file mode 100644 index 8ab95c6e3..000000000 --- a/x/dex/keeper/abci/end_block_place_orders.go +++ /dev/null @@ -1,83 +0,0 @@ -package abci - -import ( - "context" - "encoding/json" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "go.opentelemetry.io/otel/attribute" - otrace "go.opentelemetry.io/otel/trace" -) - -// There is a limit on how many bytes can be passed to wasm VM in a single call, -// so we shouldn't bump this number unless there is an upgrade to wasm VM -const MaxOrdersPerSudoCall = 50000 - -func (w KeeperWrapper) HandleEBPlaceOrders(ctx context.Context, sdkCtx sdk.Context, tracer *otrace.Tracer, contractAddr string, registeredPairs []types.Pair) error { - _, span := (*tracer).Start(ctx, "SudoPlaceOrders") - span.SetAttributes(attribute.String("contractAddr", contractAddr)) - defer span.End() - - typedContractAddr := types.ContractAddress(contractAddr) - msgs := w.GetPlaceSudoMsg(sdkCtx, typedContractAddr, registeredPairs) - - responses := []types.SudoOrderPlacementResponse{} - - for _, msg := range msgs { - if msg.IsEmpty() { - continue - } - userProvidedGas := w.GetParams(sdkCtx).DefaultGasPerOrder * uint64(len(msg.OrderPlacements.Orders)) - data, err := utils.CallContractSudo(sdkCtx, w.Keeper, contractAddr, msg, userProvidedGas) - if err != nil { - sdkCtx.Logger().Error(fmt.Sprintf("Error during order placement: %s", err.Error())) - return err - } - response := types.SudoOrderPlacementResponse{} - if err := json.Unmarshal(data, &response); err != nil { - sdkCtx.Logger().Error("Failed to parse order placement response") - return err - } - if len(response.UnsuccessfulOrders) > 0 { - sdkCtx.Logger().Info(fmt.Sprintf("%s has %d unsuccessful order placements", contractAddr, len(response.UnsuccessfulOrders))) - } - responses = append(responses, response) - } - - for _, pair := range registeredPairs { - for _, response := range responses { - dexutils.GetMemState(sdkCtx.Context()).GetBlockOrders(sdkCtx, typedContractAddr, pair).MarkFailedToPlace(response.UnsuccessfulOrders) - } - } - return nil -} - -func (w KeeperWrapper) GetPlaceSudoMsg(ctx sdk.Context, typedContractAddr types.ContractAddress, registeredPairs []types.Pair) []types.SudoOrderPlacementMsg { - msgs := []types.SudoOrderPlacementMsg{} - contractOrderPlacements := []types.Order{} - for _, pair := range registeredPairs { - for _, order := range dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, typedContractAddr, pair).Get() { - contractOrderPlacements = append(contractOrderPlacements, *order) - if len(contractOrderPlacements) == MaxOrdersPerSudoCall { - msgs = append(msgs, types.SudoOrderPlacementMsg{ - OrderPlacements: types.OrderPlacementMsgDetails{ - Orders: contractOrderPlacements, - Deposits: []types.ContractDepositInfo{}, - }, - }) - contractOrderPlacements = []types.Order{} - } - } - } - msgs = append(msgs, types.SudoOrderPlacementMsg{ - OrderPlacements: types.OrderPlacementMsgDetails{ - Orders: contractOrderPlacements, - Deposits: []types.ContractDepositInfo{}, - }, - }) - return msgs -} diff --git a/x/dex/keeper/abci/end_block_place_orders_test.go b/x/dex/keeper/abci/end_block_place_orders_test.go deleted file mode 100644 index 556c3119c..000000000 --- a/x/dex/keeper/abci/end_block_place_orders_test.go +++ /dev/null @@ -1,67 +0,0 @@ -package abci_test - -import ( - "context" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/keeper/abci" - "github.com/sei-protocol/sei-chain/x/dex/types" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - minttypes "github.com/sei-protocol/sei-chain/x/mint/types" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -func TestGetPlaceSudoMsg(t *testing.T) { - pair := types.Pair{PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom} - keeper, ctx := keepertest.DexKeeper(t) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, keepertest.TestContract, pair).Add( - &types.Order{ - Id: 1, - Price: sdk.OneDec(), - Quantity: sdk.OneDec(), - PriceDenom: "USDC", - AssetDenom: "ATOM", - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"OPEN\",\"leverage\":\"1\"}", - }, - ) - wrapper := abci.KeeperWrapper{Keeper: keeper} - msgs := wrapper.GetPlaceSudoMsg(ctx, keepertest.TestContract, []types.Pair{pair}) - require.Equal(t, 1, len(msgs)) -} - -func TestGetDepositSudoMsg(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(1000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - err := bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - require.Nil(t, err) - // this send would happen in msg server - err = bankkeeper.SendCoinsFromAccountToModule(ctx, testAccount, dextypes.ModuleName, amounts) - require.Nil(t, err) - keeper := testApp.DexKeeper - dexutils.GetMemState(ctx.Context()).GetDepositInfo(ctx, keepertest.TestContract).Add( - &types.DepositInfoEntry{ - Creator: testAccount.String(), - Denom: amounts[0].Denom, - Amount: sdk.NewDec(amounts[0].Amount.Int64()), - }, - ) - wrapper := abci.KeeperWrapper{Keeper: &keeper} - msgs := wrapper.GetDepositSudoMsg(ctx, keepertest.TestContract) - require.Equal(t, 1, len(msgs.OrderPlacements.Deposits)) - - contractAddr, _ := sdk.AccAddressFromBech32(keepertest.TestContract) - contractBalance := testApp.BankKeeper.GetBalance(ctx, contractAddr, "usei") - require.Equal(t, contractBalance.Amount.Int64(), int64(1000000)) -} diff --git a/x/dex/keeper/abci/keeper_wrapper.go b/x/dex/keeper/abci/keeper_wrapper.go deleted file mode 100644 index ee20698ad..000000000 --- a/x/dex/keeper/abci/keeper_wrapper.go +++ /dev/null @@ -1,9 +0,0 @@ -package abci - -import ( - "github.com/sei-protocol/sei-chain/x/dex/keeper" -) - -type KeeperWrapper struct { - *keeper.Keeper -} diff --git a/x/dex/keeper/asset_list.go b/x/dex/keeper/asset_list.go deleted file mode 100644 index d62b39ed0..000000000 --- a/x/dex/keeper/asset_list.go +++ /dev/null @@ -1,43 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k Keeper) SetAssetMetadata(ctx sdk.Context, assetMetadata types.AssetMetadata) { - store := ctx.KVStore(k.storeKey) - // Have one base denom for a canonical “display”. - // Even if asset exists already, overwrite the store with new metadata - // Asset list is decided through governance - b := k.Cdc.MustMarshal(&assetMetadata) - - store.Set(types.AssetListPrefix(assetMetadata.Metadata.Display), b) -} - -func (k Keeper) GetAssetMetadataByDenom(ctx sdk.Context, assetDenom string) (val types.AssetMetadata, found bool) { - store := ctx.KVStore(k.storeKey) - b := store.Get(types.AssetListPrefix(assetDenom)) - if b == nil { - return types.AssetMetadata{}, false - } - metadata := types.AssetMetadata{} - k.Cdc.MustUnmarshal(b, &metadata) - return metadata, true -} - -func (k Keeper) GetAllAssetMetadata(ctx sdk.Context) []types.AssetMetadata { - store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefix(types.AssetListKey)) - - list := []types.AssetMetadata{} - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.AssetMetadata - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return list -} diff --git a/x/dex/keeper/asset_list_test.go b/x/dex/keeper/asset_list_test.go deleted file mode 100644 index 70348e6f3..000000000 --- a/x/dex/keeper/asset_list_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package keeper_test - -import ( - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/testutil/nullify" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestAssetListGet(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - item := keepertest.CreateAssetMetadata(keeper, ctx) - - var expected_asset_list []types.AssetMetadata - expected_asset_list = append(expected_asset_list, item) - - asset_list := keeper.GetAllAssetMetadata(ctx) - - // First test get all asset list - require.ElementsMatch(t, - nullify.Fill(expected_asset_list), - nullify.Fill(asset_list), - ) - - // Test not found asset Denom - _, found := keeper.GetAssetMetadataByDenom(ctx, "denomNotInAssetList123") - require.False(t, found) - - // Test get specific Denom - val, found := keeper.GetAssetMetadataByDenom(ctx, "axlusdc") - require.True(t, found) - require.Equal(t, item, val) -} diff --git a/x/dex/keeper/common.go b/x/dex/keeper/common.go deleted file mode 100644 index f5ba9b961..000000000 --- a/x/dex/keeper/common.go +++ /dev/null @@ -1,22 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (k Keeper) removeAllForPrefix(ctx sdk.Context, prefix []byte) { - store := ctx.KVStore(k.storeKey) - for _, key := range k.getAllKeysForPrefix(store, prefix) { - store.Delete(key) - } -} - -func (k Keeper) getAllKeysForPrefix(store sdk.KVStore, prefix []byte) [][]byte { - keys := [][]byte{} - iter := sdk.KVStorePrefixIterator(store, prefix) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - keys = append(keys, iter.Key()) - } - return keys -} diff --git a/x/dex/keeper/contract.go b/x/dex/keeper/contract.go deleted file mode 100644 index dd2596254..000000000 --- a/x/dex/keeper/contract.go +++ /dev/null @@ -1,244 +0,0 @@ -package keeper - -import ( - "errors" - "math" - "math/big" - "time" - - "github.com/cosmos/cosmos-sdk/store/prefix" - "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" - appparams "github.com/sei-protocol/sei-chain/app/params" - "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -const ContractPrefixKey = "x-wasm-contract" - -func (k Keeper) SetContract(ctx sdk.Context, contract *types.ContractInfoV2) error { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - []byte(ContractPrefixKey), - ) - bz, err := contract.Marshal() - if err != nil { - return errors.New("failed to marshal contract info") - } - store.Set(types.ContractKey(contract.ContractAddr), bz) - return nil -} - -func (k Keeper) DeleteContract(ctx sdk.Context, contractAddr string) { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - []byte(ContractPrefixKey), - ) - key := types.ContractKey(contractAddr) - store.Delete(key) -} - -func (k Keeper) GetContract(ctx sdk.Context, contractAddr string) (types.ContractInfoV2, error) { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - []byte(ContractPrefixKey), - ) - key := types.ContractKey(contractAddr) - res := types.ContractInfoV2{} - if !store.Has(key) { - return res, types.ErrContractNotExists - } - if err := res.Unmarshal(store.Get(key)); err != nil { - return res, types.ErrParsingContractInfo - } - return res, nil -} - -func (k Keeper) GetContractWithoutGasCharge(ctx sdk.Context, contractAddr string) (types.ContractInfoV2, error) { - return k.GetContract(ctx.WithGasMeter(sdk.NewInfiniteGasMeterWithMultiplier(ctx)), contractAddr) -} - -func (k Keeper) GetContractGasLimit(ctx sdk.Context, contractAddr sdk.AccAddress) (uint64, error) { - bech32ContractAddr := contractAddr.String() - contract, err := k.GetContract(ctx, bech32ContractAddr) - if err != nil { - return 0, err - } - rentBalance := contract.RentBalance - gasPrice := k.GetParams(ctx).SudoCallGasPrice - if gasPrice.LTE(sdk.ZeroDec()) { - return 0, errors.New("invalid gas price: must be positive") - } - gasDec := sdk.NewDecFromBigInt(new(big.Int).SetUint64(rentBalance)).Quo(gasPrice) - if gasDec.GT(sdk.NewDecFromBigInt(new(big.Int).SetUint64(math.MaxUint64))) { - return math.MaxUint64, nil - } - return gasDec.TruncateInt().Uint64(), nil // round down -} - -func (k Keeper) GetAllContractInfo(ctx sdk.Context) []types.ContractInfoV2 { - store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(ContractPrefixKey)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - list := []types.ContractInfoV2{} - for ; iterator.Valid(); iterator.Next() { - contract := types.ContractInfoV2{} - if err := contract.Unmarshal(iterator.Value()); err == nil { - list = append(list, contract) - } - } - - return list -} - -// Reduce `RentBalance` of a contract if `userProvidedGas` cannot cover `gasUsed` -func (k Keeper) ChargeRentForGas(ctx sdk.Context, contractAddr string, gasUsed uint64, gasAllowance uint64) error { - if gasUsed <= gasAllowance { - // Allowance can fully cover the consumed gas. Doing nothing - return nil - } - gasUsed -= gasAllowance - contract, err := k.GetContract(ctx, contractAddr) - if err != nil { - return err - } - params := k.GetParams(ctx) - gasFeeDec := sdk.NewDecFromBigInt(new(big.Int).SetUint64(gasUsed)).Mul(params.SudoCallGasPrice) - if gasFeeDec.GT(sdk.NewDecFromBigInt(new(big.Int).SetUint64(math.MaxUint64))) { - gasFeeDec = sdk.NewDecFromBigInt(new(big.Int).SetUint64(math.MaxUint64)) - } - gasFee := gasFeeDec.RoundInt().Uint64() - if gasFee > contract.RentBalance { - contract.RentBalance = 0 - if err := k.SetContract(ctx, &contract); err != nil { - return err - } - return types.ErrInsufficientRent - } - contract.RentBalance -= gasFee - return k.SetContract(ctx, &contract) -} - -func (k Keeper) GetRentsForContracts(ctx sdk.Context, contractAddrs []string) map[string]uint64 { - res := map[string]uint64{} - for _, contractAddr := range contractAddrs { - if contract, err := k.GetContract(ctx, contractAddr); err == nil { - res[contractAddr] = contract.RentBalance - } - } - return res -} - -// Unregistrate and refund the creator -func (k Keeper) DoUnregisterContractWithRefund(ctx sdk.Context, contract types.ContractInfoV2) error { - k.DoUnregisterContract(ctx, contract) - creatorAddr, _ := sdk.AccAddressFromBech32(contract.Creator) - return k.BankKeeper.SendCoins(ctx, k.AccountKeeper.GetModuleAddress(types.ModuleName), creatorAddr, sdk.NewCoins(sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewIntFromBigInt(new(big.Int).SetUint64(contract.RentBalance))))) -} - -// Contract unregistration will remove all orderbook data stored for the contract -func (k Keeper) DoUnregisterContract(ctx sdk.Context, contract types.ContractInfoV2) { - k.DeleteContract(ctx, contract.ContractAddr) - k.ClearDependenciesForContract(ctx, contract) - k.RemoveAllLongBooksForContract(ctx, contract.ContractAddr) - k.RemoveAllShortBooksForContract(ctx, contract.ContractAddr) - k.RemoveAllPricesForContract(ctx, contract.ContractAddr) - k.DeleteMatchResultState(ctx, contract.ContractAddr) - k.DeleteNextOrderID(ctx, contract.ContractAddr) - k.DeleteAllRegisteredPairsForContract(ctx, contract.ContractAddr) -} - -func (k Keeper) SuspendContract(ctx sdk.Context, contractAddress string, reason string) error { - contract, err := k.GetContract(ctx, contractAddress) - if err != nil { - return err - } - contract.Suspended = true - contract.SuspensionReason = reason - return k.SetContract(ctx, &contract) -} - -func (k Keeper) ClearDependenciesForContract(ctx sdk.Context, removedContract types.ContractInfoV2) { - // handle upstreams - allContracts := k.GetAllContractInfo(ctx) - for _, c := range allContracts { - contract := c - dependsOnRemovedContract := false - for _, dep := range contract.Dependencies { - if dep.Dependency == removedContract.ContractAddr { - dependsOnRemovedContract = true - break - } - } - if !dependsOnRemovedContract { - continue - } - contract.Dependencies = utils.Filter(contract.Dependencies, func(dep *types.ContractDependencyInfo) bool { return dep.Dependency != removedContract.ContractAddr }) - _ = k.SetContract(ctx, &contract) - } - - // handle downstreams - allContractsMap := map[string]types.ContractInfoV2{} - for _, contract := range allContracts { - allContractsMap[contract.ContractAddr] = contract - } - for _, dep := range removedContract.Dependencies { - if dependedContract, ok := allContractsMap[dep.Dependency]; ok { - dependedContract.NumIncomingDependencies-- - _ = k.SetContract(ctx, &dependedContract) - } - - if dep.ImmediateElderSibling != "" { - if immediateElderSibling, ok := allContractsMap[dep.ImmediateElderSibling]; ok { - newDependencies := []*types.ContractDependencyInfo{} - for _, elderSiblingDep := range immediateElderSibling.Dependencies { - if elderSiblingDep.Dependency != dep.Dependency { - newDependencies = append(newDependencies, elderSiblingDep) - } else { - newDependencies = append(newDependencies, &types.ContractDependencyInfo{ - Dependency: elderSiblingDep.Dependency, - ImmediateElderSibling: elderSiblingDep.ImmediateElderSibling, - ImmediateYoungerSibling: dep.ImmediateYoungerSibling, - }) - } - } - immediateElderSibling.Dependencies = newDependencies - _ = k.SetContract(ctx, &immediateElderSibling) - } - } - - if dep.ImmediateYoungerSibling != "" { - if immediateYoungerSibling, ok := allContractsMap[dep.ImmediateYoungerSibling]; ok { - newDependencies := []*types.ContractDependencyInfo{} - for _, youngerSiblingDep := range immediateYoungerSibling.Dependencies { - if youngerSiblingDep.Dependency != dep.Dependency { - newDependencies = append(newDependencies, youngerSiblingDep) - } else { - newDependencies = append(newDependencies, &types.ContractDependencyInfo{ - Dependency: youngerSiblingDep.Dependency, - ImmediateElderSibling: dep.ImmediateElderSibling, - ImmediateYoungerSibling: youngerSiblingDep.ImmediateYoungerSibling, - }) - } - } - immediateYoungerSibling.Dependencies = newDependencies - _ = k.SetContract(ctx, &immediateYoungerSibling) - } - } - } -} - -func (k Keeper) GetAllProcessableContractInfo(ctx sdk.Context) []types.ContractInfoV2 { - // Do not process any contract that has zero rent balance, suspended, or not require matching - defer telemetry.MeasureSince(time.Now(), types.ModuleName, "get_all_contract_info") - allRegisteredContracts := k.GetAllContractInfo(ctx) - validContracts := utils.Filter(allRegisteredContracts, func(c types.ContractInfoV2) bool { - return c.NeedOrderMatching && !c.Suspended && c.RentBalance > k.GetMinProcessableRent(ctx) - }) - telemetry.SetGauge(float32(len(allRegisteredContracts)), types.ModuleName, "num_of_registered_contracts") - telemetry.SetGauge(float32(len(validContracts)), types.ModuleName, "num_of_valid_contracts") - telemetry.SetGauge(float32(len(allRegisteredContracts)-len(validContracts)), types.ModuleName, "num_of_zero_balance_contracts") - return validContracts -} diff --git a/x/dex/keeper/contract_test.go b/x/dex/keeper/contract_test.go deleted file mode 100644 index 8dae31c24..000000000 --- a/x/dex/keeper/contract_test.go +++ /dev/null @@ -1,368 +0,0 @@ -package keeper_test - -import ( - "math" - "testing" - - "github.com/cosmos/cosmos-sdk/store/prefix" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestChargeRentForGas(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.SetParams(ctx, types.Params{SudoCallGasPrice: sdk.NewDecWithPrec(1, 1), PriceSnapshotRetention: 1}) - err := keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - CodeId: 1, - RentBalance: 1000000, - }) - require.Nil(t, err) - err = keeper.ChargeRentForGas(ctx, keepertest.TestContract, 5000000, 0) - require.Nil(t, err) - contract, err := keeper.GetContract(ctx, keepertest.TestContract) - require.Nil(t, err) - require.Equal(t, uint64(500000), contract.RentBalance) - err = keeper.ChargeRentForGas(ctx, keepertest.TestContract, 6000000, 0) - require.NotNil(t, err) - contract, err = keeper.GetContract(ctx, keepertest.TestContract) - require.Nil(t, err) - require.Equal(t, uint64(0), contract.RentBalance) - err = keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - CodeId: 1, - RentBalance: 1000000, - }) - require.Nil(t, err) - err = keeper.ChargeRentForGas(ctx, keepertest.TestContract, 5000000, 4000000) - require.Nil(t, err) - contract, err = keeper.GetContract(ctx, keepertest.TestContract) - require.Nil(t, err) - require.Equal(t, uint64(900000), contract.RentBalance) - err = keeper.ChargeRentForGas(ctx, keepertest.TestContract, 5000000, 6000000) - require.Nil(t, err) - contract, err = keeper.GetContract(ctx, keepertest.TestContract) - require.Nil(t, err) - require.Equal(t, uint64(900000), contract.RentBalance) - - // delete contract - keeper.DeleteContract(ctx, keepertest.TestContract) - _, err = keeper.GetContract(ctx, keepertest.TestContract) - require.NotNil(t, err) -} - -func TestGetContractInfo(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.SetParams(ctx, types.Params{SudoCallGasPrice: sdk.NewDecWithPrec(1, 1), PriceSnapshotRetention: 1}) - keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - CodeId: 1, - RentBalance: 1000000, - }) - // Successfully get a contract - contract, err := keeper.GetContract(ctx, keepertest.TestContract) - require.Equal(t, uint64(1000000), contract.RentBalance) - require.Equal(t, uint64(1), contract.CodeId) - require.Equal(t, keepertest.TestAccount, contract.Creator) - - // Getting a non exist contract should throw error for contract not exist - _, err = keeper.GetContract(ctx, keepertest.TestContract2) - require.Error(t, err) - require.Equal(t, err, types.ErrContractNotExists) - - // Getting a corrupted record should throw error for unable to parse - store := prefix.NewStore( - ctx.KVStore(keeper.GetStoreKey()), - []byte("x-wasm-contract"), - ) - bz := []byte("bad_contract") - store.Set(types.ContractKey(keepertest.TestContract), bz) - _, err = keeper.GetContract(ctx, keepertest.TestContract) - require.Error(t, err) - require.Equal(t, err, types.ErrParsingContractInfo) -} - -func TestGetAllContractInfo(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.SetParams(ctx, types.Params{SudoCallGasPrice: sdk.NewDecWithPrec(1, 1), PriceSnapshotRetention: 1}) - keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - CodeId: 1, - RentBalance: 1000000, - }) - keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount2, - ContractAddr: keepertest.TestContract2, - CodeId: 2, - RentBalance: 1000000, - }) - contracts := keeper.GetAllContractInfo(ctx) - require.Equal(t, uint64(1000000), contracts[0].RentBalance) - require.Equal(t, uint64(1000000), contracts[1].RentBalance) - require.Equal(t, uint64(1), contracts[0].CodeId) - require.Equal(t, uint64(2), contracts[1].CodeId) - require.Equal(t, keepertest.TestAccount, contracts[0].Creator) - require.Equal(t, keepertest.TestContract, contracts[0].ContractAddr) - require.Equal(t, keepertest.TestAccount2, contracts[1].Creator) - require.Equal(t, keepertest.TestContract2, contracts[1].ContractAddr) -} - -func TestGetContractGasLimit(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - contractAddr := sdk.MustAccAddressFromBech32("sei1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrsgshtdj") - keeper.SetParams(ctx, types.Params{SudoCallGasPrice: sdk.NewDecWithPrec(1, 1), PriceSnapshotRetention: 1}) - keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: "sei1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrsgshtdj", - CodeId: 1, - RentBalance: 1000000, - }) - gasLimit, err := keeper.GetContractGasLimit(ctx, contractAddr) - require.Nil(t, err) - require.Equal(t, uint64(10000000), gasLimit) - - params := keeper.GetParams(ctx) - params.SudoCallGasPrice = sdk.NewDecWithPrec(1, 1) // 0.1 - keeper.SetParams(ctx, params) - keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: "sei1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrsgshtdj", - CodeId: 1, - RentBalance: math.MaxUint64, - }) - gasLimit, err = keeper.GetContractGasLimit(ctx, contractAddr) - require.Nil(t, err) - // max uint64 / 0.1 would cause overflow so we cap it at max - require.Equal(t, uint64(math.MaxUint64), gasLimit) -} - -func TestGetRentsForContracts(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - addr := "sei1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrsgshtdj" - require.Equal(t, 0, len(keeper.GetRentsForContracts(ctx, []string{addr}))) - - keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: addr, - CodeId: 1, - RentBalance: 100, - }) - require.Equal(t, map[string]uint64{addr: uint64(100)}, keeper.GetRentsForContracts(ctx, []string{addr})) -} - -func TestClearDependenciesForContract(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - - // no dependency whatsoever - contract := types.ContractInfoV2{ - ContractAddr: keepertest.TestContract, - } - keeper.SetContract(ctx, &contract) - require.NotPanics(t, func() { keeper.ClearDependenciesForContract(ctx, contract) }) - - // has upstreams - contract = types.ContractInfoV2{ - ContractAddr: keepertest.TestContract, - NumIncomingDependencies: 2, - } - keptContract := types.ContractInfoV2{ - ContractAddr: "sei1yum4v0v5l92jkxn8xpn9mjg7wuldk784ctg424ue8gqvdp88qzlqt6zc4h", - NumIncomingDependencies: 2, - } - upA := types.ContractInfoV2{ - ContractAddr: "sei105y5ssrsr8p8erkteagrguea6wcdgehlaamfup4lhrlm0y6eyhdsckcxdh", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: keepertest.TestContract, - ImmediateYoungerSibling: "sei1y8ghk8q8d2rswrf3gv7hv2lfsewu8tvp6ysnlkzspu7k0aqkthdqwdqvk0", - }, - { - Dependency: "sei1yum4v0v5l92jkxn8xpn9mjg7wuldk784ctg424ue8gqvdp88qzlqt6zc4h", - ImmediateYoungerSibling: "sei193dzcmy7lwuj4eda3zpwwt9ejal00xva0vawcvhgsyyp5cfh6jyqj2vsuv", - }, - }, - } - upB := types.ContractInfoV2{ - ContractAddr: "sei1y8ghk8q8d2rswrf3gv7hv2lfsewu8tvp6ysnlkzspu7k0aqkthdqwdqvk0", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: keepertest.TestContract, - ImmediateElderSibling: "sei105y5ssrsr8p8erkteagrguea6wcdgehlaamfup4lhrlm0y6eyhdsckcxdh", - }, - }, - } - upC := types.ContractInfoV2{ - ContractAddr: "sei193dzcmy7lwuj4eda3zpwwt9ejal00xva0vawcvhgsyyp5cfh6jyqj2vsuv", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1yum4v0v5l92jkxn8xpn9mjg7wuldk784ctg424ue8gqvdp88qzlqt6zc4h", - ImmediateElderSibling: "sei105y5ssrsr8p8erkteagrguea6wcdgehlaamfup4lhrlm0y6eyhdsckcxdh", - }, - }, - } - keeper.SetContract(ctx, &contract) - keeper.SetContract(ctx, &keptContract) - keeper.SetContract(ctx, &upA) - keeper.SetContract(ctx, &upB) - keeper.SetContract(ctx, &upC) - require.NotPanics(t, func() { keeper.ClearDependenciesForContract(ctx, contract) }) - upA, err := keeper.GetContract(ctx, upA.ContractAddr) - require.Nil(t, err) - require.Equal(t, 1, len(upA.Dependencies)) - upB, err = keeper.GetContract(ctx, upB.ContractAddr) - require.Nil(t, err) - require.Equal(t, 0, len(upB.Dependencies)) - upC, err = keeper.GetContract(ctx, upC.ContractAddr) - require.Nil(t, err) - require.Equal(t, 1, len(upC.Dependencies)) - - // has downstreams - contract = types.ContractInfoV2{ - ContractAddr: keepertest.TestContract, - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1ehyucudueas79h0zwufcnxtv7s2sfmwc6rt0v0hzczdgvyr3p56qhprg6n", - ImmediateElderSibling: "sei1uyprmp0lu8w8z8kwxp7mxanrtrgn4lp7j557pxe4v8sczzdzl7ysk832hh", - ImmediateYoungerSibling: "sei1yum4v0v5l92jkxn8xpn9mjg7wuldk784ctg424ue8gqvdp88qzlqt6zc4h", - }, { - Dependency: "sei1n23ymwg2y7m55x5vwf2qk0als9cr592q4uc5de08c6qmaeryet4qye4w77", - }, - }, - } - keptContractA := types.ContractInfoV2{ - ContractAddr: "sei1yum4v0v5l92jkxn8xpn9mjg7wuldk784ctg424ue8gqvdp88qzlqt6zc4h", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1ehyucudueas79h0zwufcnxtv7s2sfmwc6rt0v0hzczdgvyr3p56qhprg6n", - ImmediateElderSibling: keepertest.TestContract, - }, - }, - } - keptContractB := types.ContractInfoV2{ - ContractAddr: "sei1uyprmp0lu8w8z8kwxp7mxanrtrgn4lp7j557pxe4v8sczzdzl7ysk832hh", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1ehyucudueas79h0zwufcnxtv7s2sfmwc6rt0v0hzczdgvyr3p56qhprg6n", - ImmediateYoungerSibling: keepertest.TestContract, - }, - }, - } - downA := types.ContractInfoV2{ - ContractAddr: "sei1ehyucudueas79h0zwufcnxtv7s2sfmwc6rt0v0hzczdgvyr3p56qhprg6n", - NumIncomingDependencies: 3, - } - downB := types.ContractInfoV2{ - ContractAddr: "sei1n23ymwg2y7m55x5vwf2qk0als9cr592q4uc5de08c6qmaeryet4qye4w77", - NumIncomingDependencies: 1, - } - keeper.SetContract(ctx, &contract) - keeper.SetContract(ctx, &keptContractA) - keeper.SetContract(ctx, &keptContractB) - keeper.SetContract(ctx, &downA) - keeper.SetContract(ctx, &downB) - - require.NotPanics(t, func() { keeper.ClearDependenciesForContract(ctx, contract) }) - keptContractA, err = keeper.GetContract(ctx, keptContractA.ContractAddr) - require.Nil(t, err) - require.Equal(t, types.ContractInfoV2{ - ContractAddr: "sei1yum4v0v5l92jkxn8xpn9mjg7wuldk784ctg424ue8gqvdp88qzlqt6zc4h", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1ehyucudueas79h0zwufcnxtv7s2sfmwc6rt0v0hzczdgvyr3p56qhprg6n", - ImmediateElderSibling: "sei1uyprmp0lu8w8z8kwxp7mxanrtrgn4lp7j557pxe4v8sczzdzl7ysk832hh", - }, - }, - }, keptContractA) - keptContractB, err = keeper.GetContract(ctx, keptContractB.ContractAddr) - require.Nil(t, err) - require.Equal(t, types.ContractInfoV2{ - ContractAddr: "sei1uyprmp0lu8w8z8kwxp7mxanrtrgn4lp7j557pxe4v8sczzdzl7ysk832hh", - Dependencies: []*types.ContractDependencyInfo{ - { - Dependency: "sei1ehyucudueas79h0zwufcnxtv7s2sfmwc6rt0v0hzczdgvyr3p56qhprg6n", - ImmediateYoungerSibling: "sei1yum4v0v5l92jkxn8xpn9mjg7wuldk784ctg424ue8gqvdp88qzlqt6zc4h", - }, - }, - }, keptContractB) - downA, err = keeper.GetContract(ctx, downA.ContractAddr) - require.Nil(t, err) - require.Equal(t, int64(2), downA.NumIncomingDependencies) - downB, err = keeper.GetContract(ctx, downB.ContractAddr) - require.Nil(t, err) - require.Equal(t, int64(0), downB.NumIncomingDependencies) -} - -func TestGetContractWithoutGasCharge(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - _ = keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - CodeId: 1, - RentBalance: 1000000, - }) - // regular gas meter case - ctx = ctx.WithGasMeter(sdk.NewGasMeterWithMultiplier(ctx, 10000)) - contract, err := keeper.GetContractWithoutGasCharge(ctx, keepertest.TestContract) - require.Nil(t, err) - require.Equal(t, keepertest.TestContract, contract.ContractAddr) - require.Equal(t, uint64(0), ctx.GasMeter().GasConsumed()) - require.Equal(t, uint64(10000), ctx.GasMeter().Limit()) - - // regular gas meter out of gas case - ctx = ctx.WithGasMeter(sdk.NewGasMeterWithMultiplier(ctx, 1)) - contract, err = keeper.GetContractWithoutGasCharge(ctx, keepertest.TestContract) - require.Nil(t, err) - require.Equal(t, keepertest.TestContract, contract.ContractAddr) - require.Equal(t, uint64(0), ctx.GasMeter().GasConsumed()) - require.Equal(t, uint64(1), ctx.GasMeter().Limit()) - - // infinite gas meter case - ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeterWithMultiplier(ctx)) - contract, err = keeper.GetContractWithoutGasCharge(ctx, keepertest.TestContract) - require.Nil(t, err) - require.Equal(t, keepertest.TestContract, contract.ContractAddr) - require.Equal(t, uint64(0), ctx.GasMeter().GasConsumed()) - require.Equal(t, uint64(0), ctx.GasMeter().Limit()) -} - -func TestGetAllProcessableContractInfo(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - require.Greater(t, keeper.GetMinProcessableRent(ctx), uint64(0)) - - goodContract := types.ContractInfoV2{ - ContractAddr: "sei1avny5w9rcj7lmqmse8kukg2edvq4adqk8vlf58", - NeedOrderMatching: true, - RentBalance: keeper.GetMinProcessableRent(ctx) + 1, - } - noMatchingContract := types.ContractInfoV2{ - ContractAddr: "sei1fww2a30qc4sh25crhugcclaq2supxkpxeyz9lr", - NeedOrderMatching: false, - RentBalance: keeper.GetMinProcessableRent(ctx) + 1, - } - suspendedContract := types.ContractInfoV2{ - ContractAddr: "sei1hh95z3a5vk560khjnnkd3en8r0hu063mw64jzd", - NeedOrderMatching: true, - RentBalance: keeper.GetMinProcessableRent(ctx) + 1, - Suspended: true, - } - outOfRentContract := types.ContractInfoV2{ - ContractAddr: "sei1v2ye9tnmzwx5983emm00j0c7tyxqu855ktxw5l", - NeedOrderMatching: true, - RentBalance: keeper.GetMinProcessableRent(ctx) - 1, - } - require.NoError(t, keeper.SetContract(ctx, &goodContract)) - require.NoError(t, keeper.SetContract(ctx, &noMatchingContract)) - require.NoError(t, keeper.SetContract(ctx, &suspendedContract)) - require.NoError(t, keeper.SetContract(ctx, &outOfRentContract)) - - processableContracts := keeper.GetAllProcessableContractInfo(ctx) - require.Equal(t, 1, len(processableContracts)) - require.Equal(t, "sei1avny5w9rcj7lmqmse8kukg2edvq4adqk8vlf58", processableContracts[0].ContractAddr) -} diff --git a/x/dex/keeper/epoch.go b/x/dex/keeper/epoch.go deleted file mode 100644 index 33f8012af..000000000 --- a/x/dex/keeper/epoch.go +++ /dev/null @@ -1,26 +0,0 @@ -package keeper - -import ( - "encoding/binary" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const EpochKey = "epoch" - -func (k Keeper) SetEpoch(ctx sdk.Context, epoch uint64) { - store := ctx.KVStore(k.storeKey) - bz := make([]byte, 8) - binary.BigEndian.PutUint64(bz, epoch) - store.Set([]byte(EpochKey), bz) - ctx.Logger().Info(fmt.Sprintf("Current epoch %d", epoch)) -} - -func (k Keeper) IsNewEpoch(ctx sdk.Context) (bool, uint64) { - store := ctx.KVStore(k.storeKey) - b := store.Get([]byte(EpochKey)) - lastEpoch := binary.BigEndian.Uint64(b) - currentEpoch := k.EpochKeeper.GetEpoch(ctx).CurrentEpoch - return currentEpoch > lastEpoch, currentEpoch -} diff --git a/x/dex/keeper/keeper.go b/x/dex/keeper/keeper.go deleted file mode 100644 index f89bf7ded..000000000 --- a/x/dex/keeper/keeper.go +++ /dev/null @@ -1,78 +0,0 @@ -package keeper - -import ( - "fmt" - - "github.com/tendermint/tendermint/libs/log" - - "github.com/CosmWasm/wasmd/x/wasm" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" - epochkeeper "github.com/sei-protocol/sei-chain/x/epoch/keeper" -) - -type ( - Keeper struct { - Cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey - Paramstore paramtypes.Subspace - AccountKeeper authkeeper.AccountKeeper - EpochKeeper epochkeeper.Keeper - BankKeeper bankkeeper.Keeper - WasmKeeper wasm.Keeper - MemState *dexcache.MemState - } -) - -func NewKeeper( - cdc codec.BinaryCodec, - storeKey, - memKey sdk.StoreKey, - ps paramtypes.Subspace, - epochKeeper epochkeeper.Keeper, - bankKeeper bankkeeper.Keeper, - accountKeeper authkeeper.AccountKeeper, -) *Keeper { - // set KeyTable if it has not already been set - if !ps.HasKeyTable() { - ps = ps.WithKeyTable(types.ParamKeyTable()) - } - return &Keeper{ - Cdc: cdc, - storeKey: storeKey, - memKey: memKey, - Paramstore: ps, - EpochKeeper: epochKeeper, - BankKeeper: bankKeeper, - AccountKeeper: accountKeeper, - MemState: dexcache.NewMemState(memKey), - } -} - -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) -} - -func (k Keeper) GetStoreKey() sdk.StoreKey { - return k.storeKey -} - -func (k Keeper) GetMemStoreKey() sdk.StoreKey { - return k.memKey -} - -func (k *Keeper) SetWasmKeeper(wasmKeeper *wasm.Keeper) { - k.WasmKeeper = *wasmKeeper -} - -func (k Keeper) CreateModuleAccount(ctx sdk.Context) { - moduleAcc := authtypes.NewEmptyModuleAccount(types.ModuleName, authtypes.Burner) - k.AccountKeeper.SetModuleAccount(ctx, moduleAcc) -} diff --git a/x/dex/keeper/long_book.go b/x/dex/keeper/long_book.go deleted file mode 100644 index d8f7e8c2f..000000000 --- a/x/dex/keeper/long_book.go +++ /dev/null @@ -1,184 +0,0 @@ -package keeper - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" -) - -// SetLongBook set a specific longBook in the store -func (k Keeper) SetLongBook(ctx sdk.Context, contractAddr string, longBook types.LongBook) { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - types.OrderBookPrefix( - true, contractAddr, longBook.Entry.PriceDenom, longBook.Entry.AssetDenom, - ), - ) - b := k.Cdc.MustMarshal(&longBook) - store.Set(GetKeyForLongBook(longBook), b) -} - -func (k Keeper) SetLongOrderBookEntry(ctx sdk.Context, contractAddr string, longBook types.OrderBookEntry) { - k.SetLongBook(ctx, contractAddr, *longBook.(*types.LongBook)) -} - -func (k Keeper) GetLongBookByPrice(ctx sdk.Context, contractAddr string, price sdk.Dec, priceDenom string, assetDenom string) (val types.LongBook, found bool) { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - types.OrderBookPrefix( - true, contractAddr, priceDenom, assetDenom, - ), - ) - b := store.Get(GetKeyForPrice(price)) - if b == nil { - return val, false - } - k.Cdc.MustUnmarshal(b, &val) - return val, true -} - -func (k Keeper) GetLongOrderBookEntryByPrice(ctx sdk.Context, contractAddr string, price sdk.Dec, priceDenom string, assetDenom string) (types.OrderBookEntry, bool) { - entry, found := k.GetLongBookByPrice(ctx, contractAddr, price, priceDenom, assetDenom) - return &entry, found -} - -func (k Keeper) RemoveLongBookByPrice(ctx sdk.Context, contractAddr string, price sdk.Dec, priceDenom string, assetDenom string) { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - types.OrderBookPrefix( - true, contractAddr, priceDenom, assetDenom, - ), - ) - store.Delete(GetKeyForPrice(price)) -} - -// GetAllLongBook returns all longBook -func (k Keeper) GetAllLongBook(ctx sdk.Context, contractAddr string) (list []types.LongBook) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ContractKeyPrefix(types.LongBookKey, contractAddr)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.LongBook - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -func (k Keeper) GetAllLongBookForPair(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string) (list []types.OrderBookEntry) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(true, contractAddr, priceDenom, assetDenom)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.LongBook - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, &val) - } - - return -} - -func (k Keeper) GetTopNLongBooksForPair(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, n int) (list []types.OrderBookEntry) { - if n == 0 { - return - } - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(true, contractAddr, priceDenom, assetDenom)) - iterator := sdk.KVStoreReversePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.LongBook - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, &val) - if len(list) == n { - break - } - } - - return -} - -// Load the first (up to) N long book entries whose price are smaller than the specified limit -// in reverse sorted order. -// Parameters: -// -// n: the largest number of entries to load -// startExclusive: the price limit -func (k Keeper) GetTopNLongBooksForPairStarting(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, n int, startExclusive sdk.Dec) (list []types.OrderBookEntry) { - if n == 0 { - return - } - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(true, contractAddr, priceDenom, assetDenom)) - iterator := sdk.KVStoreReversePrefixIterator(store, []byte{}) - - defer iterator.Close() - - // Fast-forward - // TODO: add iterator interface that allows starting at a certain subkey under prefix - for ; iterator.Valid(); iterator.Next() { - key := dexutils.BytesToDec(iterator.Key()) - if key.LT(startExclusive) { - break - } - } - - for ; iterator.Valid(); iterator.Next() { - var val types.LongBook - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, &val) - if len(list) == n { - break - } - } - - return -} - -func (k Keeper) GetAllLongBookForPairPaginated(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, page *query.PageRequest) (list []types.LongBook, pageRes *query.PageResponse, err error) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(true, contractAddr, priceDenom, assetDenom)) - - pageRes, err = query.Paginate(store, page, func(key []byte, value []byte) error { - var longBook types.LongBook - if err := k.Cdc.Unmarshal(value, &longBook); err != nil { - return err - } - - list = append(list, longBook) - return nil - }) - - return -} - -func (k Keeper) GetLongAllocationForOrderID(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, price sdk.Dec, orderID uint64) (*types.Allocation, bool) { - orderBook, found := k.GetLongBookByPrice(ctx, contractAddr, price, priceDenom, assetDenom) - if !found { - return nil, false - } - for _, allocation := range orderBook.Entry.Allocations { - if allocation.OrderId == orderID { - return allocation, true - } - } - return nil, false -} - -func (k Keeper) RemoveAllLongBooksForContract(ctx sdk.Context, contractAddr string) { - k.removeAllForPrefix(ctx, types.OrderBookContractPrefix(true, contractAddr)) -} - -func GetKeyForLongBook(longBook types.LongBook) []byte { - return GetKeyForPrice(longBook.Entry.Price) -} - -func GetKeyForPrice(price sdk.Dec) []byte { - return dexutils.DecToBigEndian(price) -} diff --git a/x/dex/keeper/long_book_test.go b/x/dex/keeper/long_book_test.go deleted file mode 100644 index a515cf0b4..000000000 --- a/x/dex/keeper/long_book_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/testutil/nullify" - "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestLongBookGet(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - items := keepertest.CreateNLongBook(keeper, ctx, 10) - for i, item := range items { - got, found := keeper.GetLongBookByPrice(ctx, keepertest.TestContract, sdk.NewDec(int64(i)), keepertest.TestPriceDenom, keepertest.TestAssetDenom) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&got), - ) - } -} - -func TestLongBookRemove(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - items := keepertest.CreateNLongBook(keeper, ctx, 10) - for i := range items { - keeper.RemoveLongBookByPrice(ctx, keepertest.TestContract, sdk.NewDec(int64(i)), keepertest.TestPriceDenom, keepertest.TestAssetDenom) - _, found := keeper.GetLongBookByPrice(ctx, keepertest.TestContract, sdk.NewDec(int64(i)), keepertest.TestPriceDenom, keepertest.TestAssetDenom) - require.False(t, found) - } -} - -func TestLongBookGetAll(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - items := keepertest.CreateNLongBook(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllLongBook(ctx, keepertest.TestContract)), - ) -} - -func TestGetTopNLongBooksForPair(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - prices := []string{"9.99", "0.001", "90.0", "10", "10.01", "9.9", "9.0", "1"} - for _, price := range prices { - keeper.SetLongBook(ctx, keepertest.TestContract, types.LongBook{ - Price: sdk.MustNewDecFromStr(price), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr(price), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }) - } - expected := []sdk.Dec{ - sdk.MustNewDecFromStr("90.0"), - sdk.MustNewDecFromStr("10.01"), - sdk.MustNewDecFromStr("10"), - sdk.MustNewDecFromStr("9.99"), - sdk.MustNewDecFromStr("9.9"), - sdk.MustNewDecFromStr("9.0"), - sdk.MustNewDecFromStr("1"), - sdk.MustNewDecFromStr("0.001"), - } - loaded := keeper.GetTopNLongBooksForPair(ctx, keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom, 10) - require.Equal(t, expected, utils.Map(loaded, func(b types.OrderBookEntry) sdk.Dec { return b.GetPrice() })) -} - -func TestGetTopNLongBooksForPairStarting(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - prices := []string{"9.99", "0.001", "90.0", "10", "10.01", "9.9", "9.0", "1"} - for _, price := range prices { - keeper.SetLongBook(ctx, keepertest.TestContract, types.LongBook{ - Price: sdk.MustNewDecFromStr(price), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr(price), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }) - } - expected := []sdk.Dec{ - sdk.MustNewDecFromStr("9.99"), - sdk.MustNewDecFromStr("9.9"), - } - loaded := keeper.GetTopNLongBooksForPairStarting(ctx, keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom, 2, sdk.MustNewDecFromStr("9.999")) - require.Equal(t, expected, utils.Map(loaded, func(b types.OrderBookEntry) sdk.Dec { return b.GetPrice() })) -} diff --git a/x/dex/keeper/match_result.go b/x/dex/keeper/match_result.go deleted file mode 100644 index 09424196c..000000000 --- a/x/dex/keeper/match_result.go +++ /dev/null @@ -1,45 +0,0 @@ -package keeper - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -const MatchResultKey = "match-result" - -func (k Keeper) SetMatchResult(ctx sdk.Context, contractAddr string, result *types.MatchResult) { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - types.MatchResultPrefix(contractAddr), - ) - height := ctx.BlockHeight() - result.Height = height - result.ContractAddr = contractAddr - bz, err := result.Marshal() - if err != nil { - panic(err) - } - store.Set([]byte(MatchResultKey), bz) -} - -func (k Keeper) GetMatchResultState(ctx sdk.Context, contractAddr string) (*types.MatchResult, bool) { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - types.MatchResultPrefix(contractAddr), - ) - bz := store.Get([]byte(MatchResultKey)) - result := types.MatchResult{} - if err := result.Unmarshal(bz); err != nil { - panic(err) - } - return &result, true -} - -func (k Keeper) DeleteMatchResultState(ctx sdk.Context, contractAddr string) { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - types.MatchResultPrefix(contractAddr), - ) - store.Delete([]byte(MatchResultKey)) -} diff --git a/x/dex/keeper/msgserver/msg_server.go b/x/dex/keeper/msgserver/msg_server.go deleted file mode 100644 index 8d459eeb0..000000000 --- a/x/dex/keeper/msgserver/msg_server.go +++ /dev/null @@ -1,18 +0,0 @@ -package msgserver - -import ( - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -type msgServer struct { - keeper.Keeper -} - -// NewMsgServerImpl returns an implementation of the MsgServer interface -// for the provided Keeper. -func NewMsgServerImpl(keeper keeper.Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} -} - -var _ types.MsgServer = msgServer{} diff --git a/x/dex/keeper/msgserver/msg_server_cancel_orders.go b/x/dex/keeper/msgserver/msg_server_cancel_orders.go deleted file mode 100644 index 8ca3a4a1d..000000000 --- a/x/dex/keeper/msgserver/msg_server_cancel_orders.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) CancelOrders(goCtx context.Context, msg *types.MsgCancelOrders) (*types.MsgCancelOrdersResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_cancel_orders_test.go b/x/dex/keeper/msgserver/msg_server_cancel_orders_test.go deleted file mode 100644 index 88f88473c..000000000 --- a/x/dex/keeper/msgserver/msg_server_cancel_orders_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package msgserver_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestCancelOrder(t *testing.T) { - // store a long limit order to the orderbook - keeper, ctx := keepertest.DexKeeper(t) - - // cancel order - msg := &types.MsgCancelOrders{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - Cancellations: []*types.Cancellation{ - { - Price: sdk.OneDec(), - PositionDirection: types.PositionDirection_LONG, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Id: 1, - }, - }, - } - wctx := sdk.WrapSDKContext(ctx) - server := msgserver.NewMsgServerImpl(*keeper) - _, err := server.CancelOrders(wctx, msg) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/msg_server_contract_deposit_rent.go b/x/dex/keeper/msgserver/msg_server_contract_deposit_rent.go deleted file mode 100644 index d1a4cf329..000000000 --- a/x/dex/keeper/msgserver/msg_server_contract_deposit_rent.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) ContractDepositRent(goCtx context.Context, msg *types.MsgContractDepositRent) (*types.MsgContractDepositRentResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_contract_deposit_rent_test.go b/x/dex/keeper/msgserver/msg_server_contract_deposit_rent_test.go deleted file mode 100644 index 894ba170e..000000000 --- a/x/dex/keeper/msgserver/msg_server_contract_deposit_rent_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package msgserver_test - -import ( - "context" - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -func TestDepositRent(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - dexkeeper := testApp.DexKeeper - - depositAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - - handler := dex.NewHandler(dexkeeper) - _, err := handler(ctx, &types.MsgContractDepositRent{ - Sender: depositAccount.String(), - ContractAddr: TestContractA, - Amount: types.DefaultParams().MinRentDeposit, - }) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/msg_server_place_orders.go b/x/dex/keeper/msgserver/msg_server_place_orders.go deleted file mode 100644 index ae7a70700..000000000 --- a/x/dex/keeper/msgserver/msg_server_place_orders.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) PlaceOrders(goCtx context.Context, msg *types.MsgPlaceOrders) (*types.MsgPlaceOrdersResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_place_orders_fuzz_test.go b/x/dex/keeper/msgserver/msg_server_place_orders_fuzz_test.go deleted file mode 100644 index ec88e75db..000000000 --- a/x/dex/keeper/msgserver/msg_server_place_orders_fuzz_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package msgserver_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - fuzzutils "github.com/sei-protocol/sei-chain/testutil/fuzzing" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func FuzzPlaceOrders(f *testing.F) { - f.Add(uint64(0), int32(0), 2, 2, int64(10), false, int64(2), false, keepertest.TestPriceDenom, keepertest.TestAssetDenom, int32(0), int32(0), "", "", false, int64(20)) - f.Fuzz(fuzzTargetPlaceOrders) -} - -func fuzzTargetPlaceOrders( - t *testing.T, - id uint64, - status int32, - accountIdx int, - contractIdx int, - priceI int64, - priceIsNil bool, - quantityI int64, - quantityIsNil bool, - priceDenom string, - assetDenom string, - orderType int32, - positionDirection int32, - data string, - statusDescription string, - fundIsNil bool, - fundAmount int64, -) { - keeper, ctx := keepertest.DexKeeper(t) - contract := fuzzutils.GetContract(contractIdx) - keeper.AddRegisteredPair(ctx, contract, keepertest.TestPair) - keeper.SetPriceTickSizeForPair(ctx, TestContract, keepertest.TestPair, *keepertest.TestPair.PriceTicksize) - keeper.SetQuantityTickSizeForPair(ctx, TestContract, keepertest.TestPair, *keepertest.TestPair.QuantityTicksize) - wctx := sdk.WrapSDKContext(ctx) - msg := &types.MsgPlaceOrders{ - Creator: fuzzutils.GetAccount(accountIdx), - ContractAddr: contract, - Orders: []*types.Order{ - { - Id: id, - Status: types.OrderStatus(status), - Price: fuzzutils.FuzzDec(priceI, priceIsNil), - Quantity: fuzzutils.FuzzDec(quantityI, quantityIsNil), - Data: data, - StatusDescription: statusDescription, - PositionDirection: types.PositionDirection(positionDirection), - OrderType: types.OrderType(orderType), - PriceDenom: priceDenom, - AssetDenom: assetDenom, - }, - }, - Funds: []sdk.Coin{fuzzutils.FuzzCoin(priceDenom, fundIsNil, fundAmount)}, - } - server := msgserver.NewMsgServerImpl(*keeper) - require.NotPanics(t, func() { server.PlaceOrders(wctx, msg) }) -} diff --git a/x/dex/keeper/msgserver/msg_server_place_orders_test.go b/x/dex/keeper/msgserver/msg_server_place_orders_test.go deleted file mode 100644 index d14e3e532..000000000 --- a/x/dex/keeper/msgserver/msg_server_place_orders_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package msgserver_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -const ( - TestCreator = "sei1ewxvf5a9wq9zk5nurtl6m9yfxpnhyp7s7uk5sl" - TestContract = "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m" -) - -func TestPlaceOrder(t *testing.T) { - msg := &types.MsgPlaceOrders{ - Creator: TestCreator, - ContractAddr: TestContract, - Orders: []*types.Order{ - { - Price: sdk.MustNewDecFromStr("10"), - Quantity: sdk.MustNewDecFromStr("10"), - Data: "", - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_LIMIT, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - { - Price: sdk.MustNewDecFromStr("20"), - Quantity: sdk.MustNewDecFromStr("5"), - Data: "", - PositionDirection: types.PositionDirection_SHORT, - OrderType: types.OrderType_MARKET, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }, - } - keeper, ctx := keepertest.DexKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - server := msgserver.NewMsgServerImpl(*keeper) - _, err := server.PlaceOrders(wctx, msg) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/msg_server_register_contract.go b/x/dex/keeper/msgserver/msg_server_register_contract.go deleted file mode 100644 index 77bec2bd4..000000000 --- a/x/dex/keeper/msgserver/msg_server_register_contract.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) RegisterContract(goCtx context.Context, msg *types.MsgRegisterContract) (*types.MsgRegisterContractResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_register_contract_test.go b/x/dex/keeper/msgserver/msg_server_register_contract_test.go deleted file mode 100644 index c4bcc6e1c..000000000 --- a/x/dex/keeper/msgserver/msg_server_register_contract_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package msgserver_test - -import ( - "context" - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -const ( - TestContractA = "sei1hrpna9v7vs3stzyd4z3xf00676kf78zpe2u5ksvljswn2vnjp3yslucc3n" -) - -func TestRegisterContract(t *testing.T) { - // Instantiate and get contract address - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - wctx := sdk.WrapSDKContext(ctx) - keeper := testApp.DexKeeper - - server := msgserver.NewMsgServerImpl(keeper) - _, err := server.RegisterContract(wctx, &types.MsgRegisterContract{}) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/msg_server_register_pairs.go b/x/dex/keeper/msgserver/msg_server_register_pairs.go deleted file mode 100644 index 582521dd5..000000000 --- a/x/dex/keeper/msgserver/msg_server_register_pairs.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) RegisterPairs(goCtx context.Context, msg *types.MsgRegisterPairs) (*types.MsgRegisterPairsResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_register_pairs_test.go b/x/dex/keeper/msgserver/msg_server_register_pairs_test.go deleted file mode 100644 index bc4dc9198..000000000 --- a/x/dex/keeper/msgserver/msg_server_register_pairs_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package msgserver_test - -import ( - "context" - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -func TestRegisterPairs(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - wctx := sdk.WrapSDKContext(ctx) - keeper := testApp.DexKeeper - - server := msgserver.NewMsgServerImpl(keeper) - - batchContractPairs := []types.BatchContractPair{} - batchContractPairs = append(batchContractPairs, types.BatchContractPair{ - ContractAddr: TestContractA, - Pairs: []*types.Pair{&keepertest.TestPair}, - }) - _, err := server.RegisterPairs(wctx, &types.MsgRegisterPairs{ - Creator: keepertest.TestAccount, - Batchcontractpair: batchContractPairs, - }) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/msg_server_unregister_contract.go b/x/dex/keeper/msgserver/msg_server_unregister_contract.go deleted file mode 100644 index c12650b85..000000000 --- a/x/dex/keeper/msgserver/msg_server_unregister_contract.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) UnregisterContract(goCtx context.Context, msg *types.MsgUnregisterContract) (*types.MsgUnregisterContractResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_unregister_contract_test.go b/x/dex/keeper/msgserver/msg_server_unregister_contract_test.go deleted file mode 100644 index 2d91979a7..000000000 --- a/x/dex/keeper/msgserver/msg_server_unregister_contract_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package msgserver_test - -import ( - "context" - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -func TestUnregisterContractSetSiblings(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - keeper := testApp.DexKeeper - - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - - handler := dex.NewHandler(keeper) - - _, err := handler(ctx, &types.MsgUnregisterContract{ - Creator: testAccount.String(), - ContractAddr: TestContractA, - }) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/msg_server_unsuspend_contract.go b/x/dex/keeper/msgserver/msg_server_unsuspend_contract.go deleted file mode 100644 index d1da8c2c5..000000000 --- a/x/dex/keeper/msgserver/msg_server_unsuspend_contract.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) UnsuspendContract(goCtx context.Context, msg *types.MsgUnsuspendContract) (*types.MsgUnsuspendContractResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_unsuspend_contract_test.go b/x/dex/keeper/msgserver/msg_server_unsuspend_contract_test.go deleted file mode 100644 index a2ac0f3ac..000000000 --- a/x/dex/keeper/msgserver/msg_server_unsuspend_contract_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package msgserver_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestUnsuspendContract(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - server := msgserver.NewMsgServerImpl(*keeper) - _, err := server.UnsuspendContract(wctx, &types.MsgUnsuspendContract{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - }) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/msg_server_update_price_tick_size.go b/x/dex/keeper/msgserver/msg_server_update_price_tick_size.go deleted file mode 100644 index 6a09e1dc7..000000000 --- a/x/dex/keeper/msgserver/msg_server_update_price_tick_size.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) UpdatePriceTickSize(goCtx context.Context, msg *types.MsgUpdatePriceTickSize) (*types.MsgUpdateTickSizeResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_update_price_tick_size_test.go b/x/dex/keeper/msgserver/msg_server_update_price_tick_size_test.go deleted file mode 100644 index 77ab54fae..000000000 --- a/x/dex/keeper/msgserver/msg_server_update_price_tick_size_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package msgserver_test - -import ( - "context" - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -func TestUpdatePriceTickSize(t *testing.T) { - // Instantiate and get contract address - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - wctx := sdk.WrapSDKContext(ctx) - keeper := testApp.DexKeeper - server := msgserver.NewMsgServerImpl(keeper) - - // Test updated tick size - tickUpdates := []types.TickSize{} - tickUpdates = append(tickUpdates, types.TickSize{ - ContractAddr: TestContractA, - Pair: &keepertest.TestPair, - Ticksize: sdk.MustNewDecFromStr("0.1"), - }) - _, err := server.UpdatePriceTickSize(wctx, &types.MsgUpdatePriceTickSize{ - Creator: keepertest.TestAccount, - TickSizeList: tickUpdates, - }) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/msg_server_update_quantity_tick_size.go b/x/dex/keeper/msgserver/msg_server_update_quantity_tick_size.go deleted file mode 100644 index f4e948a54..000000000 --- a/x/dex/keeper/msgserver/msg_server_update_quantity_tick_size.go +++ /dev/null @@ -1,12 +0,0 @@ -package msgserver - -import ( - "context" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k msgServer) UpdateQuantityTickSize(goCtx context.Context, msg *types.MsgUpdateQuantityTickSize) (*types.MsgUpdateTickSizeResponse, error) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated") -} diff --git a/x/dex/keeper/msgserver/msg_server_update_quantity_tick_size_test.go b/x/dex/keeper/msgserver/msg_server_update_quantity_tick_size_test.go deleted file mode 100644 index eccbf9e45..000000000 --- a/x/dex/keeper/msgserver/msg_server_update_quantity_tick_size_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package msgserver_test - -import ( - "context" - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -func TestUpdateQuantityTickSize(t *testing.T) { - // Instantiate and get contract address - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - wctx := sdk.WrapSDKContext(ctx) - keeper := testApp.DexKeeper - - server := msgserver.NewMsgServerImpl(keeper) - - // Test updated tick size - tickUpdates := []types.TickSize{} - tickUpdates = append(tickUpdates, types.TickSize{ - ContractAddr: TestContractA, - Pair: &keepertest.TestPair, - Ticksize: sdk.MustNewDecFromStr("0.1"), - }) - _, err := server.UpdateQuantityTickSize(wctx, &types.MsgUpdateQuantityTickSize{ - Creator: keepertest.TestAccount, - TickSizeList: tickUpdates, - }) - require.EqualError(t, err, sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "deprecated").Error()) -} diff --git a/x/dex/keeper/msgserver/testdata/hackatom.wasm b/x/dex/keeper/msgserver/testdata/hackatom.wasm deleted file mode 100644 index 183eef304c9de413a24884ec6611ee0d13434fae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208805 zcmeFaeZ1XQUFZ9I*iYx|eNJ|snuiwn?QI56?j&RImZX$k%`Y}>8R}4-I=3?~UpAFi z+tX6o5PFN3R}-YrAVC8b2^wdjRtVZUWiDvA(|bKQ84Xxwf_AO}iiWX+VJzH;y<<_4 z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wg%aQxwVE5FxWASxbRC)6#h~EKEo7MN|=GahN)o+GU*-^JyZri=(TI zfFmFlN=nP0!V?NY2f-Jw)mArg(o_VH#q*2_q zpqNL?IrD5zHB~5H=DxkU)coTR0nzb%dJwlc^J#;9f@1CoXFBq!3?wa>8<(Av9B{Q$ zi+!>PEJMRkey`NOrfr-(nGjx-J)$TRhnQo&Gf?ReesVaD4a;>*ua?b(#<=KKoNXt) z;Nszl@XqF+c=%3u9}2GbQtoL8vtt&Z_QRA>n-^Z+)LH9`y4D4CEzQQ0C z(z1QPGOBXx_g?$CE= zrjC>@eSl-8vDAp?izRU(~IL&u5kQSbZ|Vk08}XpVA+G=4^`T<yB2u!|nh2#Jr%3qMC02!0){@XW3<}}DLwN-7)A4wT{W6!e z0>m~F=tiEC5&i=D8fXBmg}f+I6|Z3Rj(|xaG%_bbGoU+DFx=6D@cja00PPIa#j-+B zewdy(R7S_Jcc>@jB?*gJ^l`!&)Gr|?O5u?Uu(&M@JWwd*#CalDZ(ikwuiXa=U4;G( D^F!=F diff --git a/x/dex/keeper/msgserver/validations.go b/x/dex/keeper/msgserver/validations.go deleted file mode 100644 index cdbbb0647..000000000 --- a/x/dex/keeper/msgserver/validations.go +++ /dev/null @@ -1,40 +0,0 @@ -package msgserver - -import ( - "fmt" - "math" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// Since cosmwasm would amplify gas limit by a multiplier for its internal gas metering, -// we want to make sure the amplified result doesn't exceed uint64 limit. -func (k msgServer) ValidateRentBalance(ctx sdk.Context, rentBalance uint64) error { - maxAllowedRent := k.maxAllowedRentBalance() - minAllowedRent := k.minAllowedRentBalance(ctx) - if rentBalance > maxAllowedRent || rentBalance < minAllowedRent { - return fmt.Errorf("rent balance %d is either bigger than the maximum allowed rent balance %d, or smaller than the minimal allowed balance %d", - rentBalance, maxAllowedRent, minAllowedRent) - } - return nil -} - -func (k msgServer) ValidateSuspension(ctx sdk.Context, contractAddress string) error { - contract, err := k.GetContract(ctx, contractAddress) - if err == nil && contract.Suspended { - return types.ErrContractSuspended - } - return nil -} - -func (k msgServer) maxAllowedRentBalance() uint64 { - // TODO: replace with a wasm keeper query once its gas registry is made public - return uint64(math.MaxUint64) / wasmkeeper.DefaultGasMultiplier -} - -func (k msgServer) minAllowedRentBalance(ctx sdk.Context) uint64 { - params := k.GetParams(ctx) - return params.MinRentDeposit -} diff --git a/x/dex/keeper/order_count.go b/x/dex/keeper/order_count.go deleted file mode 100644 index 5b72366cb..000000000 --- a/x/dex/keeper/order_count.go +++ /dev/null @@ -1,56 +0,0 @@ -package keeper - -import ( - "encoding/binary" - "fmt" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k Keeper) SetOrderCount(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, direction types.PositionDirection, price sdk.Dec, count uint64) error { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - types.OrderCountPrefix(contractAddr, priceDenom, assetDenom, direction == types.PositionDirection_LONG), - ) - key, err := price.Marshal() - if err != nil { - return err - } - value := make([]byte, 8) - binary.BigEndian.PutUint64(value, count) - store.Set(key, value) - return nil -} - -func (k Keeper) GetOrderCountState(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, direction types.PositionDirection, price sdk.Dec) uint64 { - store := prefix.NewStore( - ctx.KVStore(k.storeKey), - types.OrderCountPrefix(contractAddr, priceDenom, assetDenom, direction == types.PositionDirection_LONG), - ) - key, err := price.Marshal() - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error marshal provided price %s due to %s", price.String(), err)) - return 0 - } - value := store.Get(key) - if value == nil { - return 0 - } - return binary.BigEndian.Uint64(value) -} - -func (k Keeper) DecreaseOrderCount(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, direction types.PositionDirection, price sdk.Dec, count uint64) error { - oldCount := k.GetOrderCountState(ctx, contractAddr, priceDenom, assetDenom, direction, price) - newCount := uint64(0) - if oldCount > count { - newCount = oldCount - count - } - return k.SetOrderCount(ctx, contractAddr, priceDenom, assetDenom, direction, price, newCount) -} - -func (k Keeper) IncreaseOrderCount(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, direction types.PositionDirection, price sdk.Dec, count uint64) error { - oldCount := k.GetOrderCountState(ctx, contractAddr, priceDenom, assetDenom, direction, price) - return k.SetOrderCount(ctx, contractAddr, priceDenom, assetDenom, direction, price, oldCount+count) -} diff --git a/x/dex/keeper/order_count_test.go b/x/dex/keeper/order_count_test.go deleted file mode 100644 index 1fe604933..000000000 --- a/x/dex/keeper/order_count_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetSetOrderCount(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - for _, direction := range []types.PositionDirection{ - types.PositionDirection_LONG, - types.PositionDirection_SHORT, - } { - require.Equal(t, uint64(0), keeper.GetOrderCountState(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, direction, sdk.NewDec(1))) - require.Nil(t, keeper.SetOrderCount(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, direction, sdk.NewDec(1), 5)) - require.Equal(t, uint64(5), keeper.GetOrderCountState(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, direction, sdk.NewDec(1))) - } -} - -func TestIncreaseOrderCount(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.IncreaseOrderCount(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(1), 10) - require.Equal(t, uint64(10), keeper.GetOrderCountState(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(1))) -} - -func TestDecreaseOrderCount(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - require.Nil(t, keeper.SetOrderCount(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(1), 10)) - keeper.DecreaseOrderCount(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(1), 5) - require.Equal(t, uint64(5), keeper.GetOrderCountState(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(1))) -} diff --git a/x/dex/keeper/order_placement.go b/x/dex/keeper/order_placement.go deleted file mode 100644 index b6d5fcec6..000000000 --- a/x/dex/keeper/order_placement.go +++ /dev/null @@ -1,33 +0,0 @@ -package keeper - -import ( - "encoding/binary" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k Keeper) GetNextOrderID(ctx sdk.Context, contractAddr string) uint64 { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.NextOrderIDPrefix(contractAddr)) - byteKey := types.KeyPrefix(types.NextOrderIDKey) - bz := store.Get(byteKey) - if bz == nil { - return 0 - } - return binary.BigEndian.Uint64(bz) -} - -func (k Keeper) SetNextOrderID(ctx sdk.Context, contractAddr string, nextID uint64) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.NextOrderIDPrefix(contractAddr)) - byteKey := types.KeyPrefix(types.NextOrderIDKey) - bz := make([]byte, 8) - binary.BigEndian.PutUint64(bz, nextID) - store.Set(byteKey, bz) -} - -func (k Keeper) DeleteNextOrderID(ctx sdk.Context, contractAddr string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.NextOrderIDPrefix(contractAddr)) - byteKey := types.KeyPrefix(types.NextOrderIDKey) - store.Delete(byteKey) -} diff --git a/x/dex/keeper/pair.go b/x/dex/keeper/pair.go deleted file mode 100644 index 914131cc9..000000000 --- a/x/dex/keeper/pair.go +++ /dev/null @@ -1,56 +0,0 @@ -package keeper - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k Keeper) AddRegisteredPair(ctx sdk.Context, contractAddr string, pair types.Pair) bool { - // only add pairs that haven't been added before - if k.HasRegisteredPair(ctx, contractAddr, pair.PriceDenom, pair.AssetDenom) { - return false - } - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RegisteredPairPrefix(contractAddr)) - store.Set(types.PairPrefix(pair.PriceDenom, pair.AssetDenom), k.Cdc.MustMarshal(&pair)) - return true -} - -func (k Keeper) HasRegisteredPair(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string) bool { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RegisteredPairPrefix(contractAddr)) - return store.Has(types.PairPrefix(priceDenom, assetDenom)) -} - -func (k Keeper) GetRegisteredPair(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string) (types.Pair, bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RegisteredPairPrefix(contractAddr)) - b := store.Get(types.PairPrefix(priceDenom, assetDenom)) - res := types.Pair{} - if b == nil { - return res, false - } - err := res.Unmarshal(b) - if err != nil { - panic(err) - } - return res, true -} - -func (k Keeper) GetAllRegisteredPairs(ctx sdk.Context, contractAddr string) []types.Pair { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RegisteredPairPrefix(contractAddr)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - list := []types.Pair{} - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Pair - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return list -} - -func (k Keeper) DeleteAllRegisteredPairsForContract(ctx sdk.Context, contractAddr string) { - k.removeAllForPrefix(ctx, types.RegisteredPairPrefix(contractAddr)) -} diff --git a/x/dex/keeper/pair_test.go b/x/dex/keeper/pair_test.go deleted file mode 100644 index 8dcbe65d2..000000000 --- a/x/dex/keeper/pair_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package keeper_test - -import ( - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/testutil/nullify" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestAddGetPair(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.AddRegisteredPair(ctx, keepertest.TestContract, types.Pair{ - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - PriceTicksize: &keepertest.TestTicksize, - QuantityTicksize: &keepertest.TestTicksize, - }) - require.ElementsMatch(t, - nullify.Fill([]types.Pair{{ - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - PriceTicksize: &keepertest.TestTicksize, - QuantityTicksize: &keepertest.TestTicksize, - }}), - nullify.Fill(keeper.GetAllRegisteredPairs(ctx, keepertest.TestContract)), - ) - - pair, found := keeper.GetRegisteredPair(ctx, keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom) - require.True(t, found) - require.Equal(t, types.Pair{ - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - PriceTicksize: &keepertest.TestTicksize, - QuantityTicksize: &keepertest.TestTicksize, - }, pair) - hasPair := keeper.HasRegisteredPair(ctx, keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom) - require.True(t, hasPair) - -} diff --git a/x/dex/keeper/params.go b/x/dex/keeper/params.go deleted file mode 100644 index 2e4c77c02..000000000 --- a/x/dex/keeper/params.go +++ /dev/null @@ -1,42 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - params := types.Params{} - k.Paramstore.GetParamSet(ctx, ¶ms) - return params -} - -func (k Keeper) GetSettlementGasAllowance(ctx sdk.Context, numSettlements int) uint64 { - return k.GetParams(ctx).GasAllowancePerSettlement * uint64(numSettlements) -} - -func (k Keeper) GetMinProcessableRent(ctx sdk.Context) uint64 { - return k.GetParams(ctx).MinProcessableRent -} - -func (k Keeper) GetOrderBookEntriesPerLoad(ctx sdk.Context) uint64 { - return k.GetParams(ctx).OrderBookEntriesPerLoad -} - -func (k Keeper) GetContractUnsuspendCost(ctx sdk.Context) uint64 { - return k.GetParams(ctx).ContractUnsuspendCost -} - -func (k Keeper) GetMaxOrderPerPrice(ctx sdk.Context) uint64 { - return k.GetParams(ctx).MaxOrderPerPrice -} - -func (k Keeper) GetMaxPairsPerContract(ctx sdk.Context) uint64 { - return k.GetParams(ctx).MaxPairsPerContract -} - -// SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.Paramstore.SetParamSet(ctx, ¶ms) -} diff --git a/x/dex/keeper/params_test.go b/x/dex/keeper/params_test.go deleted file mode 100644 index 1bbab914e..000000000 --- a/x/dex/keeper/params_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package keeper_test - -import ( - "testing" - - testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetParams(t *testing.T) { - k, ctx := testkeeper.DexKeeper(t) - params := types.DefaultParams() - - k.SetParams(ctx, params) - - require.EqualValues(t, params, k.GetParams(ctx)) -} - -func TestGetSettlementGasAllowance(t *testing.T) { - k, ctx := testkeeper.DexKeeper(t) - gasAllowance := k.GetSettlementGasAllowance(ctx, 10) - require.Equal(t, uint64(10)*types.DefaultGasAllowancePerSettlement, gasAllowance) -} diff --git a/x/dex/keeper/price.go b/x/dex/keeper/price.go deleted file mode 100644 index d18cc1ce0..000000000 --- a/x/dex/keeper/price.go +++ /dev/null @@ -1,98 +0,0 @@ -package keeper - -import ( - "encoding/binary" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k Keeper) SetPriceState(ctx sdk.Context, price types.Price, contractAddr string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PricePrefix(contractAddr, price.Pair.PriceDenom, price.Pair.AssetDenom)) - b := k.Cdc.MustMarshal(&price) - store.Set(GetKeyForTs(price.SnapshotTimestampInSeconds), b) -} - -func (k Keeper) DeletePriceStateBefore(ctx sdk.Context, contractAddr string, timestamp uint64, pair types.Pair) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PricePrefix(contractAddr, pair.PriceDenom, pair.AssetDenom)) - for _, key := range k.GetPriceKeysToDelete(store, timestamp) { - store.Delete(key) - } -} - -func (k Keeper) GetPriceKeysToDelete(store sdk.KVStore, timestamp uint64) [][]byte { - keys := [][]byte{} - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - defer iterator.Close() - - // Since timestamp is encoded in big endian, the first price being iterated has the smallest timestamp. - for ; iterator.Valid(); iterator.Next() { - priceKey := iterator.Key() - priceTs := binary.BigEndian.Uint64(priceKey) - if priceTs < timestamp { - keys = append(keys, priceKey) - } else { - break - } - } - return keys -} - -func (k Keeper) GetPriceState(ctx sdk.Context, contractAddr string, timestamp uint64, pair types.Pair) (types.Price, bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PricePrefix(contractAddr, pair.PriceDenom, pair.AssetDenom)) - res := types.Price{} - key := GetKeyForTs(timestamp) - if !store.Has(key) { - res.Pair = &pair - return res, false - } - b := store.Get(key) - k.Cdc.MustUnmarshal(b, &res) - return res, true -} - -func (k Keeper) GetAllPrices(ctx sdk.Context, contractAddr string, pair types.Pair) (list []*types.Price) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PricePrefix(contractAddr, pair.PriceDenom, pair.AssetDenom)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Price - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, &val) - } - - return -} - -func (k Keeper) GetPricesForTwap(ctx sdk.Context, contractAddr string, pair types.Pair, lookback uint64) (list []*types.Price) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PricePrefix(contractAddr, pair.PriceDenom, pair.AssetDenom)) - iterator := sdk.KVStoreReversePrefixIterator(store, []byte{}) - - defer iterator.Close() - - cutoff := uint64(ctx.BlockTime().Unix()) - lookback - for ; iterator.Valid(); iterator.Next() { - var val types.Price - k.Cdc.MustUnmarshal(iterator.Value(), &val) - // add to list before breaking since we want to include one older price if there is any - list = append(list, &val) - if val.SnapshotTimestampInSeconds < cutoff { - break - } - } - - return -} - -func (k Keeper) RemoveAllPricesForContract(ctx sdk.Context, contractAddr string) { - k.removeAllForPrefix(ctx, types.PriceContractPrefix(contractAddr)) -} - -func GetKeyForTs(ts uint64) []byte { - tsKey := make([]byte, 8) - binary.BigEndian.PutUint64(tsKey, ts) - return tsKey -} diff --git a/x/dex/keeper/price_test.go b/x/dex/keeper/price_test.go deleted file mode 100644 index fa519d47c..000000000 --- a/x/dex/keeper/price_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package keeper_test - -import ( - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/stretchr/testify/require" -) - -func TestDeletePriceStateBefore(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 1) - keepertest.SeedPriceSnapshot(ctx, keeper, "101", 2) - keepertest.SeedPriceSnapshot(ctx, keeper, "99", 3) - keeper.DeletePriceStateBefore(ctx, keepertest.TestContract, 2, keepertest.TestPair) - prices := keeper.GetAllPrices(ctx, keepertest.TestContract, keepertest.TestPair) - require.Equal(t, 2, len(prices)) - require.Equal(t, uint64(2), prices[0].SnapshotTimestampInSeconds) - require.Equal(t, uint64(3), prices[1].SnapshotTimestampInSeconds) -} diff --git a/x/dex/keeper/query/grpc_query.go b/x/dex/keeper/query/grpc_query.go deleted file mode 100644 index 2cc5e787e..000000000 --- a/x/dex/keeper/query/grpc_query.go +++ /dev/null @@ -1,7 +0,0 @@ -package query - -import ( - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -var _ types.QueryServer = KeeperWrapper{} diff --git a/x/dex/keeper/query/grpc_query_asset_list.go b/x/dex/keeper/query/grpc_query_asset_list.go deleted file mode 100644 index fc7748be9..000000000 --- a/x/dex/keeper/query/grpc_query_asset_list.go +++ /dev/null @@ -1,36 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) AssetList(c context.Context, req *types.QueryAssetListRequest) (*types.QueryAssetListResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - allAssetMetadata := k.GetAllAssetMetadata(ctx) - - return &types.QueryAssetListResponse{AssetList: allAssetMetadata}, nil -} - -func (k KeeperWrapper) AssetMetadata(c context.Context, req *types.QueryAssetMetadataRequest) (*types.QueryAssetMetadataResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - assetMetadata, found := k.GetAssetMetadataByDenom(ctx, req.Denom) - if !found { - return nil, sdkerrors.ErrKeyNotFound - } - - return &types.QueryAssetMetadataResponse{Metadata: &assetMetadata}, nil -} diff --git a/x/dex/keeper/query/grpc_query_asset_list_test.go b/x/dex/keeper/query/grpc_query_asset_list_test.go deleted file mode 100644 index b2bd8a4a9..000000000 --- a/x/dex/keeper/query/grpc_query_asset_list_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestAssetListQuery(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - item := keepertest.CreateAssetMetadata(keeper, ctx) - - var expectedAssetList []types.AssetMetadata - expectedAssetList = append(expectedAssetList, item) - - request := types.QueryAssetListRequest{} - expectedResponse := types.QueryAssetListResponse{ - AssetList: expectedAssetList, - } - wrapper := query.KeeperWrapper{Keeper: keeper} - t.Run("Asset list query", func(t *testing.T) { - response, err := wrapper.AssetList(wctx, &request) - require.NoError(t, err) - require.Equal(t, expectedResponse, *response) - }) -} - -func TestAssetMetadataQuery(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - expectedMetadata := keepertest.CreateAssetMetadata(keeper, ctx) - - request := types.QueryAssetMetadataRequest{ - Denom: "axlusdc", - } - expectedResponse := types.QueryAssetMetadataResponse{ - Metadata: &expectedMetadata, - } - wrapper := query.KeeperWrapper{Keeper: keeper} - t.Run("Asset metadata query", func(t *testing.T) { - response, err := wrapper.AssetMetadata(wctx, &request) - require.NoError(t, err) - require.Equal(t, expectedResponse, *response) - }) -} diff --git a/x/dex/keeper/query/grpc_query_get_historical_prices.go b/x/dex/keeper/query/grpc_query_get_historical_prices.go deleted file mode 100644 index 9e6dc434f..000000000 --- a/x/dex/keeper/query/grpc_query_get_historical_prices.go +++ /dev/null @@ -1,119 +0,0 @@ -package query - -import ( - "context" - "sort" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -var ZeroPrice = sdk.ZeroDec() - -func (k KeeperWrapper) GetHistoricalPrices(goCtx context.Context, req *types.QueryGetHistoricalPricesRequest) (*types.QueryGetHistoricalPricesResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - prices := k.GetAllPrices(ctx, req.ContractAddr, types.Pair{PriceDenom: req.PriceDenom, AssetDenom: req.AssetDenom}) - currentTimeStamp := uint64(ctx.BlockTime().Unix()) - beginTimestamp := currentTimeStamp - req.NumOfPeriods*req.PeriodLengthInSeconds - // sort descending - sort.Slice(prices, func(i, j int) bool { - return prices[i].SnapshotTimestampInSeconds > prices[j].SnapshotTimestampInSeconds - }) - validPrices := []*types.Price{} - for _, price := range prices { - // append early so that we include the latest price before beginTimestamp, since - // we need it to set the open price of the first period. - if price.SnapshotTimestampInSeconds < currentTimeStamp { - validPrices = append(validPrices, price) - } - if price.SnapshotTimestampInSeconds < beginTimestamp { - break - } - } - - candlesticks := make([]*types.PriceCandlestick, req.NumOfPeriods) - - // set timestamp - for i := range candlesticks { - candlesticks[i] = &types.PriceCandlestick{} - candlesticks[i].EndTimestamp = currentTimeStamp - uint64(i)*req.PeriodLengthInSeconds - candlesticks[i].BeginTimestamp = candlesticks[i].EndTimestamp - req.PeriodLengthInSeconds - } - - // set open - pricePtr := 0 - for i := range candlesticks { - for pricePtr < len(validPrices) && validPrices[pricePtr].SnapshotTimestampInSeconds > candlesticks[i].BeginTimestamp { - pricePtr++ - } - if pricePtr < len(validPrices) { - candlesticks[i].Open = &validPrices[pricePtr].Price - } else { - // this would happen if the earliest price point available is after the begin timestamp - candlesticks[i].Open = &ZeroPrice - } - } - - // set close - pricePtr = 0 - for i := range candlesticks { - for pricePtr < len(validPrices) && validPrices[pricePtr].SnapshotTimestampInSeconds >= candlesticks[i].EndTimestamp { - pricePtr++ - } - if pricePtr < len(validPrices) { - candlesticks[i].Close = &validPrices[pricePtr].Price - } else { - // this would happen if the earliest price point available is after the first end timestamp - candlesticks[i].Close = &ZeroPrice - } - } - - // set high - pricePtr = 0 - for i := range candlesticks { - // initialize to the open price - candlesticks[i].High = candlesticks[i].Open - set := false - for pricePtr < len(validPrices) { - price := validPrices[pricePtr] - if price.SnapshotTimestampInSeconds < candlesticks[i].BeginTimestamp || price.SnapshotTimestampInSeconds >= candlesticks[i].EndTimestamp { - break - } - if !set || price.Price.GT(*candlesticks[i].High) { - set = true - candlesticks[i].High = &price.Price - } - pricePtr++ - } - } - - // set low - pricePtr = 0 - for i := range candlesticks { - // initialize to the open price - candlesticks[i].Low = candlesticks[i].Open - set := false - for pricePtr < len(validPrices) { - price := validPrices[pricePtr] - if price.SnapshotTimestampInSeconds < candlesticks[i].BeginTimestamp || price.SnapshotTimestampInSeconds >= candlesticks[i].EndTimestamp { - break - } - if !set || price.Price.LT(*candlesticks[i].Low) { - set = true - candlesticks[i].Low = &price.Price - } - pricePtr++ - } - } - - return &types.QueryGetHistoricalPricesResponse{ - Prices: candlesticks, - }, nil -} diff --git a/x/dex/keeper/query/grpc_query_get_historical_prices_test.go b/x/dex/keeper/query/grpc_query_get_historical_prices_test.go deleted file mode 100644 index 29b62f942..000000000 --- a/x/dex/keeper/query/grpc_query_get_historical_prices_test.go +++ /dev/null @@ -1,185 +0,0 @@ -package query_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestEachPeriodOneDataPoint(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 1) - keepertest.SeedPriceSnapshot(ctx, keeper, "101", 2) - keepertest.SeedPriceSnapshot(ctx, keeper, "99", 3) // should not be included since end is exclusive - - ctx = ctx.WithBlockTime(time.Unix(3, 0)) - wctx := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: keeper} - resp, err := wrapper.GetHistoricalPrices(wctx, &types.QueryGetHistoricalPricesRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - PeriodLengthInSeconds: 1, - NumOfPeriods: 2, - }) - require.Nil(t, err) - require.Equal(t, 2, len(resp.Prices)) - require.Equal(t, uint64(2), resp.Prices[0].BeginTimestamp) - require.Equal(t, uint64(3), resp.Prices[0].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("101"), *resp.Prices[0].Open) - require.Equal(t, sdk.MustNewDecFromStr("101"), *resp.Prices[0].High) - require.Equal(t, sdk.MustNewDecFromStr("101"), *resp.Prices[0].Low) - require.Equal(t, sdk.MustNewDecFromStr("101"), *resp.Prices[0].Close) - require.Equal(t, uint64(1), resp.Prices[1].BeginTimestamp) - require.Equal(t, uint64(2), resp.Prices[1].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].Open) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].High) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].Low) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].Close) -} - -func TestEachPeriodMultipleDataPoints(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 1) - keepertest.SeedPriceSnapshot(ctx, keeper, "101", 2) - keepertest.SeedPriceSnapshot(ctx, keeper, "102", 3) - keepertest.SeedPriceSnapshot(ctx, keeper, "99", 4) - keepertest.SeedPriceSnapshot(ctx, keeper, "98", 5) // should not be included since end is exclusive - - ctx = ctx.WithBlockTime(time.Unix(5, 0)) - wctx := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: keeper} - resp, err := wrapper.GetHistoricalPrices(wctx, &types.QueryGetHistoricalPricesRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - PeriodLengthInSeconds: 2, - NumOfPeriods: 2, - }) - require.Nil(t, err) - require.Equal(t, 2, len(resp.Prices)) - require.Equal(t, uint64(3), resp.Prices[0].BeginTimestamp) - require.Equal(t, uint64(5), resp.Prices[0].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].Open) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].High) - require.Equal(t, sdk.MustNewDecFromStr("99"), *resp.Prices[0].Low) - require.Equal(t, sdk.MustNewDecFromStr("99"), *resp.Prices[0].Close) - require.Equal(t, uint64(1), resp.Prices[1].BeginTimestamp) - require.Equal(t, uint64(3), resp.Prices[1].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].Open) - require.Equal(t, sdk.MustNewDecFromStr("101"), *resp.Prices[1].High) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].Low) - require.Equal(t, sdk.MustNewDecFromStr("101"), *resp.Prices[1].Close) -} - -func TestMissingDataPoints(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 1) - keepertest.SeedPriceSnapshot(ctx, keeper, "102", 3) - keepertest.SeedPriceSnapshot(ctx, keeper, "98", 5) // should not be included since end is exclusive - - ctx = ctx.WithBlockTime(time.Unix(5, 0)) - wctx := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: keeper} - resp, err := wrapper.GetHistoricalPrices(wctx, &types.QueryGetHistoricalPricesRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - PeriodLengthInSeconds: 1, - NumOfPeriods: 4, - }) - require.Nil(t, err) - require.Equal(t, 4, len(resp.Prices)) - require.Equal(t, uint64(4), resp.Prices[0].BeginTimestamp) - require.Equal(t, uint64(5), resp.Prices[0].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].Open) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].High) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].Low) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].Close) - require.Equal(t, uint64(3), resp.Prices[1].BeginTimestamp) - require.Equal(t, uint64(4), resp.Prices[1].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[1].Open) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[1].High) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[1].Low) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[1].Close) - require.Equal(t, uint64(2), resp.Prices[2].BeginTimestamp) - require.Equal(t, uint64(3), resp.Prices[2].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[2].Open) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[2].High) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[2].Low) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[2].Close) - require.Equal(t, uint64(1), resp.Prices[3].BeginTimestamp) - require.Equal(t, uint64(2), resp.Prices[3].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[3].Open) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[3].High) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[3].Low) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[3].Close) -} - -func TestDataPointsNotEarlyEnoughFullBar(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 2) - keepertest.SeedPriceSnapshot(ctx, keeper, "102", 3) // should not be included since end is exclusive - - ctx = ctx.WithBlockTime(time.Unix(3, 0)) - wctx := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: keeper} - resp, err := wrapper.GetHistoricalPrices(wctx, &types.QueryGetHistoricalPricesRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - PeriodLengthInSeconds: 1, - NumOfPeriods: 2, - }) - require.Nil(t, err) - require.Equal(t, 2, len(resp.Prices)) - require.Equal(t, uint64(2), resp.Prices[0].BeginTimestamp) - require.Equal(t, uint64(3), resp.Prices[0].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[0].Open) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[0].High) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[0].Low) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[0].Close) - require.Equal(t, uint64(1), resp.Prices[1].BeginTimestamp) - require.Equal(t, uint64(2), resp.Prices[1].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("0"), *resp.Prices[1].Open) - require.Equal(t, sdk.MustNewDecFromStr("0"), *resp.Prices[1].High) - require.Equal(t, sdk.MustNewDecFromStr("0"), *resp.Prices[1].Low) - require.Equal(t, sdk.MustNewDecFromStr("0"), *resp.Prices[1].Close) -} - -func TestDataPointsNotEarlyEnoughPartialBar(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 2) - keepertest.SeedPriceSnapshot(ctx, keeper, "102", 3) - keepertest.SeedPriceSnapshot(ctx, keeper, "98", 5) // should not be included since end is exclusive - - ctx = ctx.WithBlockTime(time.Unix(5, 0)) - wctx := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: keeper} - resp, err := wrapper.GetHistoricalPrices(wctx, &types.QueryGetHistoricalPricesRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - PeriodLengthInSeconds: 2, - NumOfPeriods: 2, - }) - require.Nil(t, err) - require.Equal(t, 2, len(resp.Prices)) - require.Equal(t, uint64(3), resp.Prices[0].BeginTimestamp) - require.Equal(t, uint64(5), resp.Prices[0].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].Open) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].High) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].Low) - require.Equal(t, sdk.MustNewDecFromStr("102"), *resp.Prices[0].Close) - require.Equal(t, uint64(1), resp.Prices[1].BeginTimestamp) - require.Equal(t, uint64(3), resp.Prices[1].EndTimestamp) - require.Equal(t, sdk.MustNewDecFromStr("0"), *resp.Prices[1].Open) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].High) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].Low) - require.Equal(t, sdk.MustNewDecFromStr("100"), *resp.Prices[1].Close) -} diff --git a/x/dex/keeper/query/grpc_query_get_latest_price.go b/x/dex/keeper/query/grpc_query_get_latest_price.go deleted file mode 100644 index 18fa7b5c1..000000000 --- a/x/dex/keeper/query/grpc_query_get_latest_price.go +++ /dev/null @@ -1,37 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) GetLatestPrice(goCtx context.Context, req *types.QueryGetLatestPriceRequest) (*types.QueryGetLatestPriceResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - prices := k.GetAllPrices(ctx, req.ContractAddr, types.Pair{PriceDenom: req.PriceDenom, AssetDenom: req.AssetDenom}) - - if len(prices) == 0 { - return &types.QueryGetLatestPriceResponse{ - Price: &types.Price{}, - }, nil - } - - latestPrice := prices[0] - - for _, price := range prices { - if price.SnapshotTimestampInSeconds > latestPrice.SnapshotTimestampInSeconds { - latestPrice = price - } - } - - return &types.QueryGetLatestPriceResponse{ - Price: latestPrice, - }, nil -} diff --git a/x/dex/keeper/query/grpc_query_get_latest_price_test.go b/x/dex/keeper/query/grpc_query_get_latest_price_test.go deleted file mode 100644 index 731ca6354..000000000 --- a/x/dex/keeper/query/grpc_query_get_latest_price_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package query_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetLatestPrice(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 1) - keepertest.SeedPriceSnapshot(ctx, keeper, "101", 2) - keepertest.SeedPriceSnapshot(ctx, keeper, "99", 3) - - ctx = ctx.WithBlockTime(time.Unix(4, 0)) - wctx := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: keeper} - resp, err := wrapper.GetLatestPrice(wctx, &types.QueryGetLatestPriceRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - }) - require.Nil(t, err) - require.Equal(t, sdk.MustNewDecFromStr("99"), resp.Price.Price) -} diff --git a/x/dex/keeper/query/grpc_query_get_market_summary.go b/x/dex/keeper/query/grpc_query_get_market_summary.go deleted file mode 100644 index 9d869207f..000000000 --- a/x/dex/keeper/query/grpc_query_get_market_summary.go +++ /dev/null @@ -1,49 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) GetMarketSummary(goCtx context.Context, req *types.QueryGetMarketSummaryRequest) (*types.QueryGetMarketSummaryResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - prices := k.GetAllPrices(ctx, req.ContractAddr, types.Pair{PriceDenom: req.PriceDenom, AssetDenom: req.AssetDenom}) - cutoff := ctx.BlockTime().Unix() - int64(req.LookbackInSeconds) - maxPrice := sdk.ZeroDec() - minPrice := sdk.ZeroDec() - latestTimestamp := 0 - lastPrice := sdk.ZeroDec() - for _, price := range prices { - if price.SnapshotTimestampInSeconds < uint64(cutoff) { - continue - } - if maxPrice.IsZero() || price.Price.GT(maxPrice) { - maxPrice = price.Price - } - if minPrice.IsZero() || price.Price.LT(minPrice) { - minPrice = price.Price - } - if price.SnapshotTimestampInSeconds > uint64(latestTimestamp) { - latestTimestamp = int(price.SnapshotTimestampInSeconds) - lastPrice = price.Price - } - } - - zero := sdk.ZeroDec() - return &types.QueryGetMarketSummaryResponse{ - TotalVolume: &zero, // TODO: replace once we start tracking volume - TotalVolumeNotional: &zero, // TODO: replace once we start tracking volume - HighPrice: &maxPrice, - LowPrice: &minPrice, - LastPrice: &lastPrice, - }, nil -} diff --git a/x/dex/keeper/query/grpc_query_get_market_summary_test.go b/x/dex/keeper/query/grpc_query_get_market_summary_test.go deleted file mode 100644 index e5f77b40a..000000000 --- a/x/dex/keeper/query/grpc_query_get_market_summary_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package query_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetMarketSummary(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 1) - keepertest.SeedPriceSnapshot(ctx, keeper, "101", 2) - keepertest.SeedPriceSnapshot(ctx, keeper, "99", 3) - - ctx = ctx.WithBlockTime(time.Unix(4, 0)) - wctx := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: keeper} - resp, err := wrapper.GetMarketSummary(wctx, &types.QueryGetMarketSummaryRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - LookbackInSeconds: 4, - }) - require.Nil(t, err) - require.Equal(t, sdk.MustNewDecFromStr("99"), *resp.LowPrice) - require.Equal(t, sdk.MustNewDecFromStr("99"), *resp.LastPrice) - require.Equal(t, sdk.MustNewDecFromStr("101"), *resp.HighPrice) -} diff --git a/x/dex/keeper/query/grpc_query_get_order_count.go b/x/dex/keeper/query/grpc_query_get_order_count.go deleted file mode 100644 index 3a70cb0fe..000000000 --- a/x/dex/keeper/query/grpc_query_get_order_count.go +++ /dev/null @@ -1,19 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) GetOrderCount(c context.Context, req *types.QueryGetOrderCountRequest) (*types.QueryGetOrderCountResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - return &types.QueryGetOrderCountResponse{Count: k.GetOrderCountState(ctx, req.ContractAddr, req.PriceDenom, req.AssetDenom, req.PositionDirection, *req.Price)}, nil -} diff --git a/x/dex/keeper/query/grpc_query_get_order_count_test.go b/x/dex/keeper/query/grpc_query_get_order_count_test.go deleted file mode 100644 index 30fa1baf7..000000000 --- a/x/dex/keeper/query/grpc_query_get_order_count_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetOrderCount(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := query.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - keeper.SetOrderCount(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(1), 5) - price := sdk.NewDec(1) - query := types.QueryGetOrderCountRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - PositionDirection: types.PositionDirection_LONG, - Price: &price, - } - resp, err := wrapper.GetOrderCount(wctx, &query) - require.Nil(t, err) - require.Equal(t, uint64(5), resp.Count) -} diff --git a/x/dex/keeper/query/grpc_query_get_price.go b/x/dex/keeper/query/grpc_query_get_price.go deleted file mode 100644 index f58d38645..000000000 --- a/x/dex/keeper/query/grpc_query_get_price.go +++ /dev/null @@ -1,25 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) GetPrice(goCtx context.Context, req *types.QueryGetPriceRequest) (*types.QueryGetPriceResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - price, found := k.GetPriceState(ctx, req.ContractAddr, req.Timestamp, types.Pair{PriceDenom: req.PriceDenom, AssetDenom: req.AssetDenom}) - - return &types.QueryGetPriceResponse{ - Price: &price, - Found: found, - }, nil -} diff --git a/x/dex/keeper/query/grpc_query_get_price_test.go b/x/dex/keeper/query/grpc_query_get_price_test.go deleted file mode 100644 index c46d15f7e..000000000 --- a/x/dex/keeper/query/grpc_query_get_price_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package query_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetPrice(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keepertest.SeedPriceSnapshot(ctx, keeper, "100", 1) - keepertest.SeedPriceSnapshot(ctx, keeper, "101", 2) - keepertest.SeedPriceSnapshot(ctx, keeper, "99", 3) - - ctx = ctx.WithBlockTime(time.Unix(4, 0)) - wctx := sdk.WrapSDKContext(ctx) - wrapper := query.KeeperWrapper{Keeper: keeper} - resp, err := wrapper.GetPrice(wctx, &types.QueryGetPriceRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - Timestamp: 2, - }) - require.Nil(t, err) - require.Equal(t, true, resp.Found) - require.Equal(t, sdk.MustNewDecFromStr("101"), resp.Price.Price) -} diff --git a/x/dex/keeper/query/grpc_query_get_prices.go b/x/dex/keeper/query/grpc_query_get_prices.go deleted file mode 100644 index d4b8c619e..000000000 --- a/x/dex/keeper/query/grpc_query_get_prices.go +++ /dev/null @@ -1,24 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) GetPrices(goCtx context.Context, req *types.QueryGetPricesRequest) (*types.QueryGetPricesResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - prices := k.GetAllPrices(ctx, req.ContractAddr, types.Pair{PriceDenom: req.PriceDenom, AssetDenom: req.AssetDenom}) - - return &types.QueryGetPricesResponse{ - Prices: prices, - }, nil -} diff --git a/x/dex/keeper/query/grpc_query_get_twaps.go b/x/dex/keeper/query/grpc_query_get_twaps.go deleted file mode 100644 index b16667285..000000000 --- a/x/dex/keeper/query/grpc_query_get_twaps.go +++ /dev/null @@ -1,57 +0,0 @@ -package query - -import ( - "context" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func (k KeeperWrapper) GetTwaps(goCtx context.Context, req *types.QueryGetTwapsRequest) (*types.QueryGetTwapsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - allRegisteredPairs := k.GetAllRegisteredPairs(ctx, req.ContractAddr) - twaps := []*types.Twap{} - for _, pair := range allRegisteredPairs { - prices := k.GetPricesForTwap(ctx, req.ContractAddr, pair, req.LookbackSeconds) - twaps = append(twaps, &types.Twap{ - Pair: &pair, //nolint:gosec,exportloopref // USING THE POINTER HERE COULD BE BAD, LET'S CHECK IT. - Twap: calculateTwap(ctx, prices, req.LookbackSeconds), - LookbackSeconds: req.LookbackSeconds, - }) - } - - return &types.QueryGetTwapsResponse{ - Twaps: twaps, - }, nil -} - -func calculateTwap(ctx sdk.Context, prices []*types.Price, lookback uint64) sdk.Dec { - if len(prices) == 0 { - return sdk.ZeroDec() - } - weightedPriceSum := sdk.ZeroDec() - lastTimestamp := ctx.BlockTime().Unix() - for _, price := range prices { - if uint64(ctx.BlockTime().Unix())-price.SnapshotTimestampInSeconds > lookback { - weight := lastTimestamp - ctx.BlockTime().Unix() + int64(lookback) - weightedPriceSum = weightedPriceSum.Add(price.Price.MulInt64(weight)) - break - } - weightedPriceSum = weightedPriceSum.Add( - price.Price.MulInt64(lastTimestamp - int64(price.SnapshotTimestampInSeconds)), - ) - lastTimestamp = int64(price.SnapshotTimestampInSeconds) - } - // not possible for division by 0 here since prices have unique timestamps - totalTimeSpan := ctx.BlockTime().Unix() - int64(prices[len(prices)-1].SnapshotTimestampInSeconds) - if totalTimeSpan > int64(lookback) { - totalTimeSpan = int64(lookback) - } - return weightedPriceSum.QuoInt64(totalTimeSpan) -} diff --git a/x/dex/keeper/query/grpc_query_get_twaps_test.go b/x/dex/keeper/query/grpc_query_get_twaps_test.go deleted file mode 100644 index a03944205..000000000 --- a/x/dex/keeper/query/grpc_query_get_twaps_test.go +++ /dev/null @@ -1,143 +0,0 @@ -package query_test - -import ( - "testing" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -const GENESIS_TIME uint64 = 3600 - -func TestGetTwapsNoPriceSnapshot(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.AddRegisteredPair(ctx, keepertest.TestContract, keepertest.TestPair) - wctx := sdk.WrapSDKContext(ctx) - var lookback uint64 = 10 - request := types.QueryGetTwapsRequest{ - ContractAddr: keepertest.TestContract, - LookbackSeconds: lookback, - } - expectedResponse := types.QueryGetTwapsResponse{ - Twaps: []*types.Twap{ - { - Pair: &keepertest.TestPair, - Twap: sdk.ZeroDec(), - LookbackSeconds: lookback, - }, - }, - } - wrapper := query.KeeperWrapper{Keeper: keeper} - t.Run("No snapshot", func(t *testing.T) { - response, err := wrapper.GetTwaps(wctx, &request) - require.NoError(t, err) - require.Equal(t, expectedResponse, *response) - }) -} - -func TestGetTwapsOnePriceSnapshot(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.AddRegisteredPair(ctx, keepertest.TestContract, keepertest.TestPair) - ctx = ctx.WithBlockTime(time.Unix(int64(GENESIS_TIME)+5, 0)) - wctx := sdk.WrapSDKContext(ctx) - - snapshotPrice := sdk.MustNewDecFromStr("100.00") - keeper.SetPriceState(ctx, types.Price{ - SnapshotTimestampInSeconds: GENESIS_TIME, - Price: snapshotPrice, - Pair: &keepertest.TestPair, - }, keepertest.TestContract) - - var lookback uint64 = 10 - request := types.QueryGetTwapsRequest{ - ContractAddr: keepertest.TestContract, - LookbackSeconds: lookback, - } - expectedResponse := types.QueryGetTwapsResponse{ - Twaps: []*types.Twap{ - { - Pair: &keepertest.TestPair, - Twap: snapshotPrice, - LookbackSeconds: lookback, - }, - }, - } - wrapper := query.KeeperWrapper{Keeper: keeper} - t.Run("One snapshot", func(t *testing.T) { - response, err := wrapper.GetTwaps(wctx, &request) - require.NoError(t, err) - require.Equal(t, expectedResponse, *response) - }) - - lookback = 4 - request = types.QueryGetTwapsRequest{ - ContractAddr: keepertest.TestContract, - LookbackSeconds: lookback, - } - expectedResponse = types.QueryGetTwapsResponse{ - Twaps: []*types.Twap{ - { - Pair: &keepertest.TestPair, - Twap: snapshotPrice, - LookbackSeconds: lookback, - }, - }, - } - t.Run("One old snapshot", func(t *testing.T) { - response, err := wrapper.GetTwaps(wctx, &request) - require.NoError(t, err) - require.Equal(t, expectedResponse, *response) - }) -} - -func TestGetTwapsMultipleSnapshots(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - keeper.AddRegisteredPair(ctx, keepertest.TestContract, keepertest.TestPair) - ctx = ctx.WithBlockTime(time.Unix(int64(GENESIS_TIME)+20, 0)) - wctx := sdk.WrapSDKContext(ctx) - - snapshotPrices := []sdk.Dec{ - sdk.MustNewDecFromStr("100.00"), - sdk.MustNewDecFromStr("98.50"), - sdk.MustNewDecFromStr("101.00"), - } - timestampDeltas := []uint64{0, 10, 15} - for i := range snapshotPrices { - keeper.SetPriceState(ctx, types.Price{ - SnapshotTimestampInSeconds: GENESIS_TIME + timestampDeltas[i], - Price: snapshotPrices[i], - Pair: &keepertest.TestPair, - }, keepertest.TestContract) - } - - var lookback uint64 = 20 - request := types.QueryGetTwapsRequest{ - ContractAddr: keepertest.TestContract, - LookbackSeconds: lookback, - } - expectedTwap := snapshotPrices[0].MulInt64(10).Add( - snapshotPrices[1].MulInt64(15 - 10), - ).Add( - snapshotPrices[2].MulInt64(20 - 15), - ).QuoInt64(20) - require.Equal(t, sdk.MustNewDecFromStr("99.875"), expectedTwap) - expectedResponse := types.QueryGetTwapsResponse{ - Twaps: []*types.Twap{ - { - Pair: &keepertest.TestPair, - Twap: expectedTwap, - LookbackSeconds: lookback, - }, - }, - } - wrapper := query.KeeperWrapper{Keeper: keeper} - t.Run("Multiple snapshots", func(t *testing.T) { - response, err := wrapper.GetTwaps(wctx, &request) - require.NoError(t, err) - require.Equal(t, expectedResponse, *response) - }) -} diff --git a/x/dex/keeper/query/grpc_query_long_book.go b/x/dex/keeper/query/grpc_query_long_book.go deleted file mode 100644 index d855059f2..000000000 --- a/x/dex/keeper/query/grpc_query_long_book.go +++ /dev/null @@ -1,50 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) LongBookAll(c context.Context, req *types.QueryAllLongBookRequest) (*types.QueryAllLongBookResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(c) - - longBooks, pageRes, err := k.GetAllLongBookForPairPaginated( - ctx, - req.ContractAddr, - req.PriceDenom, - req.AssetDenom, - req.Pagination, - ) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllLongBookResponse{LongBook: longBooks, Pagination: pageRes}, nil -} - -func (k KeeperWrapper) LongBook(c context.Context, req *types.QueryGetLongBookRequest) (*types.QueryGetLongBookResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(c) - price, err := sdk.NewDecFromStr(req.Price) - if err != nil { - return nil, err - } - longBook, found := k.GetLongBookByPrice(ctx, req.ContractAddr, price, req.PriceDenom, req.AssetDenom) - if !found { - return nil, sdkerrors.ErrKeyNotFound - } - - return &types.QueryGetLongBookResponse{LongBook: longBook}, nil -} diff --git a/x/dex/keeper/query/grpc_query_long_book_test.go b/x/dex/keeper/query/grpc_query_long_book_test.go deleted file mode 100644 index ac29f3991..000000000 --- a/x/dex/keeper/query/grpc_query_long_book_test.go +++ /dev/null @@ -1,123 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/testutil/nullify" - keeperquery "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func TestLongBookQuerySingle(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := keeperquery.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - msgs := keepertest.CreateNLongBook(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetLongBookRequest - response *types.QueryGetLongBookResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetLongBookRequest{Price: msgs[0].Price.String(), ContractAddr: keepertest.TestContract, PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}, - response: &types.QueryGetLongBookResponse{LongBook: msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetLongBookRequest{Price: msgs[1].Price.String(), ContractAddr: keepertest.TestContract, PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}, - response: &types.QueryGetLongBookResponse{LongBook: msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetLongBookRequest{Price: "100000", ContractAddr: keepertest.TestContract, PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}, - err: sdkerrors.ErrKeyNotFound, - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - t.Run(tc.desc, func(t *testing.T) { - response, err := wrapper.LongBook(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} - -func TestLongBookQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := keeperquery.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - msgs := keepertest.CreateNLongBook(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllLongBookRequest { - return &types.QueryAllLongBookRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := wrapper.LongBookAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.LongBook), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.LongBook), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := wrapper.LongBookAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.LongBook), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.LongBook), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := wrapper.LongBookAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.LongBook), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := wrapper.LongBookAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/dex/keeper/query/grpc_query_match_result.go b/x/dex/keeper/query/grpc_query_match_result.go deleted file mode 100644 index 95226904e..000000000 --- a/x/dex/keeper/query/grpc_query_match_result.go +++ /dev/null @@ -1,24 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) GetMatchResult(c context.Context, req *types.QueryGetMatchResultRequest) (*types.QueryGetMatchResultResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - result, found := k.GetMatchResultState(ctx, req.ContractAddr) - if !found { - return nil, status.Error(codes.NotFound, "result not found") - } - - return &types.QueryGetMatchResultResponse{Result: result}, nil -} diff --git a/x/dex/keeper/query/grpc_query_order.go b/x/dex/keeper/query/grpc_query_order.go deleted file mode 100644 index 556c640a6..000000000 --- a/x/dex/keeper/query/grpc_query_order.go +++ /dev/null @@ -1,112 +0,0 @@ -package query - -import ( - "context" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// To be deprecated once offchain query is built -func (k KeeperWrapper) GetOrder(c context.Context, req *types.QueryGetOrderByIDRequest) (*types.QueryGetOrderByIDResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - longBooks := k.GetAllLongBook(ctx, req.ContractAddr) - for _, longBook := range longBooks { - for _, allocation := range longBook.Entry.Allocations { - if allocation.OrderId == req.Id { - return &types.QueryGetOrderByIDResponse{ - Order: &types.Order{ - Id: req.Id, - Price: longBook.Price, - Quantity: allocation.Quantity, - PriceDenom: longBook.Entry.PriceDenom, - AssetDenom: longBook.Entry.AssetDenom, - OrderType: types.OrderType_LIMIT, - Status: types.OrderStatus_PLACED, - ContractAddr: req.ContractAddr, - PositionDirection: types.PositionDirection_LONG, - Account: allocation.Account, - }, - }, nil - } - } - } - shortBooks := k.GetAllShortBook(ctx, req.ContractAddr) - for _, shortBook := range shortBooks { - for _, allocation := range shortBook.Entry.Allocations { - if allocation.OrderId == req.Id { - return &types.QueryGetOrderByIDResponse{ - Order: &types.Order{ - Id: req.Id, - Price: shortBook.Price, - Quantity: allocation.Quantity, - PriceDenom: shortBook.Entry.PriceDenom, - AssetDenom: shortBook.Entry.AssetDenom, - OrderType: types.OrderType_LIMIT, - Status: types.OrderStatus_PLACED, - ContractAddr: req.ContractAddr, - PositionDirection: types.PositionDirection_SHORT, - Account: allocation.Account, - }, - }, nil - } - } - } - - return &types.QueryGetOrderByIDResponse{}, types.ErrInvalidOrderID -} - -// To be deprecated once offchain query is built -func (k KeeperWrapper) GetOrders(c context.Context, req *types.QueryGetOrdersRequest) (*types.QueryGetOrdersResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - orders := []*types.Order{} - longBooks := k.GetAllLongBook(ctx, req.ContractAddr) - for _, longBook := range longBooks { - for _, allocation := range longBook.Entry.Allocations { - if allocation.Account == req.Account { - orders = append(orders, &types.Order{ - Id: allocation.OrderId, - Price: longBook.Price, - Quantity: allocation.Quantity, - PriceDenom: longBook.Entry.PriceDenom, - AssetDenom: longBook.Entry.AssetDenom, - OrderType: types.OrderType_LIMIT, - Status: types.OrderStatus_PLACED, - ContractAddr: req.ContractAddr, - PositionDirection: types.PositionDirection_LONG, - Account: allocation.Account, - }) - } - } - } - shortBooks := k.GetAllShortBook(ctx, req.ContractAddr) - for _, shortBook := range shortBooks { - for _, allocation := range shortBook.Entry.Allocations { - if allocation.Account == req.Account { - orders = append(orders, &types.Order{ - Id: allocation.OrderId, - Price: shortBook.Price, - Quantity: allocation.Quantity, - PriceDenom: shortBook.Entry.PriceDenom, - AssetDenom: shortBook.Entry.AssetDenom, - OrderType: types.OrderType_LIMIT, - Status: types.OrderStatus_PLACED, - ContractAddr: req.ContractAddr, - PositionDirection: types.PositionDirection_SHORT, - Account: allocation.Account, - }) - } - } - } - - return &types.QueryGetOrdersResponse{Orders: orders}, nil -} diff --git a/x/dex/keeper/query/grpc_query_order_simulation.go b/x/dex/keeper/query/grpc_query_order_simulation.go deleted file mode 100644 index e16308c95..000000000 --- a/x/dex/keeper/query/grpc_query_order_simulation.go +++ /dev/null @@ -1,120 +0,0 @@ -package query - -import ( - "context" - "sort" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" -) - -type priceQuantity struct { - price sdk.Dec - quantity sdk.Dec -} - -// Note that this simulation is only accurate if it's called as part of the main Sei process (e.g. in Begin/EndBlock, transaction handler -// or contract querier), because it needs to access dex's in-memory state. -func (k KeeperWrapper) GetOrderSimulation(c context.Context, req *types.QueryOrderSimulationRequest) (*types.QueryOrderSimulationResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - matchedPriceQuantities := k.getMatchedPriceQuantities(ctx, req) - executedQuantity := sdk.ZeroDec() - for _, pq := range matchedPriceQuantities { - if executedQuantity.Add(pq.quantity).GTE(req.Order.Quantity) { - executedQuantity = req.Order.Quantity - break - } - executedQuantity = executedQuantity.Add(pq.quantity) - } - return &types.QueryOrderSimulationResponse{ - ExecutedQuantity: &executedQuantity, - }, nil -} - -func (k KeeperWrapper) getMatchedPriceQuantities(ctx sdk.Context, req *types.QueryOrderSimulationRequest) []priceQuantity { - orderDirection := req.Order.PositionDirection - // get existing liquidity - eligibleOrderBookPriceToQuantity := map[string]sdk.Dec{} - if orderDirection == types.PositionDirection_SHORT { - for _, lb := range k.GetAllLongBookForPair(ctx, req.ContractAddr, req.Order.PriceDenom, req.Order.AssetDenom) { - if req.Order.Price.IsZero() || req.Order.Price.LTE(lb.GetPrice()) { - eligibleOrderBookPriceToQuantity[lb.GetPrice().String()] = lb.GetOrderEntry().Quantity - } - } - } else { - for _, sb := range k.GetAllShortBookForPair(ctx, req.ContractAddr, req.Order.PriceDenom, req.Order.AssetDenom) { - if req.Order.Price.IsZero() || req.Order.Price.GTE(sb.GetPrice()) { - eligibleOrderBookPriceToQuantity[sb.GetPrice().String()] = sb.GetOrderEntry().Quantity - } - } - } - - // exclude liquidity to be cancelled - pair := types.Pair{PriceDenom: req.Order.PriceDenom, AssetDenom: req.Order.AssetDenom} - for _, cancel := range dexutils.GetMemState(ctx.Context()).GetBlockCancels(ctx, types.ContractAddress(req.ContractAddr), pair).Get() { - var cancelledAllocation *types.Allocation - var found bool - if cancel.PositionDirection == types.PositionDirection_LONG { - cancelledAllocation, found = k.GetLongAllocationForOrderID(ctx, req.ContractAddr, cancel.PriceDenom, cancel.AssetDenom, cancel.Price, cancel.Id) - } else { - cancelledAllocation, found = k.GetShortAllocationForOrderID(ctx, req.ContractAddr, cancel.PriceDenom, cancel.AssetDenom, cancel.Price, cancel.Id) - } - if !found { - continue - } - if q, ok := eligibleOrderBookPriceToQuantity[cancel.Price.String()]; ok { - eligibleOrderBookPriceToQuantity[cancel.Price.String()] = q.Sub(cancelledAllocation.Quantity) - } - } - - priceQuantities := []priceQuantity{} - for price, quantity := range eligibleOrderBookPriceToQuantity { - if quantity.IsPositive() { - priceQuantities = append(priceQuantities, priceQuantity{price: sdk.MustNewDecFromStr(price), quantity: quantity}) - } - } - sort.Slice(priceQuantities, func(i int, j int) bool { - if orderDirection == types.PositionDirection_SHORT { - // short order corresponds to long book which needs to be in descending order - return priceQuantities[i].price.GT(priceQuantities[j].price) - } - // long order corresponds to long book which needs to be in ascending order - return priceQuantities[i].price.LT(priceQuantities[j].price) - }) - - // exclude liquidity to be taken - ptr := 0 - for _, order := range dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(req.ContractAddr), pair).GetSortedMarketOrders(orderDirection) { - // If existing market order has price zero, it means it doesn't specify a worst price and will always have precedence over the simulated - // order - if !order.Price.IsZero() { - // If the simulated order doesn't specify a worst price, no existing order with a worst price will take liquidity from it - if req.Order.Price.IsZero() { - break - } - if orderDirection == types.PositionDirection_LONG && order.Price.LT(req.Order.Price) { - break - } - if orderDirection == types.PositionDirection_SHORT && order.Price.GT(req.Order.Price) { - break - } - } - remainingQuantity := order.Quantity - for ptr < len(priceQuantities) { - if remainingQuantity.LTE(priceQuantities[ptr].quantity) { - priceQuantities[ptr].quantity = priceQuantities[ptr].quantity.Sub(remainingQuantity) - break - } - remainingQuantity = remainingQuantity.Sub(priceQuantities[ptr].quantity) - ptr++ - } - } - return priceQuantities[ptr:] -} diff --git a/x/dex/keeper/query/grpc_query_order_simulation_test.go b/x/dex/keeper/query/grpc_query_order_simulation_test.go deleted file mode 100644 index 07bfb2ccb..000000000 --- a/x/dex/keeper/query/grpc_query_order_simulation_test.go +++ /dev/null @@ -1,101 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" -) - -func TestGetOrderSimulation(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := query.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - - testOrder := types.Order{ - Account: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Price: sdk.MustNewDecFromStr("10"), - Quantity: sdk.MustNewDecFromStr("5"), - PositionDirection: types.PositionDirection_LONG, - } - - // no liquidity - res, err := wrapper.GetOrderSimulation(wctx, &types.QueryOrderSimulationRequest{Order: &testOrder, ContractAddr: keepertest.TestContract}) - require.Nil(t, err) - require.Equal(t, sdk.ZeroDec(), *res.ExecutedQuantity) - - // partial liquidity on orderbook - keeper.SetShortBook(ctx, keepertest.TestContract, types.ShortBook{ - Price: sdk.MustNewDecFromStr("9"), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr("9"), - Quantity: sdk.MustNewDecFromStr("2"), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }) - res, err = wrapper.GetOrderSimulation(wctx, &types.QueryOrderSimulationRequest{Order: &testOrder, ContractAddr: keepertest.TestContract}) - require.Nil(t, err) - require.Equal(t, sdk.MustNewDecFromStr("2"), *res.ExecutedQuantity) - - // full liquidity on orderbook - keeper.SetShortBook(ctx, keepertest.TestContract, types.ShortBook{ - Price: sdk.MustNewDecFromStr("8"), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr("8"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }) - res, err = wrapper.GetOrderSimulation(wctx, &types.QueryOrderSimulationRequest{Order: &testOrder, ContractAddr: keepertest.TestContract}) - require.Nil(t, err) - require.Equal(t, sdk.MustNewDecFromStr("3"), *res.ExecutedQuantity) - - // liquidity taken by cancel - keeper.SetShortBook(ctx, keepertest.TestContract, types.ShortBook{ - Price: sdk.MustNewDecFromStr("9"), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr("9"), - Quantity: sdk.MustNewDecFromStr("2"), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Allocations: []*types.Allocation{ - { - Account: keepertest.TestAccount, - Quantity: sdk.MustNewDecFromStr("2"), - OrderId: 1, - }, - }, - }, - }) - dexutils.GetMemState(ctx.Context()).GetBlockCancels(ctx, types.ContractAddress(keepertest.TestContract), keepertest.TestPair).Add( - &types.Cancellation{Id: 1, Price: sdk.MustNewDecFromStr("9"), PositionDirection: types.PositionDirection_SHORT, PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}, - ) - res, err = wrapper.GetOrderSimulation(wctx, &types.QueryOrderSimulationRequest{Order: &testOrder, ContractAddr: keepertest.TestContract}) - require.Nil(t, err) - require.Equal(t, sdk.OneDec(), *res.ExecutedQuantity) - - // liquidity taken by earlier market orders - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(keepertest.TestContract), keepertest.TestPair).Add( - &types.Order{ - Account: keepertest.TestAccount, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Price: sdk.MustNewDecFromStr("11"), - Quantity: sdk.MustNewDecFromStr("2"), - PositionDirection: types.PositionDirection_LONG, - OrderType: types.OrderType_MARKET, - }, - ) - res, err = wrapper.GetOrderSimulation(wctx, &types.QueryOrderSimulationRequest{Order: &testOrder, ContractAddr: keepertest.TestContract}) - require.Nil(t, err) - require.Equal(t, sdk.ZeroDec(), *res.ExecutedQuantity) -} diff --git a/x/dex/keeper/query/grpc_query_order_test.go b/x/dex/keeper/query/grpc_query_order_test.go deleted file mode 100644 index 32025934a..000000000 --- a/x/dex/keeper/query/grpc_query_order_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetOrderById(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := query.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - // active order - keeper.SetLongBook(ctx, keepertest.TestContract, types.LongBook{ - Price: sdk.OneDec(), - Entry: &types.OrderEntry{ - Price: sdk.OneDec(), - Quantity: sdk.MustNewDecFromStr("2"), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Allocations: []*types.Allocation{ - { - Account: keepertest.TestAccount, - OrderId: 1, - Quantity: sdk.MustNewDecFromStr("2"), - }, - }, - }, - }) - query := types.QueryGetOrderByIDRequest{ - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Id: 1, - } - resp, err := wrapper.GetOrder(wctx, &query) - require.Nil(t, err) - require.Equal(t, uint64(1), resp.Order.Id) - require.Equal(t, types.OrderStatus_PLACED, resp.Order.Status) -} - -func TestGetOrders(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := query.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - // active order - keeper.SetLongBook(ctx, keepertest.TestContract, types.LongBook{ - Price: sdk.OneDec(), - Entry: &types.OrderEntry{ - Price: sdk.OneDec(), - Quantity: sdk.MustNewDecFromStr("2"), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Allocations: []*types.Allocation{ - { - Account: keepertest.TestAccount, - OrderId: 1, - Quantity: sdk.MustNewDecFromStr("2"), - }, - }, - }, - }) - - query := types.QueryGetOrdersRequest{ - ContractAddr: keepertest.TestContract, - Account: keepertest.TestAccount, - } - resp, err := wrapper.GetOrders(wctx, &query) - require.Nil(t, err) - require.Equal(t, 1, len(resp.Orders)) -} diff --git a/x/dex/keeper/query/grpc_query_params.go b/x/dex/keeper/query/grpc_query_params.go deleted file mode 100644 index 2b7772ef2..000000000 --- a/x/dex/keeper/query/grpc_query_params.go +++ /dev/null @@ -1,19 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil -} diff --git a/x/dex/keeper/query/grpc_query_params_test.go b/x/dex/keeper/query/grpc_query_params_test.go deleted file mode 100644 index ff1eecdbe..000000000 --- a/x/dex/keeper/query/grpc_query_params_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestParamsQuery(t *testing.T) { - keeper, ctx := testkeeper.DexKeeper(t) - wrapper := query.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - keeper.SetParams(ctx, params) - - response, err := wrapper.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) -} diff --git a/x/dex/keeper/query/grpc_query_registered_contract.go b/x/dex/keeper/query/grpc_query_registered_contract.go deleted file mode 100644 index 63e870e86..000000000 --- a/x/dex/keeper/query/grpc_query_registered_contract.go +++ /dev/null @@ -1,24 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) GetRegisteredContract(c context.Context, req *types.QueryRegisteredContractRequest) (*types.QueryRegisteredContractResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - contractInfo, err := k.GetContract(ctx, req.ContractAddr) - if err != nil { - return nil, err - } - - return &types.QueryRegisteredContractResponse{ContractInfo: &contractInfo}, nil -} diff --git a/x/dex/keeper/query/grpc_query_registered_contract_test.go b/x/dex/keeper/query/grpc_query_registered_contract_test.go deleted file mode 100644 index 15a6f751a..000000000 --- a/x/dex/keeper/query/grpc_query_registered_contract_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestRegisteredContractQuery(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := query.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - expectedContractInfo := types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - CodeId: 1, - RentBalance: 1000000, - } - err := keeper.SetContract(ctx, &types.ContractInfoV2{ - Creator: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - CodeId: 1, - RentBalance: 1000000, - }) - require.NoError(t, err) - - request := types.QueryRegisteredContractRequest{ - ContractAddr: keepertest.TestContract, - } - expectedResponse := types.QueryRegisteredContractResponse{ - ContractInfo: &expectedContractInfo, - } - t.Run("Registered Contract query", func(t *testing.T) { - response, err := wrapper.GetRegisteredContract(wctx, &request) - require.NoError(t, err) - require.Equal(t, expectedResponse, *response) - }) -} diff --git a/x/dex/keeper/query/grpc_query_registered_pairs.go b/x/dex/keeper/query/grpc_query_registered_pairs.go deleted file mode 100644 index e32f68163..000000000 --- a/x/dex/keeper/query/grpc_query_registered_pairs.go +++ /dev/null @@ -1,21 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) GetRegisteredPairs(c context.Context, req *types.QueryRegisteredPairsRequest) (*types.QueryRegisteredPairsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - registeredPairs := k.GetAllRegisteredPairs(ctx, req.ContractAddr) - - return &types.QueryRegisteredPairsResponse{Pairs: registeredPairs}, nil -} diff --git a/x/dex/keeper/query/grpc_query_registered_pairs_test.go b/x/dex/keeper/query/grpc_query_registered_pairs_test.go deleted file mode 100644 index 2b6007a4a..000000000 --- a/x/dex/keeper/query/grpc_query_registered_pairs_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestRegisteredPairsQuery(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := query.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - expectedPair := types.Pair{ - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - PriceTicksize: &keepertest.TestTicksize, - QuantityTicksize: &keepertest.TestTicksize, - } - keeper.AddRegisteredPair(ctx, keepertest.TestContract, expectedPair) - - var expectedRegisteredPairs []types.Pair - expectedRegisteredPairs = append(expectedRegisteredPairs, expectedPair) - - request := types.QueryRegisteredPairsRequest{ - ContractAddr: keepertest.TestContract, - } - expectedResponse := types.QueryRegisteredPairsResponse{ - Pairs: expectedRegisteredPairs, - } - t.Run("Registered Pairs query", func(t *testing.T) { - response, err := wrapper.GetRegisteredPairs(wctx, &request) - require.NoError(t, err) - require.Equal(t, expectedResponse, *response) - }) -} diff --git a/x/dex/keeper/query/grpc_query_short_book.go b/x/dex/keeper/query/grpc_query_short_book.go deleted file mode 100644 index 21855a20b..000000000 --- a/x/dex/keeper/query/grpc_query_short_book.go +++ /dev/null @@ -1,46 +0,0 @@ -package query - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/sei-protocol/sei-chain/x/dex/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k KeeperWrapper) ShortBookAll(c context.Context, req *types.QueryAllShortBookRequest) (*types.QueryAllShortBookResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(c) - - shortBooks, pageRes, err := k.GetAllShortBookForPairPaginated( - ctx, req.ContractAddr, req.PriceDenom, req.AssetDenom, req.Pagination, - ) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllShortBookResponse{ShortBook: shortBooks, Pagination: pageRes}, nil -} - -func (k KeeperWrapper) ShortBook(c context.Context, req *types.QueryGetShortBookRequest) (*types.QueryGetShortBookResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(c) - price, err := sdk.NewDecFromStr(req.Price) - if err != nil { - return nil, err - } - shortBook, found := k.GetShortBookByPrice(ctx, req.ContractAddr, price, req.PriceDenom, req.AssetDenom) - if !found { - return nil, sdkerrors.ErrKeyNotFound - } - - return &types.QueryGetShortBookResponse{ShortBook: shortBook}, nil -} diff --git a/x/dex/keeper/query/grpc_query_short_book_test.go b/x/dex/keeper/query/grpc_query_short_book_test.go deleted file mode 100644 index df919d7fc..000000000 --- a/x/dex/keeper/query/grpc_query_short_book_test.go +++ /dev/null @@ -1,123 +0,0 @@ -package query_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/testutil/nullify" - keeperquery "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func TestShortBookQuerySingle(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := keeperquery.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - msgs := keepertest.CreateNShortBook(keeper, ctx, 2) - for _, tc := range []struct { - desc string - request *types.QueryGetShortBookRequest - response *types.QueryGetShortBookResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetShortBookRequest{Price: msgs[0].Price.String(), ContractAddr: keepertest.TestContract, PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}, - response: &types.QueryGetShortBookResponse{ShortBook: msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetShortBookRequest{Price: msgs[1].Price.String(), ContractAddr: keepertest.TestContract, PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}, - response: &types.QueryGetShortBookResponse{ShortBook: msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetShortBookRequest{Price: "10000", ContractAddr: keepertest.TestContract, PriceDenom: keepertest.TestPriceDenom, AssetDenom: keepertest.TestAssetDenom}, - err: sdkerrors.ErrKeyNotFound, - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } { - t.Run(tc.desc, func(t *testing.T) { - response, err := wrapper.ShortBook(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} - -func TestShortBookQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - wrapper := keeperquery.KeeperWrapper{Keeper: keeper} - wctx := sdk.WrapSDKContext(ctx) - msgs := keepertest.CreateNShortBook(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllShortBookRequest { - return &types.QueryAllShortBookRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - ContractAddr: keepertest.TestContract, - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := wrapper.ShortBookAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.ShortBook), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.ShortBook), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := wrapper.ShortBookAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.ShortBook), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.ShortBook), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := wrapper.ShortBookAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.ShortBook), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := wrapper.ShortBookAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/dex/keeper/query/keeper_wrapper.go b/x/dex/keeper/query/keeper_wrapper.go deleted file mode 100644 index e1fcfdd04..000000000 --- a/x/dex/keeper/query/keeper_wrapper.go +++ /dev/null @@ -1,9 +0,0 @@ -package query - -import ( - "github.com/sei-protocol/sei-chain/x/dex/keeper" -) - -type KeeperWrapper struct { - *keeper.Keeper -} diff --git a/x/dex/keeper/short_book.go b/x/dex/keeper/short_book.go deleted file mode 100644 index 3e5763401..000000000 --- a/x/dex/keeper/short_book.go +++ /dev/null @@ -1,165 +0,0 @@ -package keeper - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" -) - -// SetShortBook set a specific shortBook in the store -func (k Keeper) SetShortBook(ctx sdk.Context, contractAddr string, shortBook types.ShortBook) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(false, contractAddr, shortBook.Entry.PriceDenom, shortBook.Entry.AssetDenom)) - b := k.Cdc.MustMarshal(&shortBook) - store.Set(GetKeyForShortBook(shortBook), b) -} - -func (k Keeper) SetShortOrderBookEntry(ctx sdk.Context, contractAddr string, shortBook types.OrderBookEntry) { - k.SetShortBook(ctx, contractAddr, *shortBook.(*types.ShortBook)) -} - -func (k Keeper) GetShortBookByPrice(ctx sdk.Context, contractAddr string, price sdk.Dec, priceDenom string, assetDenom string) (val types.ShortBook, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(false, contractAddr, priceDenom, assetDenom)) - b := store.Get(GetKeyForPrice(price)) - if b == nil { - return val, false - } - k.Cdc.MustUnmarshal(b, &val) - return val, true -} - -func (k Keeper) GetShortOrderBookEntryByPrice(ctx sdk.Context, contractAddr string, price sdk.Dec, priceDenom string, assetDenom string) (types.OrderBookEntry, bool) { - entry, found := k.GetShortBookByPrice(ctx, contractAddr, price, priceDenom, assetDenom) - return &entry, found -} - -func (k Keeper) RemoveShortBookByPrice(ctx sdk.Context, contractAddr string, price sdk.Dec, priceDenom string, assetDenom string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(false, contractAddr, priceDenom, assetDenom)) - store.Delete(GetKeyForPrice(price)) -} - -// GetAllShortBook returns all shortBook -func (k Keeper) GetAllShortBook(ctx sdk.Context, contractAddr string) (list []types.ShortBook) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ContractKeyPrefix(types.ShortBookKey, contractAddr)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.ShortBook - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -func (k Keeper) GetAllShortBookForPair(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string) (list []types.OrderBookEntry) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(false, contractAddr, priceDenom, assetDenom)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.ShortBook - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, &val) - } - - return -} - -func (k Keeper) GetTopNShortBooksForPair(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, n int) (list []types.OrderBookEntry) { - if n == 0 { - return - } - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(false, contractAddr, priceDenom, assetDenom)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.ShortBook - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, &val) - if len(list) == n { - break - } - } - - return -} - -// Load the first (up to) N short book entries whose price are larger than the specified limit -// in sorted order. -// Parameters: -// -// n: the largest number of entries to load -// startExclusive: the price limit -func (k Keeper) GetTopNShortBooksForPairStarting(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, n int, startExclusive sdk.Dec) (list []types.OrderBookEntry) { - if n == 0 { - return - } - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(false, contractAddr, priceDenom, assetDenom)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - // Fast-forward - // TODO: add iterator interface that allows starting at a certain subkey under prefix - for ; iterator.Valid(); iterator.Next() { - key := dexutils.BytesToDec(iterator.Key()) - if key.GT(startExclusive) { - break - } - } - - for ; iterator.Valid(); iterator.Next() { - var val types.ShortBook - k.Cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, &val) - if len(list) == n { - break - } - } - - return -} - -func (k Keeper) GetAllShortBookForPairPaginated(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, page *query.PageRequest) (list []types.ShortBook, pageRes *query.PageResponse, err error) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OrderBookPrefix(false, contractAddr, priceDenom, assetDenom)) - - pageRes, err = query.Paginate(store, page, func(key []byte, value []byte) error { - var shortBook types.ShortBook - if err := k.Cdc.Unmarshal(value, &shortBook); err != nil { - return err - } - - list = append(list, shortBook) - return nil - }) - - return -} - -func (k Keeper) GetShortAllocationForOrderID(ctx sdk.Context, contractAddr string, priceDenom string, assetDenom string, price sdk.Dec, orderID uint64) (*types.Allocation, bool) { - orderBook, found := k.GetShortBookByPrice(ctx, contractAddr, price, priceDenom, assetDenom) - if !found { - return nil, false - } - for _, allocation := range orderBook.Entry.Allocations { - if allocation.OrderId == orderID { - return allocation, true - } - } - return nil, false -} - -func (k Keeper) RemoveAllShortBooksForContract(ctx sdk.Context, contractAddr string) { - k.removeAllForPrefix(ctx, types.OrderBookContractPrefix(false, contractAddr)) -} - -func GetKeyForShortBook(shortBook types.ShortBook) []byte { - return GetKeyForPrice(shortBook.Entry.Price) -} diff --git a/x/dex/keeper/short_book_test.go b/x/dex/keeper/short_book_test.go deleted file mode 100644 index 62e709dfd..000000000 --- a/x/dex/keeper/short_book_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/testutil/nullify" - "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestShortBookGet(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - items := keepertest.CreateNShortBook(keeper, ctx, 10) - for i, item := range items { - got, found := keeper.GetShortBookByPrice(ctx, keepertest.TestContract, sdk.NewDec(int64(i)), keepertest.TestPriceDenom, keepertest.TestAssetDenom) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&got), - ) - } -} - -func TestShortBookRemove(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - items := keepertest.CreateNShortBook(keeper, ctx, 10) - for i := range items { - keeper.RemoveShortBookByPrice(ctx, keepertest.TestContract, sdk.NewDec(int64(i)), keepertest.TestPriceDenom, keepertest.TestAssetDenom) - _, found := keeper.GetShortBookByPrice(ctx, keepertest.TestContract, sdk.NewDec(int64(i)), keepertest.TestPriceDenom, keepertest.TestAssetDenom) - require.False(t, found) - } -} - -func TestShortBookGetAll(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - items := keepertest.CreateNShortBook(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllShortBook(ctx, keepertest.TestContract)), - ) -} - -func TestGetTopNShortBooksForPair(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - prices := []string{"9.99", "0.001", "90.0", "10", "10.01", "9.9", "9.0", "1"} - for _, price := range prices { - keeper.SetShortBook(ctx, keepertest.TestContract, types.ShortBook{ - Price: sdk.MustNewDecFromStr(price), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr(price), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }) - } - expected := []sdk.Dec{ - sdk.MustNewDecFromStr("0.001"), - sdk.MustNewDecFromStr("1"), - sdk.MustNewDecFromStr("9.0"), - sdk.MustNewDecFromStr("9.9"), - sdk.MustNewDecFromStr("9.99"), - sdk.MustNewDecFromStr("10"), - sdk.MustNewDecFromStr("10.01"), - sdk.MustNewDecFromStr("90.0"), - } - loaded := keeper.GetTopNShortBooksForPair(ctx, keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom, 10) - require.Equal(t, expected, utils.Map(loaded, func(b types.OrderBookEntry) sdk.Dec { return b.GetPrice() })) -} - -func TestGetTopNShortBooksForPairStarting(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - prices := []string{"9.99", "0.001", "90.0", "10", "10.01", "9.9", "9.0", "1"} - for _, price := range prices { - keeper.SetShortBook(ctx, keepertest.TestContract, types.ShortBook{ - Price: sdk.MustNewDecFromStr(price), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr(price), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - }, - }) - } - expected := []sdk.Dec{ - sdk.MustNewDecFromStr("9.0"), - sdk.MustNewDecFromStr("9.9"), - } - loaded := keeper.GetTopNShortBooksForPairStarting(ctx, keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom, 2, sdk.MustNewDecFromStr("1")) - require.Equal(t, expected, utils.Map(loaded, func(b types.OrderBookEntry) sdk.Dec { return b.GetPrice() })) -} diff --git a/x/dex/keeper/tick.go b/x/dex/keeper/tick.go deleted file mode 100644 index d89295266..000000000 --- a/x/dex/keeper/tick.go +++ /dev/null @@ -1,60 +0,0 @@ -package keeper - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// contract_addr, pair -> tick size -func (k Keeper) SetPriceTickSizeForPair(ctx sdk.Context, contractAddr string, pair types.Pair, ticksize sdk.Dec) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RegisteredPairPrefix(contractAddr)) - - pair, found := k.GetRegisteredPair(ctx, contractAddr, pair.PriceDenom, pair.AssetDenom) - if !found { - return types.ErrPairNotRegistered - } - pair.PriceTicksize = &ticksize - store.Set(types.PairPrefix(pair.PriceDenom, pair.AssetDenom), k.Cdc.MustMarshal(&pair)) - - ctx.EventManager().EmitEvent(sdk.NewEvent( - types.EventTypeSetPriceTickSize, - sdk.NewAttribute(types.AttributeKeyContractAddress, contractAddr), - )) - return nil -} - -func (k Keeper) GetPriceTickSizeForPair(ctx sdk.Context, contractAddr string, pair types.Pair) (sdk.Dec, bool) { - pair, found := k.GetRegisteredPair(ctx, contractAddr, pair.PriceDenom, pair.AssetDenom) - if !found { - return sdk.ZeroDec(), false - } - return *pair.PriceTicksize, true -} - -// contract_addr, pair -> tick size -func (k Keeper) SetQuantityTickSizeForPair(ctx sdk.Context, contractAddr string, pair types.Pair, ticksize sdk.Dec) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RegisteredPairPrefix(contractAddr)) - - pair, found := k.GetRegisteredPair(ctx, contractAddr, pair.PriceDenom, pair.AssetDenom) - if !found { - return types.ErrPairNotRegistered - } - pair.QuantityTicksize = &ticksize - store.Set(types.PairPrefix(pair.PriceDenom, pair.AssetDenom), k.Cdc.MustMarshal(&pair)) - - ctx.EventManager().EmitEvent(sdk.NewEvent( - types.EventTypeSetQuantityTickSize, - sdk.NewAttribute(types.AttributeKeyContractAddress, contractAddr), - )) - return nil -} - -func (k Keeper) GetQuantityTickSizeForPair(ctx sdk.Context, contractAddr string, pair types.Pair) (sdk.Dec, bool) { - pair, found := k.GetRegisteredPair(ctx, contractAddr, pair.PriceDenom, pair.AssetDenom) - if !found { - return sdk.ZeroDec(), false - } - return *pair.QuantityTicksize, true -} diff --git a/x/dex/keeper/tick_test.go b/x/dex/keeper/tick_test.go deleted file mode 100644 index 80abe43e9..000000000 --- a/x/dex/keeper/tick_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestPriceTickSizeGet(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - // TEST_PAIR = atom/usdc pair - contractAddr := "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m" - ticksize, found := keeper.GetPriceTickSizeForPair(ctx, contractAddr, keepertest.TestPair) - assert.Equal(t, ticksize, sdk.ZeroDec()) - assert.False(t, found) - - keeper.AddRegisteredPair(ctx, contractAddr, keepertest.TestPair) - err := keeper.SetPriceTickSizeForPair(ctx, contractAddr, keepertest.TestPair, sdk.NewDec(2)) - require.NoError(t, err) - ticksize, found = keeper.GetPriceTickSizeForPair(ctx, contractAddr, keepertest.TestPair) - assert.Equal(t, ticksize, sdk.NewDec(2)) - assert.True(t, found) -} - -func TestQuantityTickSizeGet(t *testing.T) { - keeper, ctx := keepertest.DexKeeper(t) - // TEST_PAIR = atom/usdc pair - contractAddr := "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m" - ticksize, found := keeper.GetQuantityTickSizeForPair(ctx, contractAddr, keepertest.TestPair) - assert.Equal(t, ticksize, sdk.ZeroDec()) - assert.False(t, found) - - keeper.AddRegisteredPair(ctx, contractAddr, keepertest.TestPair) - err := keeper.SetQuantityTickSizeForPair(ctx, contractAddr, keepertest.TestPair, sdk.NewDec(2)) - require.NoError(t, err) - ticksize, found = keeper.GetQuantityTickSizeForPair(ctx, contractAddr, keepertest.TestPair) - assert.Equal(t, ticksize, sdk.NewDec(2)) - assert.True(t, found) -} diff --git a/x/dex/keeper/utils/order_book.go b/x/dex/keeper/utils/order_book.go deleted file mode 100644 index c232ac27f..000000000 --- a/x/dex/keeper/utils/order_book.go +++ /dev/null @@ -1,89 +0,0 @@ -package utils - -import ( - "fmt" - "sync" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/utils/datastructures" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func PopulateOrderbook( - ctx sdk.Context, - keeper *keeper.Keeper, - contractAddr types.ContractAddress, - pair types.Pair, -) *types.OrderBook { - // TODO update to param - loadCnt := int(keeper.GetOrderBookEntriesPerLoad(ctx)) - longLoader := func(lctx sdk.Context, startExclusive sdk.Dec, withLimit bool) []types.OrderBookEntry { - if !withLimit { - return keeper.GetTopNLongBooksForPair(lctx, string(contractAddr), pair.PriceDenom, pair.AssetDenom, loadCnt) - } - return keeper.GetTopNLongBooksForPairStarting(lctx, string(contractAddr), pair.PriceDenom, pair.AssetDenom, loadCnt, startExclusive) - } - shortLoader := func(lctx sdk.Context, startExclusive sdk.Dec, withLimit bool) []types.OrderBookEntry { - if !withLimit { - return keeper.GetTopNShortBooksForPair(lctx, string(contractAddr), pair.PriceDenom, pair.AssetDenom, loadCnt) - } - return keeper.GetTopNShortBooksForPairStarting(lctx, string(contractAddr), pair.PriceDenom, pair.AssetDenom, loadCnt, startExclusive) - } - longSetter := func(lctx sdk.Context, o types.OrderBookEntry) { - keeper.SetLongOrderBookEntry(lctx, string(contractAddr), o) - err := keeper.SetOrderCount(lctx, string(contractAddr), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_LONG, o.GetPrice(), uint64(len(o.GetOrderEntry().GetAllocations()))) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error setting order count: %s", err)) - } - } - shortSetter := func(lctx sdk.Context, o types.OrderBookEntry) { - keeper.SetShortOrderBookEntry(lctx, string(contractAddr), o) - err := keeper.SetOrderCount(lctx, string(contractAddr), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_SHORT, o.GetPrice(), uint64(len(o.GetOrderEntry().GetAllocations()))) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error setting order count: %s", err)) - } - } - longDeleter := func(lctx sdk.Context, o types.OrderBookEntry) { - keeper.RemoveLongBookByPrice(lctx, string(contractAddr), o.GetPrice(), pair.PriceDenom, pair.AssetDenom) - err := keeper.SetOrderCount(lctx, string(contractAddr), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_LONG, o.GetPrice(), 0) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error setting order count: %s", err)) - } - } - shortDeleter := func(lctx sdk.Context, o types.OrderBookEntry) { - keeper.RemoveShortBookByPrice(lctx, string(contractAddr), o.GetPrice(), pair.PriceDenom, pair.AssetDenom) - err := keeper.SetOrderCount(lctx, string(contractAddr), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_SHORT, o.GetPrice(), 0) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("error setting order count: %s", err)) - } - } - return &types.OrderBook{ - Contract: contractAddr, - Pair: pair, - Longs: types.NewCachedSortedOrderBookEntries(longLoader, longSetter, longDeleter), - Shorts: types.NewCachedSortedOrderBookEntries(shortLoader, shortSetter, shortDeleter), - } -} - -func PopulateAllOrderbooks( - ctx sdk.Context, - keeper *keeper.Keeper, - contractsAndPairs map[string][]types.Pair, -) *datastructures.TypedNestedSyncMap[string, types.PairString, *types.OrderBook] { - var orderBooks = datastructures.NewTypedNestedSyncMap[string, types.PairString, *types.OrderBook]() - wg := sync.WaitGroup{} - for contractAddr, pairs := range contractsAndPairs { - orderBooks.Store(contractAddr, datastructures.NewTypedSyncMap[types.PairString, *types.OrderBook]()) - for _, pair := range pairs { - wg.Add(1) - go func(contractAddr string, pair types.Pair) { - defer wg.Done() - orderBook := PopulateOrderbook(ctx, keeper, types.ContractAddress(contractAddr), pair) - orderBooks.StoreNested(contractAddr, types.GetPairString(&pair), orderBook) - }(contractAddr, pair) - } - } - wg.Wait() - return orderBooks -} diff --git a/x/dex/keeper/utils/price.go b/x/dex/keeper/utils/price.go deleted file mode 100644 index 9552c2fb7..000000000 --- a/x/dex/keeper/utils/price.go +++ /dev/null @@ -1,28 +0,0 @@ -package utils - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/exchange" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func SetPriceStateFromExecutionOutcome( - ctx sdk.Context, - keeper *keeper.Keeper, - contractAddr types.ContractAddress, - pair types.Pair, - outcome exchange.ExecutionOutcome, -) { - if outcome.TotalQuantity.IsZero() { - return - } - - avgPrice := outcome.TotalNotional.Quo(outcome.TotalQuantity) - priceState := types.Price{ - Pair: &pair, - Price: avgPrice, - SnapshotTimestampInSeconds: uint64(ctx.BlockTime().Unix()), - } - keeper.SetPriceState(ctx, priceState, string(contractAddr)) -} diff --git a/x/dex/keeper/utils/wasm.go b/x/dex/keeper/utils/wasm.go deleted file mode 100644 index 8cc335455..000000000 --- a/x/dex/keeper/utils/wasm.go +++ /dev/null @@ -1,116 +0,0 @@ -package utils - -import ( - "encoding/json" - "fmt" - "strings" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/utils/logging" - "github.com/sei-protocol/sei-chain/utils/metrics" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -const ErrWasmModuleInstCPUFeatureLiteral = "Error instantiating module: CpuFeature" -const SudoGasEventKey = "sudo-gas" -const LogAfter = 5 * time.Second - -func getMsgType(msg interface{}) string { - switch msg.(type) { - case types.SudoSettlementMsg: - return "settlement" - case types.SudoOrderPlacementMsg: - return "bulk_order_placements" - case types.SudoOrderCancellationMsg: - return "bulk_order_cancellations" - default: - return "unknown" - } -} - -func sudo(sdkCtx sdk.Context, k *keeper.Keeper, contractAddress sdk.AccAddress, wasmMsg []byte, msgType string) ([]byte, uint64, error) { - defer utils.PanicHandler(func(err any) { - utils.MetricsPanicCallback(err, sdkCtx, fmt.Sprintf("%s|%s", contractAddress, msgType)) - })() - - // Measure the time it takes to execute the contract in WASM - defer metrics.MeasureSudoExecutionDuration(time.Now(), msgType) - // set up a tmp context to prevent race condition in reading gas consumed - // Note that the limit will effectively serve as a soft limit since it's - // possible for the actual computation to go above the specified limit, but - // the associated contract would be charged corresponding rent. - gasLimit, err := k.GetContractGasLimit(sdkCtx, contractAddress) - if err != nil { - return nil, 0, err - } - tmpCtx := sdkCtx.WithGasMeter(sdk.NewGasMeterWithMultiplier(sdkCtx, gasLimit)) - data, err := sudoWithoutOutOfGasPanic(tmpCtx, k, contractAddress, wasmMsg, msgType) - gasConsumed := tmpCtx.GasMeter().GasConsumed() - sdkCtx.EventManager().EmitEvent( - sdk.NewEvent( - SudoGasEventKey, - sdk.NewAttribute("consumed", fmt.Sprintf("%d", gasConsumed)), - sdk.NewAttribute("type", msgType), - sdk.NewAttribute("contract", contractAddress.String()), - sdk.NewAttribute("height", fmt.Sprintf("%d", sdkCtx.BlockHeight())), - ), - ) - if gasConsumed > 0 { - sdkCtx.GasMeter().ConsumeGas(gasConsumed, "sudo") - } - if hasErrInstantiatingWasmModuleDueToCPUFeature(err) { - panic(utils.DecorateHardFailError(err)) - } - return data, gasConsumed, err -} - -func sudoWithoutOutOfGasPanic(ctx sdk.Context, k *keeper.Keeper, contractAddress []byte, wasmMsg []byte, logName string) ([]byte, error) { - defer func() { - if err := recover(); err != nil { - // only propagate panic if the error is NOT out of gas - if _, ok := err.(sdk.ErrorOutOfGas); !ok { - panic(err) - } - ctx.Logger().Error(fmt.Sprintf("%s %s is out of gas", sdk.AccAddress(contractAddress).String(), logName)) - } - }() - return logging.LogIfNotDoneAfter(ctx.Logger(), func() ([]byte, error) { - return k.WasmKeeper.Sudo(ctx, contractAddress, wasmMsg) - }, LogAfter, fmt.Sprintf("wasm_sudo_%s", logName)) -} - -func hasErrInstantiatingWasmModuleDueToCPUFeature(err error) bool { - if err == nil { - return false - } - return strings.Contains(err.Error(), ErrWasmModuleInstCPUFeatureLiteral) -} - -func CallContractSudo(sdkCtx sdk.Context, k *keeper.Keeper, contractAddr string, msg interface{}, gasAllowance uint64) ([]byte, error) { - contractAddress, err := sdk.AccAddressFromBech32(contractAddr) - if err != nil { - sdkCtx.Logger().Error(err.Error()) - return []byte{}, err - } - wasmMsg, err := json.Marshal(msg) - if err != nil { - sdkCtx.Logger().Error(err.Error()) - return []byte{}, err - } - msgType := getMsgType(msg) - data, gasUsed, suderr := sudo(sdkCtx, k, contractAddress, wasmMsg, msgType) - if err := k.ChargeRentForGas(sdkCtx, contractAddr, gasUsed, gasAllowance); err != nil { - metrics.IncrementSudoFailCount(msgType) - sdkCtx.Logger().Error(err.Error()) - return []byte{}, err - } - if suderr != nil { - metrics.IncrementSudoFailCount(msgType) - sdkCtx.Logger().Error(suderr.Error()) - return []byte{}, suderr - } - return data, nil -} diff --git a/x/dex/migrations/v10_to_v11.go b/x/dex/migrations/v10_to_v11.go deleted file mode 100644 index 4f35a5e68..000000000 --- a/x/dex/migrations/v10_to_v11.go +++ /dev/null @@ -1,45 +0,0 @@ -package migrations - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -var DexPrefixes = []string{ - types.LongBookKey, - types.ShortBookKey, - "TriggerBook-value-", - types.OrderKey, - types.TwapKey, - types.RegisteredPairKey, - types.OrderKey, - types.CancelKey, - types.AccountActiveOrdersKey, - types.NextOrderIDKey, - types.MatchResultKey, - types.MemOrderKey, - types.MemCancelKey, - types.MemDepositKey, - types.PriceKey, - "SettlementEntry-", - "NextSettlementID-", -} - -func V10ToV11(ctx sdk.Context, dexkeeper keeper.Keeper) error { - dexkeeper.CreateModuleAccount(ctx) - - // this will nuke all old prefixes data in the store - for _, prefixKey := range DexPrefixes { - store := prefix.NewStore(ctx.KVStore(dexkeeper.GetStoreKey()), []byte(prefixKey)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - store.Delete(iterator.Key()) - } - } - - return nil -} diff --git a/x/dex/migrations/v10_to_v11_test.go b/x/dex/migrations/v10_to_v11_test.go deleted file mode 100644 index 775c20928..000000000 --- a/x/dex/migrations/v10_to_v11_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package migrations_test - -import ( - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate10to11(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - // write old contract - store := ctx.KVStore(dexkeeper.GetStoreKey()) - value := []byte("test_value") - store.Set(types.ContractKeyPrefix(types.LongBookKey, keepertest.TestContract), value) - store.Set(types.OrderBookPrefix(false, keepertest.TestContract, "USDC", "ATOM"), value) - store.Set(TriggerOrderBookPrefix(keepertest.TestContract, "USDC", "ATOM"), value) - store.Set(types.PricePrefix(keepertest.TestContract, "USDC", "ATOM"), value) - store.Set(migrations.SettlementEntryPrefix(keepertest.TestContract, "USDC", "ATOM"), value) - store.Set(types.RegisteredPairPrefix(keepertest.TestContract), value) - store.Set(types.OrderPrefix(keepertest.TestContract), value) - store.Set(types.NextOrderIDPrefix(keepertest.TestContract), value) - store.Set(migrations.NextSettlementIDPrefix(keepertest.TestContract, "USDC", "ATOM"), value) - store.Set(types.MatchResultPrefix(keepertest.TestContract), value) - store.Set(types.MemOrderPrefixForPair(keepertest.TestContract, "USDC", "ATOM"), value) - store.Set(types.MemCancelPrefixForPair(keepertest.TestContract, "USDC", "ATOM"), value) - store.Set(types.MemOrderPrefix(keepertest.TestContract), value) - store.Set(types.MemCancelPrefix(keepertest.TestContract), value) - store.Set(types.MemDepositPrefix(keepertest.TestContract), value) - - err := migrations.V10ToV11(ctx, *dexkeeper) - require.NoError(t, err) - - require.False(t, store.Has(types.ContractKeyPrefix(types.LongBookKey, keepertest.TestContract))) - require.False(t, store.Has(types.OrderBookPrefix(false, keepertest.TestContract, "USDC", "ATOM"))) - require.False(t, store.Has(TriggerOrderBookPrefix(keepertest.TestContract, "USDC", "ATOM"))) - require.False(t, store.Has(types.PricePrefix(keepertest.TestContract, "USDC", "ATOM"))) - require.False(t, store.Has(migrations.SettlementEntryPrefix(keepertest.TestContract, "USDC", "ATOM"))) - require.False(t, store.Has(types.RegisteredPairPrefix(keepertest.TestContract))) - require.False(t, store.Has(types.OrderPrefix(keepertest.TestContract))) - require.False(t, store.Has(types.NextOrderIDPrefix(keepertest.TestContract))) - require.False(t, store.Has(migrations.NextSettlementIDPrefix(keepertest.TestContract, "USDC", "ATOM"))) - require.False(t, store.Has(types.MatchResultPrefix(keepertest.TestContract))) - require.False(t, store.Has(types.MemOrderPrefixForPair(keepertest.TestContract, "USDC", "ATOM"))) - require.False(t, store.Has(types.MemCancelPrefixForPair(keepertest.TestContract, "USDC", "ATOM"))) - require.False(t, store.Has(types.MemOrderPrefix(keepertest.TestContract))) - require.False(t, store.Has(types.MemCancelPrefix(keepertest.TestContract))) - require.False(t, store.Has(types.MemDepositPrefix(keepertest.TestContract))) -} - -func TriggerOrderBookPrefix(contractAddr string, priceDenom string, assetDenom string) []byte { - prefix := types.KeyPrefix("TriggerBook-value-") - - return append( - append(prefix, types.AddressKeyPrefix(contractAddr)...), - types.PairPrefix(priceDenom, assetDenom)..., - ) -} diff --git a/x/dex/migrations/v11_to_v12.go b/x/dex/migrations/v11_to_v12.go deleted file mode 100644 index 66c68a44a..000000000 --- a/x/dex/migrations/v11_to_v12.go +++ /dev/null @@ -1,13 +0,0 @@ -package migrations - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V11ToV12(ctx sdk.Context, dexkeeper keeper.Keeper) error { - defaultParams := types.DefaultParams() - dexkeeper.SetParams(ctx, defaultParams) - return nil -} diff --git a/x/dex/migrations/v11_to_v12_test.go b/x/dex/migrations/v11_to_v12_test.go deleted file mode 100644 index bf0baf6ca..000000000 --- a/x/dex/migrations/v11_to_v12_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package migrations_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate11to12(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - // write old params - defaultParams := types.Params{ - PriceSnapshotRetention: 1, - SudoCallGasPrice: sdk.OneDec(), - BeginBlockGasLimit: 1, - EndBlockGasLimit: 1, - DefaultGasPerOrder: 1, - DefaultGasPerCancel: 1, - } - dexkeeper.SetParams(ctx, defaultParams) - - // migrate to default params - err := migrations.V11ToV12(ctx, *dexkeeper) - require.NoError(t, err) - params := dexkeeper.GetParams(ctx) - require.Equal(t, params, types.DefaultParams()) -} diff --git a/x/dex/migrations/v12_to_v13.go b/x/dex/migrations/v12_to_v13.go deleted file mode 100644 index 9bd5891f7..000000000 --- a/x/dex/migrations/v12_to_v13.go +++ /dev/null @@ -1,15 +0,0 @@ -package migrations - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V12ToV13(ctx sdk.Context, dexkeeper keeper.Keeper) error { - // This isn't the cleanest migration since it could potentially revert any dex params we have changed - // but we haven't, so we'll just do this. - defaultParams := types.DefaultParams() - dexkeeper.SetParams(ctx, defaultParams) - return nil -} diff --git a/x/dex/migrations/v12_to_v13_test.go b/x/dex/migrations/v12_to_v13_test.go deleted file mode 100644 index fd70a50ce..000000000 --- a/x/dex/migrations/v12_to_v13_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package migrations_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate12to13(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - // write old params - prevParams := types.Params{ - PriceSnapshotRetention: 1, - SudoCallGasPrice: sdk.OneDec(), - BeginBlockGasLimit: 1, - EndBlockGasLimit: 1, - DefaultGasPerOrder: 1, - DefaultGasPerCancel: 1, - } - dexkeeper.SetParams(ctx, prevParams) - - // migrate to default params - err := migrations.V12ToV13(ctx, *dexkeeper) - require.NoError(t, err) - params := dexkeeper.GetParams(ctx) - require.Equal(t, params.GasAllowancePerSettlement, uint64(types.DefaultGasAllowancePerSettlement)) - require.Equal(t, params.MinProcessableRent, uint64(types.DefaultMinProcessableRent)) -} diff --git a/x/dex/migrations/v13_to_v14.go b/x/dex/migrations/v13_to_v14.go deleted file mode 100644 index 062cc35c8..000000000 --- a/x/dex/migrations/v13_to_v14.go +++ /dev/null @@ -1,69 +0,0 @@ -package migrations - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V13ToV14(ctx sdk.Context, dexkeeper keeper.Keeper) error { - setDefaultParams(ctx, dexkeeper) - - for _, contractAddr := range getAllContractAddresses(ctx, dexkeeper) { - convertOrderBookEntryKeysForContract(ctx, dexkeeper, contractAddr) - } - return nil -} - -func setDefaultParams(ctx sdk.Context, dexkeeper keeper.Keeper) { - // This isn't the cleanest migration since it could potentially revert any dex params we have changed - // but we haven't, so we'll just do this. - defaultParams := types.DefaultParams() - dexkeeper.SetParams(ctx, defaultParams) -} - -func getAllContractAddresses(ctx sdk.Context, dexkeeper keeper.Keeper) []string { - contracts := dexkeeper.GetAllContractInfo(ctx) - return utils.Map(contracts, func(c types.ContractInfoV2) string { return c.ContractAddr }) -} - -func convertOrderBookEntryKeysForContract(ctx sdk.Context, dexkeeper keeper.Keeper, contractAddr string) { - ctx.Logger().Info(fmt.Sprintf("converting order book entry keys for contract %s", contractAddr)) - store := prefix.NewStore(ctx.KVStore(dexkeeper.GetStoreKey()), types.ContractKeyPrefix(types.LongBookKey, contractAddr)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - keyToVal := map[string][]byte{} - for ; iterator.Valid(); iterator.Next() { - keyToVal[string(iterator.Key())] = iterator.Value() - } - iterator.Close() - - for key, v := range keyToVal { - store.Delete([]byte(key)) - var val types.LongBook - dexkeeper.Cdc.MustUnmarshal(v, &val) - newKey := append(types.PairPrefix(val.Entry.PriceDenom, val.Entry.AssetDenom), keeper.GetKeyForPrice(val.Price)...) - store.Set(newKey, v) - } - - store = prefix.NewStore(ctx.KVStore(dexkeeper.GetStoreKey()), types.ContractKeyPrefix(types.ShortBookKey, contractAddr)) - iterator = sdk.KVStorePrefixIterator(store, []byte{}) - - keyToVal = map[string][]byte{} - for ; iterator.Valid(); iterator.Next() { - keyToVal[string(iterator.Key())] = iterator.Value() - } - iterator.Close() - - for key, v := range keyToVal { - store.Delete([]byte(key)) - var val types.ShortBook - dexkeeper.Cdc.MustUnmarshal(v, &val) - newKey := append(types.PairPrefix(val.Entry.PriceDenom, val.Entry.AssetDenom), keeper.GetKeyForPrice(val.Price)...) - store.Set(newKey, v) - } -} diff --git a/x/dex/migrations/v13_to_v14_test.go b/x/dex/migrations/v13_to_v14_test.go deleted file mode 100644 index b9937b3e3..000000000 --- a/x/dex/migrations/v13_to_v14_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package migrations_test - -import ( - "testing" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/stretchr/testify/require" -) - -func TestMigrate13to14(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - // write old params - prevParams := types.Params{ - PriceSnapshotRetention: 1, - SudoCallGasPrice: sdk.OneDec(), - BeginBlockGasLimit: 1, - EndBlockGasLimit: 1, - DefaultGasPerOrder: 1, - DefaultGasPerCancel: 1, - GasAllowancePerSettlement: 1, - MinProcessableRent: 1, - } - dexkeeper.SetParams(ctx, prevParams) - - dexkeeper.SetContract(ctx, &types.ContractInfoV2{ContractAddr: keepertest.TestContract}) - longStore := prefix.NewStore(ctx.KVStore(dexkeeper.GetStoreKey()), types.OrderBookPrefix( - true, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, - )) - longEntry := types.LongBook{ - Price: sdk.MustNewDecFromStr("10.123"), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr("10.123"), - Quantity: sdk.MustNewDecFromStr("5"), - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - }, - } - longEntryKey, err := longEntry.GetPrice().Marshal() - require.Nil(t, err) - longStore.Set(longEntryKey, dexkeeper.Cdc.MustMarshal(&longEntry)) - - shortStore := prefix.NewStore(ctx.KVStore(dexkeeper.GetStoreKey()), types.OrderBookPrefix( - false, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom, - )) - shortEntry := types.ShortBook{ - Price: sdk.MustNewDecFromStr("12.456"), - Entry: &types.OrderEntry{ - Price: sdk.MustNewDecFromStr("12.456"), - Quantity: sdk.MustNewDecFromStr("4"), - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - }, - } - shortEntryKey, err := shortEntry.GetPrice().Marshal() - require.Nil(t, err) - shortStore.Set(shortEntryKey, dexkeeper.Cdc.MustMarshal(&shortEntry)) - - // migrate to default params - err = migrations.V13ToV14(ctx, *dexkeeper) - require.NoError(t, err) - params := dexkeeper.GetParams(ctx) - require.Equal(t, params.OrderBookEntriesPerLoad, uint64(types.DefaultOrderBookEntriesPerLoad)) - - require.Nil(t, longStore.Get(longEntryKey)) - require.Nil(t, shortStore.Get(shortEntryKey)) - var loadedLongEntry types.LongBook - dexkeeper.Cdc.MustUnmarshal(longStore.Get(utils.DecToBigEndian(longEntry.Price)), &loadedLongEntry) - require.Equal(t, longEntry.Price, loadedLongEntry.Price) - require.Equal(t, *longEntry.Entry, *loadedLongEntry.Entry) - var loadedShortEntry types.ShortBook - dexkeeper.Cdc.MustUnmarshal(shortStore.Get(utils.DecToBigEndian(shortEntry.Price)), &loadedShortEntry) - require.Equal(t, shortEntry.Price, loadedShortEntry.Price) - require.Equal(t, *shortEntry.Entry, *loadedShortEntry.Entry) -} diff --git a/x/dex/migrations/v14_to_v15.go b/x/dex/migrations/v14_to_v15.go deleted file mode 100644 index 158990fb1..000000000 --- a/x/dex/migrations/v14_to_v15.go +++ /dev/null @@ -1,15 +0,0 @@ -package migrations - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V14ToV15(ctx sdk.Context, dexkeeper keeper.Keeper) error { - // This isn't the cleanest migration since it could potentially revert any dex params we have changed - // but we haven't, so we'll just do this. - defaultParams := types.DefaultParams() - dexkeeper.SetParams(ctx, defaultParams) - return nil -} diff --git a/x/dex/migrations/v14_to_v15_test.go b/x/dex/migrations/v14_to_v15_test.go deleted file mode 100644 index f6d76f1c7..000000000 --- a/x/dex/migrations/v14_to_v15_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package migrations_test - -import ( - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate14to15(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - // write old params - prevParams := types.DefaultParams() - prevParams.MaxOrderPerPrice = 0 - prevParams.MaxPairsPerContract = 0 - dexkeeper.SetParams(ctx, prevParams) - - // migrate to default params - err := migrations.V14ToV15(ctx, *dexkeeper) - require.NoError(t, err) - params := dexkeeper.GetParams(ctx) - require.Equal(t, params.MaxOrderPerPrice, uint64(types.DefaultMaxOrderPerPrice)) - require.Equal(t, params.MaxPairsPerContract, uint64(types.DefaultMaxPairsPerContract)) -} diff --git a/x/dex/migrations/v15_to_v16.go b/x/dex/migrations/v15_to_v16.go deleted file mode 100644 index 3e5f9eb39..000000000 --- a/x/dex/migrations/v15_to_v16.go +++ /dev/null @@ -1,15 +0,0 @@ -package migrations - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V15ToV16(ctx sdk.Context, dexkeeper keeper.Keeper) error { - // This isn't the cleanest migration since it could potentially revert any dex params we have changed - // but we haven't, so we'll just do this. - defaultParams := types.DefaultParams() - dexkeeper.SetParams(ctx, defaultParams) - return nil -} diff --git a/x/dex/migrations/v15_to_v16_test.go b/x/dex/migrations/v15_to_v16_test.go deleted file mode 100644 index 48fa655ff..000000000 --- a/x/dex/migrations/v15_to_v16_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package migrations_test - -import ( - "testing" - - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate15to16(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - // write old params - prevParams := types.DefaultParams() - prevParams.DefaultGasPerOrderDataByte = 0 - dexkeeper.SetParams(ctx, prevParams) - - // migrate to default params - err := migrations.V15ToV16(ctx, *dexkeeper) - require.NoError(t, err) - params := dexkeeper.GetParams(ctx) - require.Equal(t, params.DefaultGasPerOrderDataByte, uint64(30)) -} diff --git a/x/dex/migrations/v16_to_v17.go b/x/dex/migrations/v16_to_v17.go deleted file mode 100644 index 7066db584..000000000 --- a/x/dex/migrations/v16_to_v17.go +++ /dev/null @@ -1,110 +0,0 @@ -package migrations - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/goutils" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -const OldPairSeparator = '|' - -func OldPairPrefix(priceDenom string, assetDenom string) []byte { - return goutils.ImmutableAppend(goutils.ImmutableAppend([]byte(priceDenom), OldPairSeparator), []byte(assetDenom)...) -} - -func V16ToV17(ctx sdk.Context, dexkeeper keeper.Keeper) error { - rootStore := ctx.KVStore(dexkeeper.GetStoreKey()) - - handler := func(oldPref []byte, newPref []byte) { - store := prefix.NewStore(rootStore, oldPref) - kv := map[string][]byte{} - iter := store.Iterator(nil, nil) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - kv[string(iter.Key())] = iter.Value() - } - for k, v := range kv { - kbz := []byte(k) - store.Delete(kbz) - rootStore.Set(goutils.ImmutableAppend(newPref, kbz...), v) - } - } - - for _, c := range dexkeeper.GetAllContractInfo(ctx) { - for _, p := range dexkeeper.GetAllRegisteredPairs(ctx, c.ContractAddr) { - // long order book - handler( - goutils.ImmutableAppend( - types.OrderBookContractPrefix(true, c.ContractAddr), - OldPairPrefix(p.PriceDenom, p.AssetDenom)..., - ), - types.OrderBookPrefix(true, c.ContractAddr, p.PriceDenom, p.AssetDenom), - ) - - // short order book - handler( - goutils.ImmutableAppend( - types.OrderBookContractPrefix(false, c.ContractAddr), - OldPairPrefix(p.PriceDenom, p.AssetDenom)..., - ), - types.OrderBookPrefix(false, c.ContractAddr, p.PriceDenom, p.AssetDenom), - ) - - // price - handler( - goutils.ImmutableAppend( - types.PriceContractPrefix(c.ContractAddr), - OldPairPrefix(p.PriceDenom, p.AssetDenom)..., - ), - types.PricePrefix(c.ContractAddr, p.PriceDenom, p.AssetDenom), - ) - - // order count (long) - handler( - goutils.ImmutableAppend( - goutils.ImmutableAppend(types.KeyPrefix(types.LongOrderCountKey), types.AddressKeyPrefix(c.ContractAddr)...), - OldPairPrefix(p.PriceDenom, p.AssetDenom)..., - ), - types.OrderCountPrefix(c.ContractAddr, p.PriceDenom, p.AssetDenom, true), - ) - - // order count (short) - handler( - goutils.ImmutableAppend( - goutils.ImmutableAppend(types.KeyPrefix(types.ShortOrderCountKey), types.AddressKeyPrefix(c.ContractAddr)...), - OldPairPrefix(p.PriceDenom, p.AssetDenom)..., - ), - types.OrderCountPrefix(c.ContractAddr, p.PriceDenom, p.AssetDenom, false), - ) - - // registered pair - k := goutils.ImmutableAppend(types.RegisteredPairPrefix(c.ContractAddr), OldPairPrefix(p.PriceDenom, p.AssetDenom)...) - pair := rootStore.Get(k) - rootStore.Delete(k) - rootStore.Set( - goutils.ImmutableAppend(types.RegisteredPairPrefix(c.ContractAddr), types.PairPrefix(p.PriceDenom, p.AssetDenom)...), - pair, - ) - } - } - - // asset list - pref := types.KeyPrefix(types.AssetListKey) - store := prefix.NewStore(rootStore, pref) - kv := map[string][]byte{} - iter := store.Iterator(nil, nil) - for ; iter.Valid(); iter.Next() { - kv[string(iter.Key())] = iter.Value() - } - iter.Close() - for k, v := range kv { - kbz := []byte(k) - store.Delete(kbz) - denom := string(kbz) - newKbz := types.AssetListPrefix(denom) - rootStore.Set(newKbz, v) - } - return nil -} diff --git a/x/dex/migrations/v16_to_v17_test.go b/x/dex/migrations/v16_to_v17_test.go deleted file mode 100644 index ac6c7ad0d..000000000 --- a/x/dex/migrations/v16_to_v17_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package migrations_test - -import ( - "testing" - - "github.com/sei-protocol/goutils" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate16to17(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - store := ctx.KVStore(dexkeeper.GetStoreKey()) - dexkeeper.SetContract(ctx, &types.ContractInfoV2{ContractAddr: keepertest.TestContract}) - // add registered pair using the old key - pair := types.Pair{PriceDenom: keepertest.TestPair.PriceDenom, AssetDenom: keepertest.TestPair.AssetDenom} - store.Set( - goutils.ImmutableAppend( - types.RegisteredPairPrefix(keepertest.TestContract), - migrations.OldPairPrefix(keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom)..., - ), - dexkeeper.Cdc.MustMarshal(&pair), - ) - - value := []byte("test_value") - store.Set(goutils.ImmutableAppend( - types.OrderBookContractPrefix(true, keepertest.TestContract), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ), value) - store.Set(goutils.ImmutableAppend( - types.OrderBookContractPrefix(false, keepertest.TestContract), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ), value) - store.Set(goutils.ImmutableAppend( - types.PriceContractPrefix(keepertest.TestContract), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ), value) - store.Set(goutils.ImmutableAppend( - goutils.ImmutableAppend(types.KeyPrefix(types.LongOrderCountKey), types.AddressKeyPrefix(keepertest.TestContract)...), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ), value) - store.Set(goutils.ImmutableAppend( - goutils.ImmutableAppend(types.KeyPrefix(types.ShortOrderCountKey), types.AddressKeyPrefix(keepertest.TestContract)...), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ), value) - store.Set(goutils.ImmutableAppend(types.KeyPrefix(types.AssetListKey), []byte(pair.PriceDenom)...), value) - - err := migrations.V16ToV17(ctx, *dexkeeper) - require.NoError(t, err) - - require.False(t, store.Has(goutils.ImmutableAppend( - types.OrderBookContractPrefix(true, keepertest.TestContract), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ))) - require.False(t, store.Has(goutils.ImmutableAppend( - types.OrderBookContractPrefix(false, keepertest.TestContract), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ))) - require.False(t, store.Has(goutils.ImmutableAppend( - types.PriceContractPrefix(keepertest.TestContract), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ))) - require.False(t, store.Has(goutils.ImmutableAppend( - goutils.ImmutableAppend(types.KeyPrefix(types.LongOrderCountKey), types.AddressKeyPrefix(keepertest.TestContract)...), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ))) - require.False(t, store.Has(goutils.ImmutableAppend( - goutils.ImmutableAppend(types.KeyPrefix(types.ShortOrderCountKey), types.AddressKeyPrefix(keepertest.TestContract)...), - migrations.OldPairPrefix(pair.PriceDenom, pair.AssetDenom)..., - ))) - require.False(t, store.Has(goutils.ImmutableAppend(types.KeyPrefix(types.AssetListKey), []byte(pair.PriceDenom)...))) - require.False(t, store.Has(goutils.ImmutableAppend( - types.RegisteredPairPrefix(keepertest.TestContract), - migrations.OldPairPrefix(keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom)..., - ))) - - require.True(t, store.Has(types.OrderBookPrefix(true, keepertest.TestContract, pair.PriceDenom, pair.AssetDenom))) - require.True(t, store.Has(types.OrderBookPrefix(false, keepertest.TestContract, pair.PriceDenom, pair.AssetDenom))) - require.True(t, store.Has(types.PricePrefix(keepertest.TestContract, pair.PriceDenom, pair.AssetDenom))) - require.True(t, store.Has(types.OrderCountPrefix(keepertest.TestContract, pair.PriceDenom, pair.AssetDenom, true))) - require.True(t, store.Has(types.OrderCountPrefix(keepertest.TestContract, pair.PriceDenom, pair.AssetDenom, false))) - require.True(t, store.Has(types.AssetListPrefix(pair.PriceDenom))) - require.True(t, store.Has(goutils.ImmutableAppend( - types.RegisteredPairPrefix(keepertest.TestContract), - types.PairPrefix(keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom)..., - ))) -} diff --git a/x/dex/migrations/v17_to_v18.go b/x/dex/migrations/v17_to_v18.go deleted file mode 100644 index 7e6448bac..000000000 --- a/x/dex/migrations/v17_to_v18.go +++ /dev/null @@ -1,33 +0,0 @@ -package migrations - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V17ToV18(ctx sdk.Context, dexkeeper keeper.Keeper) error { - // iterate over all contracts and unregister them - for _, c := range dexkeeper.GetAllContractInfo(ctx) { - if err := dexkeeper.DoUnregisterContractWithRefund(ctx, c); err != nil { - return err - } - } - // get module address - dexAddr := dexkeeper.AccountKeeper.GetModuleAddress(dextypes.ModuleName) - // send usei to the feecollector - useiCoins := dexkeeper.BankKeeper.GetBalance(ctx, dexAddr, sdk.MustGetBaseDenom()) - if err := dexkeeper.BankKeeper.SendCoinsFromModuleToModule(ctx, dextypes.ModuleName, authtypes.FeeCollectorName, sdk.NewCoins(useiCoins)); err != nil { - return err - } - // get bank balances remaining for module - balances := dexkeeper.BankKeeper.GetAllBalances(ctx, dexAddr) - // update accountkeeper to give dex burner perms - dexkeeper.CreateModuleAccount(ctx) - // burn all remaining module balances - need burner perms - if err := dexkeeper.BankKeeper.BurnCoins(ctx, dextypes.ModuleName, balances); err != nil { - return err - } - return nil -} diff --git a/x/dex/migrations/v17_to_v18_test.go b/x/dex/migrations/v17_to_v18_test.go deleted file mode 100644 index cec6d67bb..000000000 --- a/x/dex/migrations/v17_to_v18_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package migrations_test - -import ( - "testing" - "time" - - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/sei-protocol/sei-chain/app" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate17to18(t *testing.T) { - tm := time.Now().UTC() - valPub := secp256k1.GenPrivKey().PubKey() - - testWrapper := app.NewTestWrapper(t, tm, valPub, false) - - testAddr := sdk.MustAccAddressFromBech32(keepertest.TestAccount) - - testWrapper.FundAcc(testAddr, sdk.NewCoins(sdk.NewCoin(sdk.MustGetBaseDenom(), sdk.NewInt(100000)))) - testWrapper.FundAcc(testAddr, sdk.NewCoins(sdk.NewCoin("ueth", sdk.NewInt(100)))) - - dexkeeper, ctx := testWrapper.App.DexKeeper, testWrapper.Ctx - bal := dexkeeper.BankKeeper.GetBalance(ctx, testAddr, sdk.MustGetBaseDenom()) - require.Equal(t, int64(100000), bal.Amount.Int64()) - // add contract rent - rentAmt := int64(10000) - err := dexkeeper.BankKeeper.SendCoins(ctx, testAddr, dexkeeper.AccountKeeper.GetModuleAddress(types.ModuleName), sdk.NewCoins(sdk.NewCoin(sdk.MustGetBaseDenom(), sdk.NewInt(rentAmt)))) - require.NoError(t, err) - - contract := &types.ContractInfoV2{ContractAddr: keepertest.TestContract, Creator: keepertest.TestAccount, RentBalance: uint64(rentAmt)} - err = dexkeeper.SetContract(ctx, contract) - require.NoError(t, err) - // add some balance to the module just bc - err = dexkeeper.BankKeeper.SendCoins(ctx, testAddr, dexkeeper.AccountKeeper.GetModuleAddress(types.ModuleName), sdk.NewCoins(sdk.NewCoin("ueth", sdk.NewInt(10)), sdk.NewCoin(sdk.MustGetBaseDenom(), sdk.NewInt(1000)))) - require.NoError(t, err) - - supplyUseiInitial := dexkeeper.BankKeeper.GetSupply(ctx, sdk.MustGetBaseDenom()) - - // do migration - err = migrations.V17ToV18(ctx, dexkeeper) - require.NoError(t, err) - - // user refunded rent now has 99000usei and 90ueth - bals := dexkeeper.BankKeeper.GetAllBalances(ctx, testAddr) - require.Equal(t, sdk.NewCoins(sdk.NewCoin("ueth", sdk.NewInt(90)), sdk.NewCoin(sdk.MustGetBaseDenom(), sdk.NewInt(99000))), bals) - // feecollector gets 1000usei - bals = dexkeeper.BankKeeper.GetAllBalances(ctx, dexkeeper.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName)) - require.Equal(t, sdk.NewCoins(sdk.NewCoin(sdk.MustGetBaseDenom(), sdk.NewInt(1000))), bals) - // ueth supply decreased due to burn - supply := dexkeeper.BankKeeper.GetSupply(ctx, "ueth") - require.Equal(t, sdk.NewInt(90), supply.Amount) - // usei supply unchanged - supplyUseiFinal := dexkeeper.BankKeeper.GetSupply(ctx, sdk.MustGetBaseDenom()) - require.Equal(t, supplyUseiInitial, supplyUseiFinal) - -} diff --git a/x/dex/migrations/v2_to_v3.go b/x/dex/migrations/v2_to_v3.go deleted file mode 100644 index de789df98..000000000 --- a/x/dex/migrations/v2_to_v3.go +++ /dev/null @@ -1,35 +0,0 @@ -package migrations - -import ( - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -/** - * No `dex` state exists in any public chain at the time this data type update happened. - * Any new chain (including local ones) should be based on a Sei version newer than this update - * and therefore doesn't need this migration - */ -func DataTypeUpdate(ctx sdk.Context, storeKey sdk.StoreKey, _ codec.BinaryCodec) error { - ClearStore(ctx, storeKey) - return nil -} - -/** - * CAUTION: this function clears up the entire `dex` module store, so it should only ever - * be used outside of a production setting. - */ -func ClearStore(ctx sdk.Context, storeKey sdk.StoreKey) { - for i := 0; i < 256; i++ { - clearStoreForByte(ctx, storeKey, byte(i)) - } -} - -func clearStoreForByte(ctx sdk.Context, storeKey sdk.StoreKey, b byte) { - store := ctx.KVStore(storeKey) - iterator := sdk.KVStorePrefixIterator(store, []byte{b}) - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - store.Delete(iterator.Key()) - } -} diff --git a/x/dex/migrations/v3_to_v4.go b/x/dex/migrations/v3_to_v4.go deleted file mode 100644 index b7b9217fc..000000000 --- a/x/dex/migrations/v3_to_v4.go +++ /dev/null @@ -1,21 +0,0 @@ -package migrations - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func PriceSnapshotUpdate(ctx sdk.Context, paramStore paramtypes.Subspace) error { - err := migratePriceSnapshotParam(ctx, paramStore) - return err -} - -func migratePriceSnapshotParam(ctx sdk.Context, paramStore paramtypes.Subspace) error { - defaultParams := types.Params{ - PriceSnapshotRetention: types.DefaultPriceSnapshotRetention, - SudoCallGasPrice: types.DefaultSudoCallGasPrice, - } - paramStore.SetParamSet(ctx, &defaultParams) - return nil -} diff --git a/x/dex/migrations/v3_to_v4_test.go b/x/dex/migrations/v3_to_v4_test.go deleted file mode 100644 index 18712ba89..000000000 --- a/x/dex/migrations/v3_to_v4_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package migrations_test - -import ( - "testing" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmdb "github.com/tendermint/tm-db" -) - -func TestMigrate3to4(t *testing.T) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) - - registry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(registry) - - paramsSubspace := typesparams.NewSubspace(cdc, - types.Amino, - storeKey, - memStoreKey, - "DexParams", - ) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - if !paramsSubspace.HasKeyTable() { - paramsSubspace = paramsSubspace.WithKeyTable(types.ParamKeyTable()) - } - migrations.PriceSnapshotUpdate(ctx, paramsSubspace) - - params := types.Params{} - paramsSubspace.GetParamSet(ctx, ¶ms) - require.Equal(t, uint64(types.DefaultPriceSnapshotRetention), params.PriceSnapshotRetention) -} diff --git a/x/dex/migrations/v4_to_v5.go b/x/dex/migrations/v4_to_v5.go deleted file mode 100644 index 8e40d7da3..000000000 --- a/x/dex/migrations/v4_to_v5.go +++ /dev/null @@ -1,28 +0,0 @@ -package migrations - -import ( - "encoding/binary" - - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" -) - -/** - * No `dex` state exists in any public chain at the time this data type update happened. - * Any new chain (including local ones) should be based on a Sei version newer than this update - * and therefore doesn't need this migration - */ -func V4ToV5(ctx sdk.Context, storeKey sdk.StoreKey, paramStore paramtypes.Subspace) error { - ClearStore(ctx, storeKey) - if err := migratePriceSnapshotParam(ctx, paramStore); err != nil { - return err - } - - // initialize epoch to 0 - store := ctx.KVStore(storeKey) - bz := make([]byte, 8) - binary.BigEndian.PutUint64(bz, 0) - store.Set([]byte(keeper.EpochKey), bz) - return nil -} diff --git a/x/dex/migrations/v4_to_v5_test.go b/x/dex/migrations/v4_to_v5_test.go deleted file mode 100644 index 78eaa9c0e..000000000 --- a/x/dex/migrations/v4_to_v5_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package migrations_test - -import ( - "encoding/binary" - "testing" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmdb "github.com/tendermint/tm-db" -) - -func TestMigrate4to5(t *testing.T) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) - - registry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(registry) - - paramsSubspace := typesparams.NewSubspace(cdc, - types.Amino, - storeKey, - memStoreKey, - "DexParams", - ) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - if !paramsSubspace.HasKeyTable() { - paramsSubspace = paramsSubspace.WithKeyTable(types.ParamKeyTable()) - } - store := ctx.KVStore(storeKey) - store.Set([]byte("garbage key"), []byte("garbage value")) - require.True(t, store.Has([]byte("garbage key"))) - err := migrations.V4ToV5(ctx, storeKey, paramsSubspace) - require.Nil(t, err) - require.False(t, store.Has([]byte("garbage key"))) - - params := types.Params{} - paramsSubspace.GetParamSet(ctx, ¶ms) - require.Equal(t, uint64(types.DefaultPriceSnapshotRetention), params.PriceSnapshotRetention) - - epochBytes := store.Get([]byte(keeper.EpochKey)) - epoch := binary.BigEndian.Uint64(epochBytes) - require.Equal(t, uint64(0), epoch) -} diff --git a/x/dex/migrations/v5_to_v6.go b/x/dex/migrations/v5_to_v6.go deleted file mode 100644 index 870bc82e7..000000000 --- a/x/dex/migrations/v5_to_v6.go +++ /dev/null @@ -1,57 +0,0 @@ -package migrations - -import ( - "errors" - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// This migration updates contract info to match the new data format -func V5ToV6(ctx sdk.Context, storeKey sdk.StoreKey, _ codec.BinaryCodec) error { - for i := 0; i < 256; i++ { - if err := updateContractInfoForBytePrefix(ctx, storeKey, byte(i)); err != nil { - return err - } - } - return nil -} - -// assuming no dependency exists at the time of this migration -func updateContractInfoForBytePrefix(ctx sdk.Context, storeKey sdk.StoreKey, b byte) error { - store := prefix.NewStore( - ctx.KVStore(storeKey), - []byte(keeper.ContractPrefixKey), - ) - iterator := sdk.KVStorePrefixIterator(store, []byte{b}) - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - oldContractInfoBytes := iterator.Value() - oldContractInfo := types.LegacyContractInfo{} - if err := oldContractInfo.Unmarshal(oldContractInfoBytes); err != nil { - ctx.Logger().Error(fmt.Sprintf("Failed to unmarshal contract info for %s", iterator.Key())) - return err - } - if oldContractInfo.DependentContractAddrs != nil { - ctx.Logger().Error(fmt.Sprintf("Contract info of %s has dependencies!", iterator.Key())) - return errors.New("contract has unexpected dependencies") - } - newContractInfo := types.ContractInfo{ - CodeId: oldContractInfo.CodeId, - ContractAddr: oldContractInfo.ContractAddr, - NeedHook: oldContractInfo.NeedHook, - NeedOrderMatching: oldContractInfo.NeedOrderMatching, - } - bz, err := newContractInfo.Marshal() - if err != nil { - ctx.Logger().Error(fmt.Sprintf("Failed to marshal contract info for %s", iterator.Key())) - return err - } - store.Set([]byte(newContractInfo.ContractAddr), bz) - } - return nil -} diff --git a/x/dex/migrations/v5_to_v6_test.go b/x/dex/migrations/v5_to_v6_test.go deleted file mode 100644 index 3035ec0c1..000000000 --- a/x/dex/migrations/v5_to_v6_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package migrations_test - -import ( - "testing" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmdb "github.com/tendermint/tm-db" -) - -func TestMigrate5to6(t *testing.T) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) - - registry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(registry) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - store := prefix.NewStore( - ctx.KVStore(storeKey), - []byte(keeper.ContractPrefixKey), - ) - - oldContractA := types.LegacyContractInfo{ - CodeId: 1, - ContractAddr: "abc", - NeedHook: true, - NeedOrderMatching: false, - } - oldContractB := types.LegacyContractInfo{ - CodeId: 2, - ContractAddr: "def", - NeedHook: false, - NeedOrderMatching: true, - } - bzA, _ := oldContractA.Marshal() - bzB, _ := oldContractB.Marshal() - store.Set([]byte("abc"), bzA) - store.Set([]byte("def"), bzB) - - err := migrations.V5ToV6(ctx, storeKey, cdc) - require.Nil(t, err) - - newBzA := store.Get([]byte("abc")) - newBzB := store.Get([]byte("def")) - newContractA := types.ContractInfo{} - newContractB := types.ContractInfo{} - err = newContractA.Unmarshal(newBzA) - require.Nil(t, err) - err = newContractB.Unmarshal(newBzB) - require.Nil(t, err) - require.Equal(t, types.ContractInfo{ - CodeId: 1, - ContractAddr: "abc", - NeedHook: true, - NeedOrderMatching: false, - }, newContractA) - require.Equal(t, types.ContractInfo{ - CodeId: 2, - ContractAddr: "def", - NeedHook: false, - NeedOrderMatching: true, - }, newContractB) -} diff --git a/x/dex/migrations/v6_to_v7.go b/x/dex/migrations/v6_to_v7.go deleted file mode 100644 index c7df17849..000000000 --- a/x/dex/migrations/v6_to_v7.go +++ /dev/null @@ -1,84 +0,0 @@ -package migrations - -import ( - "encoding/binary" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V6ToV7(ctx sdk.Context, storeKey sdk.StoreKey) error { - backfillOrderIDPerContract(ctx, storeKey) - reformatPriceState(ctx, storeKey) - return nil -} - -// this function backfills contract order ID according to the old global order ID -func backfillOrderIDPerContract(ctx sdk.Context, storeKey sdk.StoreKey) { - oldStore := prefix.NewStore( - ctx.KVStore(storeKey), - []byte{}, - ) - oldKey := types.KeyPrefix(types.NextOrderIDKey) - oldIDBytes := oldStore.Get(oldKey) - if oldIDBytes == nil { - // nothing to backfill - return - } - oldID := binary.BigEndian.Uint64(oldIDBytes) - - contractStore := prefix.NewStore(ctx.KVStore(storeKey), []byte(keeper.ContractPrefixKey)) - iterator := sdk.KVStorePrefixIterator(contractStore, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - contract := types.ContractInfo{} - if err := contract.Unmarshal(iterator.Value()); err == nil { - if contract.NeedOrderMatching { - newIDStore := prefix.NewStore(ctx.KVStore(storeKey), types.NextOrderIDPrefix(contract.ContractAddr)) - byteKey := types.KeyPrefix(types.NextOrderIDKey) - bz := make([]byte, 8) - binary.BigEndian.PutUint64(bz, oldID) - newIDStore.Set(byteKey, bz) - } - } - } -} - -func reformatPriceState(ctx sdk.Context, storeKey sdk.StoreKey) { - contractStore := prefix.NewStore(ctx.KVStore(storeKey), []byte(keeper.ContractPrefixKey)) - iterator := sdk.KVStorePrefixIterator(contractStore, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - contract := types.ContractInfo{} - if err := contract.Unmarshal(iterator.Value()); err == nil { - pairStore := prefix.NewStore(ctx.KVStore(storeKey), types.RegisteredPairPrefix(contract.ContractAddr)) - pairIterator := sdk.KVStorePrefixIterator(pairStore, []byte{}) - for ; pairIterator.Valid(); pairIterator.Next() { - pair := types.Pair{} - if err := pair.Unmarshal(pairIterator.Value()); err == nil { - oldPriceStore := prefix.NewStore(ctx.KVStore(storeKey), append( - append( - append(types.KeyPrefix(types.PriceKey), types.KeyPrefix(contract.ContractAddr)...), - types.KeyPrefix(pair.PriceDenom)..., - ), - types.KeyPrefix(pair.AssetDenom)..., - )) - newPriceStore := prefix.NewStore(ctx.KVStore(storeKey), types.PricePrefix(contract.ContractAddr, pair.PriceDenom, pair.AssetDenom)) - oldPriceIterator := sdk.KVStorePrefixIterator(oldPriceStore, []byte{}) - for ; oldPriceIterator.Valid(); oldPriceIterator.Next() { - newPriceStore.Set(oldPriceIterator.Key(), oldPriceIterator.Value()) - } - oldPriceIterator.Close() - } - } - - pairIterator.Close() - } - } -} diff --git a/x/dex/migrations/v6_to_v7_test.go b/x/dex/migrations/v6_to_v7_test.go deleted file mode 100644 index e00f9adbc..000000000 --- a/x/dex/migrations/v6_to_v7_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package migrations_test - -import ( - "encoding/binary" - "testing" - - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmdb "github.com/tendermint/tm-db" -) - -func TestMigrate6to7(t *testing.T) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) - - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - - // write old order ID - store := prefix.NewStore(ctx.KVStore(storeKey), []byte{}) - oldID := make([]byte, 8) - binary.BigEndian.PutUint64(oldID, 10) - store.Set(types.KeyPrefix(types.NextOrderIDKey), oldID) - - // write old price state - store = prefix.NewStore(ctx.KVStore(storeKey), append( - append( - append(types.KeyPrefix(types.PriceKey), types.KeyPrefix(keepertest.TestContract)...), - types.KeyPrefix(keepertest.TestPriceDenom)..., - ), - types.KeyPrefix(keepertest.TestAssetDenom)...), - ) - - price := types.Price{ - SnapshotTimestampInSeconds: 5, - Price: sdk.MustNewDecFromStr("123.4"), - Pair: &keepertest.TestPair, - } - priceBytes, _ := price.Marshal() - store.Set(keeper.GetKeyForTs(price.SnapshotTimestampInSeconds), priceBytes) - - // register contract / pair - store = prefix.NewStore( - ctx.KVStore(storeKey), - []byte(keeper.ContractPrefixKey), - ) - contract := types.ContractInfo{ - CodeId: 1, - ContractAddr: keepertest.TestContract, - NeedOrderMatching: true, - } - contractBytes, _ := contract.Marshal() - store.Set([]byte(contract.ContractAddr), contractBytes) - - store = prefix.NewStore(ctx.KVStore(storeKey), types.RegisteredPairPrefix(keepertest.TestContract)) - keyBytes := make([]byte, 8) - binary.BigEndian.PutUint64(keyBytes, 0) - pairBytes, _ := keepertest.TestPair.Marshal() - store.Set(keyBytes, pairBytes) - - err := migrations.V6ToV7(ctx, storeKey) - require.Nil(t, err) - - store = prefix.NewStore(ctx.KVStore(storeKey), types.NextOrderIDPrefix(keepertest.TestContract)) - byteKey := types.KeyPrefix(types.NextOrderIDKey) - bz := store.Get(byteKey) - require.Equal(t, uint64(10), binary.BigEndian.Uint64(bz)) - - store = prefix.NewStore(ctx.KVStore(storeKey), types.PricePrefix(keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom)) - key := keeper.GetKeyForTs(5) - priceRes := types.Price{} - b := store.Get(key) - _ = priceRes.Unmarshal(b) - require.Equal(t, price, priceRes) -} diff --git a/x/dex/migrations/v7_to_v8.go b/x/dex/migrations/v7_to_v8.go deleted file mode 100644 index 26914ff4d..000000000 --- a/x/dex/migrations/v7_to_v8.go +++ /dev/null @@ -1,101 +0,0 @@ -package migrations - -import ( - "encoding/binary" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V7ToV8(ctx sdk.Context, storeKey sdk.StoreKey) error { - return flattenSettlements(ctx, storeKey) -} - -func flattenSettlements(ctx sdk.Context, storeKey sdk.StoreKey) error { - contractStore := prefix.NewStore(ctx.KVStore(storeKey), []byte(keeper.ContractPrefixKey)) - iterator := sdk.KVStorePrefixIterator(contractStore, []byte{}) - - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - contract := types.ContractInfo{} - if err := contract.Unmarshal(iterator.Value()); err != nil { - return err - } - pairStore := prefix.NewStore(ctx.KVStore(storeKey), types.RegisteredPairPrefix(contract.ContractAddr)) - pairIterator := sdk.KVStorePrefixIterator(pairStore, []byte{}) - for ; pairIterator.Valid(); pairIterator.Next() { - pair := types.Pair{} - if err := pair.Unmarshal(pairIterator.Value()); err != nil { - pairIterator.Close() - return err - } - settlementStore := prefix.NewStore( - ctx.KVStore(storeKey), - SettlementEntryPrefix(contract.ContractAddr, pair.PriceDenom, pair.AssetDenom), - ) - settlementIterator := sdk.KVStorePrefixIterator(settlementStore, []byte{}) - - oldKeys := [][]byte{} - newKeys := [][]byte{} - newVals := [][]byte{} - for ; settlementIterator.Valid(); settlementIterator.Next() { - var val types.Settlements - if err := val.Unmarshal(settlementIterator.Value()); err != nil { - pairIterator.Close() - settlementIterator.Close() - return err - } - for i, settlementEntry := range val.Entries { - settlementBytes, err := settlementEntry.Marshal() - if err != nil { - pairIterator.Close() - settlementIterator.Close() - return err - } - newKeys = append(newKeys, types.GetSettlementKey(settlementEntry.OrderId, settlementEntry.Account, uint64(i))) - newVals = append(newVals, settlementBytes) - } - - if len(val.Entries) > 0 { - settlementIDStore := prefix.NewStore( - ctx.KVStore(storeKey), - NextSettlementIDPrefix(contract.ContractAddr, pair.PriceDenom, pair.AssetDenom), - ) - key := make([]byte, 8) - binary.BigEndian.PutUint64(key, val.Entries[0].OrderId) - value := make([]byte, 8) - binary.BigEndian.PutUint64(value, uint64(len(val.Entries))) - settlementIDStore.Set(key, value) - } - oldKeys = append(oldKeys, settlementIterator.Key()) - } - - settlementIterator.Close() - - for _, oldKey := range oldKeys { - settlementStore.Delete(oldKey) - } - for i, newKey := range newKeys { - settlementStore.Set(newKey, newVals[i]) - } - } - pairIterator.Close() - } - return nil -} - -func SettlementEntryPrefix(contractAddr string, priceDenom string, assetDenom string) []byte { - return append( - append(types.KeyPrefix("SettlementEntry-"), types.AddressKeyPrefix(contractAddr)...), - types.PairPrefix(priceDenom, assetDenom)..., - ) -} - -func NextSettlementIDPrefix(contractAddr string, priceDenom string, assetDenom string) []byte { - return append( - append(types.KeyPrefix("NextSettlementID-"), types.AddressKeyPrefix(contractAddr)...), - types.PairPrefix(priceDenom, assetDenom)..., - ) -} diff --git a/x/dex/migrations/v7_to_v8_test.go b/x/dex/migrations/v7_to_v8_test.go deleted file mode 100644 index 5960ff7e7..000000000 --- a/x/dex/migrations/v7_to_v8_test.go +++ /dev/null @@ -1,98 +0,0 @@ -package migrations_test - -import ( - "encoding/binary" - "testing" - - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmdb "github.com/tendermint/tm-db" -) - -func TestMigrate7to8(t *testing.T) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) - - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - - // write old settlements - store := prefix.NewStore( - ctx.KVStore(storeKey), - migrations.SettlementEntryPrefix(keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom), - ) - settlements := types.Settlements{ - Entries: []*types.SettlementEntry{ - { - Account: keepertest.TestAccount, - OrderId: 1, - Quantity: sdk.MustNewDecFromStr("0.3"), - }, - { - Account: keepertest.TestAccount, - OrderId: 1, - Quantity: sdk.MustNewDecFromStr("0.7"), - }, - }, - } - bz, _ := settlements.Marshal() - store.Set(types.GetSettlementOrderIDPrefix(1, keepertest.TestAccount), bz) - - // register contract / pair - store = prefix.NewStore( - ctx.KVStore(storeKey), - []byte(keeper.ContractPrefixKey), - ) - contract := types.ContractInfo{ - CodeId: 1, - ContractAddr: keepertest.TestContract, - NeedOrderMatching: true, - } - contractBytes, _ := contract.Marshal() - store.Set([]byte(contract.ContractAddr), contractBytes) - - store = prefix.NewStore(ctx.KVStore(storeKey), types.RegisteredPairPrefix(keepertest.TestContract)) - keyBytes := make([]byte, 8) - binary.BigEndian.PutUint64(keyBytes, 0) - pairBytes, _ := keepertest.TestPair.Marshal() - store.Set(keyBytes, pairBytes) - - err := migrations.V7ToV8(ctx, storeKey) - require.Nil(t, err) - - store = prefix.NewStore( - ctx.KVStore(storeKey), - migrations.SettlementEntryPrefix(keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom), - ) - settlementEntry1Key := types.GetSettlementKey(1, keepertest.TestAccount, 0) - settlementEntry1 := types.SettlementEntry{} - settlementEntry1Bytes := store.Get(settlementEntry1Key) - _ = settlementEntry1.Unmarshal(settlementEntry1Bytes) - require.Equal(t, sdk.MustNewDecFromStr("0.3"), settlementEntry1.Quantity) - settlementEntry2Key := types.GetSettlementKey(1, keepertest.TestAccount, 1) - settlementEntry2 := types.SettlementEntry{} - settlementEntry2Bytes := store.Get(settlementEntry2Key) - _ = settlementEntry2.Unmarshal(settlementEntry2Bytes) - require.Equal(t, sdk.MustNewDecFromStr("0.7"), settlementEntry2.Quantity) - - require.False(t, store.Has(types.GetSettlementOrderIDPrefix(1, keepertest.TestAccount))) - - store = prefix.NewStore(ctx.KVStore(storeKey), migrations.NextSettlementIDPrefix(keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom)) - key := make([]byte, 8) - binary.BigEndian.PutUint64(key, uint64(1)) - require.Equal(t, uint64(2), binary.BigEndian.Uint64(store.Get(key))) -} diff --git a/x/dex/migrations/v8_to_v9.go b/x/dex/migrations/v8_to_v9.go deleted file mode 100644 index cb0e6095d..000000000 --- a/x/dex/migrations/v8_to_v9.go +++ /dev/null @@ -1,38 +0,0 @@ -package migrations - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -func V8ToV9(ctx sdk.Context, dexkeeper keeper.Keeper) error { - dexkeeper.CreateModuleAccount(ctx) - - contractStore := prefix.NewStore(ctx.KVStore(dexkeeper.GetStoreKey()), []byte(keeper.ContractPrefixKey)) - iterator := sdk.KVStorePrefixIterator(contractStore, []byte{}) - - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - contract := types.ContractInfo{} - if err := contract.Unmarshal(iterator.Value()); err != nil { - return err - } - contractV2 := types.ContractInfoV2{ - CodeId: contract.CodeId, - ContractAddr: contract.ContractAddr, - NeedHook: contract.NeedHook, - NeedOrderMatching: contract.NeedOrderMatching, - Dependencies: contract.Dependencies, - NumIncomingDependencies: contract.NumIncomingDependencies, - } - bz, err := contractV2.Marshal() - if err != nil { - return err - } - contractStore.Set(iterator.Key(), bz) - } - - return nil -} diff --git a/x/dex/migrations/v8_to_v9_test.go b/x/dex/migrations/v8_to_v9_test.go deleted file mode 100644 index c1b87b3d6..000000000 --- a/x/dex/migrations/v8_to_v9_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package migrations_test - -import ( - "testing" - - "github.com/cosmos/cosmos-sdk/store/prefix" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate8to9(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - // write old contract - store := prefix.NewStore( - ctx.KVStore(dexkeeper.GetStoreKey()), - []byte(keeper.ContractPrefixKey), - ) - contract := types.ContractInfo{ - CodeId: 1, - ContractAddr: keepertest.TestContract, - NeedOrderMatching: true, - } - contractBytes, _ := contract.Marshal() - store.Set(types.ContractKey(contract.ContractAddr), contractBytes) - - err := migrations.V8ToV9(ctx, *dexkeeper) - require.NoError(t, err) - - contractV2, err := dexkeeper.GetContract(ctx, keepertest.TestContract) - require.NoError(t, err) - require.Equal(t, types.ContractInfoV2{ - CodeId: 1, - ContractAddr: keepertest.TestContract, - NeedOrderMatching: true, - }, contractV2) - - moduleAccount := dexkeeper.AccountKeeper.GetModuleAccount(ctx, types.ModuleName) - require.NotNil(t, moduleAccount) -} diff --git a/x/dex/migrations/v9_to_v10.go b/x/dex/migrations/v9_to_v10.go deleted file mode 100644 index c8484d9b1..000000000 --- a/x/dex/migrations/v9_to_v10.go +++ /dev/null @@ -1,91 +0,0 @@ -package migrations - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -const PriceTickSizeKey = "ticks" -const QuantityTickSizeKey = "quantityticks" -const RegisteredPairCount = "rpcnt" - -// This migration deprecates the tick size store keys and registered pair count store keys. -// It also refactors the registered pair store to use pair denoms for key construction -// instead of index based key construction. -func V9ToV10(ctx sdk.Context, dexkeeper keeper.Keeper) error { - dexkeeper.CreateModuleAccount(ctx) - store := ctx.KVStore(dexkeeper.GetStoreKey()) - - rpIterator := sdk.KVStorePrefixIterator(store, []byte(types.RegisteredPairKey)) - - rpcntByte := []byte(RegisteredPairCount) - defer rpIterator.Close() - for ; rpIterator.Valid(); rpIterator.Next() { - // need to skip anything that has rpcnt in the key prefix - if string(rpIterator.Key()[:len(rpcntByte)]) == RegisteredPairCount { - continue - } - var registeredPair types.Pair - b := rpIterator.Value() - err := registeredPair.Unmarshal(b) - if err != nil { - return err - } - // this key is the contractAddress + index - rpKey := rpIterator.Key() - // remove first 2 bytes for prefix and last 8 bytes since that is the index - rpContractKey := rpKey[2 : len(rpKey)-8] - // get pair prefix used for indexing - pairPrefix := types.PairPrefix(registeredPair.PriceDenom, registeredPair.AssetDenom) - - // set the price and quantity ticks from the appropriate store - priceTickStore := prefix.NewStore(store, append([]byte(PriceTickSizeKey), rpContractKey...)) - priceTickSize := sdk.Dec{} - b = priceTickStore.Get(pairPrefix) - err = priceTickSize.Unmarshal(b) - if err != nil { - return err - } - registeredPair.PriceTicksize = &priceTickSize - - quantityTickStore := prefix.NewStore(store, append([]byte(QuantityTickSizeKey), rpContractKey...)) - quantityTickSize := sdk.Dec{} - b = quantityTickStore.Get(pairPrefix) - err = quantityTickSize.Unmarshal(b) - if err != nil { - return err - } - registeredPair.QuantityTicksize = &quantityTickSize - - // delete the old store value - rpStore := prefix.NewStore(store, append([]byte(types.RegisteredPairKey), rpContractKey...)) - rpStore.Delete(rpKey) - // updated registered pair, now we need to set it to the correct store value - writeBytes := dexkeeper.Cdc.MustMarshal(®isteredPair) - rpStore.Set(pairPrefix, writeBytes) - } - - // delete rpcnt - rpcIterator := sdk.KVStorePrefixIterator(store, []byte(RegisteredPairCount)) - defer rpcIterator.Close() - for ; rpcIterator.Valid(); rpcIterator.Next() { - store.Delete(rpcIterator.Key()) - } - - // delete price Ticks - priceTickIterator := sdk.KVStorePrefixIterator(store, []byte(PriceTickSizeKey)) - defer priceTickIterator.Close() - for ; priceTickIterator.Valid(); priceTickIterator.Next() { - store.Delete(priceTickIterator.Key()) - } - - // delete quantityTicks - quantityTickIterator := sdk.KVStorePrefixIterator(store, []byte(QuantityTickSizeKey)) - defer quantityTickIterator.Close() - for ; quantityTickIterator.Valid(); quantityTickIterator.Next() { - store.Delete(quantityTickIterator.Key()) - } - return nil -} diff --git a/x/dex/migrations/v9_to_v10_test.go b/x/dex/migrations/v9_to_v10_test.go deleted file mode 100644 index 27f6406a8..000000000 --- a/x/dex/migrations/v9_to_v10_test.go +++ /dev/null @@ -1,94 +0,0 @@ -package migrations_test - -import ( - "encoding/binary" - "testing" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkaddress "github.com/cosmos/cosmos-sdk/types/address" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMigrate9to10(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - // write old contract - dexStore := ctx.KVStore(dexkeeper.GetStoreKey()) - rpStore := prefix.NewStore( - dexStore, - []byte(types.RegisteredPairKey), - ) - priceTickSize := sdk.MustNewDecFromStr("0.0001") - quantityTickSize := sdk.MustNewDecFromStr("0.0001") - pair := types.Pair{ - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - PriceTicksize: &priceTickSize, - QuantityTicksize: &quantityTickSize, - } - pairPrefix := types.PairPrefix(keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom) - - pairBytes := dexkeeper.Cdc.MustMarshal(&pair) - countBytes := make([]byte, 8) - binary.BigEndian.PutUint64(countBytes, 1) - // simulate legacy store where registered pairs are indexed by auto increment count - address, _ := sdk.AccAddressFromBech32(keepertest.TestContract) - address = sdkaddress.MustLengthPrefix(address) - rpStore.Set(append(address, countBytes...), pairBytes) - - bytes := rpStore.Get(append(address, countBytes...)) - require.Equal(t, pairBytes, bytes) - - // set count, ticksize, and quantity size - newCountBytes := make([]byte, 8) - binary.BigEndian.PutUint64(newCountBytes, 2) - dexStore.Set( - append([]byte(migrations.RegisteredPairCount), address...), - newCountBytes, - ) - - tickBytes, _ := sdk.MustNewDecFromStr("0.0002").Marshal() - dexStore.Set( - append(append([]byte(migrations.PriceTickSizeKey), address...), pairPrefix...), - tickBytes, - ) - - dexStore.Set( - append(append([]byte(migrations.QuantityTickSizeKey), address...), pairPrefix...), - tickBytes, - ) - - err := migrations.V9ToV10(ctx, *dexkeeper) - require.NoError(t, err) - - pair, found := dexkeeper.GetRegisteredPair(ctx, keepertest.TestContract, keepertest.TestPair.PriceDenom, keepertest.TestPair.AssetDenom) - require.True(t, found) - newTickSize := sdk.MustNewDecFromStr("0.0002") - require.Equal(t, types.Pair{ - PriceDenom: keepertest.TestPair.PriceDenom, - AssetDenom: keepertest.TestPair.AssetDenom, - PriceTicksize: &newTickSize, - QuantityTicksize: &newTickSize, - }, pair) - - // verify old/deprecated keeper store data is removed - require.False( - t, - dexStore.Has(append(address, countBytes...)), - ) - require.False( - t, - dexStore.Has(append([]byte(migrations.RegisteredPairCount), address...)), - ) - require.False( - t, - dexStore.Has(append(append([]byte(migrations.PriceTickSizeKey), address...), pairPrefix...)), - ) - require.False( - t, - dexStore.Has(append(append([]byte(migrations.QuantityTickSizeKey), address...), pairPrefix...)), - ) -} diff --git a/x/dex/module.go b/x/dex/module.go deleted file mode 100644 index 966699406..000000000 --- a/x/dex/module.go +++ /dev/null @@ -1,362 +0,0 @@ -package dex - -import ( - "context" - "encoding/json" - "fmt" - "sync" - "time" - - "github.com/CosmWasm/wasmd/x/wasm" - "github.com/cosmos/cosmos-sdk/store/prefix" - "github.com/cosmos/cosmos-sdk/telemetry" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/utils/tracing" - "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/utils/datastructures" - "github.com/sei-protocol/sei-chain/x/dex/client/cli/query" - "github.com/sei-protocol/sei-chain/x/dex/client/cli/tx" - "github.com/sei-protocol/sei-chain/x/dex/contract" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - dexkeeperabci "github.com/sei-protocol/sei-chain/x/dex/keeper/abci" - "github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver" - dexkeeperquery "github.com/sei-protocol/sei-chain/x/dex/keeper/query" - "github.com/sei-protocol/sei-chain/x/dex/migrations" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - "github.com/sei-protocol/sei-chain/x/store" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface for the capability module. -type AppModuleBasic struct { - cdc codec.BinaryCodec -} - -func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the capability module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -// RegisterInterfaces registers the module's interface types -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) -} - -// DefaultGenesis returns the capability module's default genesis state. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) -} - -// ValidateGenesis performs genesis state validation for the capability module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { - var genState types.GenesisState - if err := cdc.UnmarshalJSON(bz, &genState); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - return genState.Validate() -} - -// RegisterRESTRoutes registers the capability module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) //nolint:errcheck // this is inside a module, and the method doesn't return error. Leave it alone. -} - -// GetTxCmd returns the capability module's root tx command. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return tx.GetTxCmd() -} - -// GetQueryCmd returns the capability module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return query.GetQueryCmd() -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface for the capability module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper - wasmKeeper wasm.Keeper - - abciWrapper dexkeeperabci.KeeperWrapper - - tracingInfo *tracing.Info -} - -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - accountKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, - wasmKeeper wasm.Keeper, - tracingInfo *tracing.Info, -) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - wasmKeeper: wasmKeeper, - abciWrapper: dexkeeperabci.KeeperWrapper{Keeper: &keeper}, - tracingInfo: tracingInfo, - } -} - -// Name returns the capability module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - -// Route returns the capability module's message routing key. -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) -} - -// QuerierRoute returns the capability module's query routing key. -func (AppModule) QuerierRoute() string { return types.QuerierRoute } - -// LegacyQuerierHandler returns the capability module's Querier. -func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { - return nil -} - -// RegisterServices registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), msgserver.NewMsgServerImpl(am.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), dexkeeperquery.KeeperWrapper{Keeper: &am.keeper}) - - _ = cfg.RegisterMigration(types.ModuleName, 1, func(ctx sdk.Context) error { return nil }) - _ = cfg.RegisterMigration(types.ModuleName, 2, func(ctx sdk.Context) error { - return migrations.DataTypeUpdate(ctx, am.keeper.GetStoreKey(), am.keeper.Cdc) - }) - _ = cfg.RegisterMigration(types.ModuleName, 3, func(ctx sdk.Context) error { - return migrations.PriceSnapshotUpdate(ctx, am.keeper.Paramstore) - }) - _ = cfg.RegisterMigration(types.ModuleName, 4, func(ctx sdk.Context) error { - return migrations.V4ToV5(ctx, am.keeper.GetStoreKey(), am.keeper.Paramstore) - }) - _ = cfg.RegisterMigration(types.ModuleName, 5, func(ctx sdk.Context) error { - return migrations.V5ToV6(ctx, am.keeper.GetStoreKey(), am.keeper.Cdc) - }) - _ = cfg.RegisterMigration(types.ModuleName, 6, func(ctx sdk.Context) error { - return migrations.V6ToV7(ctx, am.keeper.GetStoreKey()) - }) - _ = cfg.RegisterMigration(types.ModuleName, 7, func(ctx sdk.Context) error { - return migrations.V7ToV8(ctx, am.keeper.GetStoreKey()) - }) - _ = cfg.RegisterMigration(types.ModuleName, 8, func(ctx sdk.Context) error { - return migrations.V8ToV9(ctx, am.keeper) - }) - _ = cfg.RegisterMigration(types.ModuleName, 9, func(ctx sdk.Context) error { - return migrations.V9ToV10(ctx, am.keeper) - }) - _ = cfg.RegisterMigration(types.ModuleName, 10, func(ctx sdk.Context) error { - return migrations.V10ToV11(ctx, am.keeper) - }) - _ = cfg.RegisterMigration(types.ModuleName, 11, func(ctx sdk.Context) error { - return migrations.V11ToV12(ctx, am.keeper) - }) - _ = cfg.RegisterMigration(types.ModuleName, 12, func(ctx sdk.Context) error { - return migrations.V12ToV13(ctx, am.keeper) - }) - _ = cfg.RegisterMigration(types.ModuleName, 13, func(ctx sdk.Context) error { - return migrations.V13ToV14(ctx, am.keeper) - }) - _ = cfg.RegisterMigration(types.ModuleName, 14, func(ctx sdk.Context) error { - return migrations.V14ToV15(ctx, am.keeper) - }) - _ = cfg.RegisterMigration(types.ModuleName, 15, func(ctx sdk.Context) error { - return migrations.V15ToV16(ctx, am.keeper) - }) - _ = cfg.RegisterMigration(types.ModuleName, 16, func(ctx sdk.Context) error { - return nil - }) - _ = cfg.RegisterMigration(types.ModuleName, 17, func(ctx sdk.Context) error { - return migrations.V17ToV18(ctx, am.keeper) - }) -} - -// RegisterInvariants registers the capability module's invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// InitGenesis performs the capability module's genesis initialization It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { - var genState types.GenesisState - // Initialize global index to index in genesis state - cdc.MustUnmarshalJSON(gs, &genState) - - InitGenesis(ctx, am.keeper, genState) - - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - genState := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(genState) -} - -// ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 18 } - -// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - defer func() { - _, span := am.tracingInfo.Start("DexBeginBlockRollback") - defer span.End() - }() - - dexutils.GetMemState(ctx.Context()).Clear(ctx) - isNewEpoch, currentEpoch := am.keeper.IsNewEpoch(ctx) - if isNewEpoch { - am.keeper.SetEpoch(ctx, currentEpoch) - } - cachedCtx, cachedStore := store.GetCachedContext(ctx) - priceRetention := am.keeper.GetParams(ctx).PriceSnapshotRetention - cutOffTime := uint64(ctx.BlockTime().Unix()) - priceRetention - wg := sync.WaitGroup{} - mutex := sync.Mutex{} - allContracts := am.keeper.GetAllProcessableContractInfo(ctx) - allPricesToDelete := make(map[string][]*types.PriceStore, len(allContracts)) - - // Parallelize the logic to find all prices to delete - for _, contract := range allContracts { - wg.Add(1) - go func(contract types.ContractInfoV2) { - priceKeysToDelete := am.getPriceToDelete(cachedCtx, contract, cutOffTime) - mutex.Lock() - allPricesToDelete[contract.ContractAddr] = priceKeysToDelete - mutex.Unlock() - wg.Done() - }(contract) - } - wg.Wait() - - // Execute the deletion in order - for _, contract := range allContracts { - if priceStores, found := allPricesToDelete[contract.ContractAddr]; found { - for _, priceStore := range priceStores { - for _, key := range priceStore.PriceKeys { - priceStore.Store.Delete(key) - } - } - } - } - // only write if all contracts have been processed - cachedStore.Write() -} - -func (am AppModule) getPriceToDelete( - ctx sdk.Context, - contract types.ContractInfoV2, - timestamp uint64, -) []*types.PriceStore { - var result []*types.PriceStore - if contract.NeedOrderMatching { - for _, pair := range am.keeper.GetAllRegisteredPairs(ctx, contract.ContractAddr) { - store := prefix.NewStore(ctx.KVStore(am.keeper.GetStoreKey()), types.PricePrefix(contract.ContractAddr, pair.PriceDenom, pair.AssetDenom)) - keysToDelete := am.keeper.GetPriceKeysToDelete(store, timestamp) - result = append(result, &types.PriceStore{ - Store: store, - PriceKeys: keysToDelete, - }) - } - } - return result -} - -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) (ret []abci.ValidatorUpdate) { - defer func() { - if err := recover(); err != nil { - telemetry.IncrCounter(1, "recovered_panics") - ctx.Logger().Error(fmt.Sprintf("panic in endblock recovered: %s", err)) - } - }() - _, span := am.tracingInfo.Start("DexEndBlock") - defer span.End() - defer dexutils.GetMemState(ctx.Context()).Clear(ctx) - - validContractsInfo := am.keeper.GetAllProcessableContractInfo(ctx) - // Each iteration is atomic. If an iteration finishes without any error, it will return, - // otherwise it will rollback any state change, filter out contracts that cause the error, - // and proceed to the next iteration. The loop is guaranteed to finish since - // `validContractAddresses` will always decrease in size every iteration. - iterCounter := len(validContractsInfo) - endBlockerStartTime := time.Now() - for len(validContractsInfo) > 0 { - newValidContractsInfo, newOutOfRentContractsInfo, failedContractToReasons, ctx, ok := contract.EndBlockerAtomic(ctx, &am.keeper, validContractsInfo, am.tracingInfo) - if ok { - break - } - telemetry.IncrCounter(float32(len(newOutOfRentContractsInfo)), am.Name(), "total_out_of_rent_contracts") - keptContractAddrs := datastructures.NewSyncSet(utils.Map(newValidContractsInfo, func(c types.ContractInfoV2) string { return c.ContractAddr })) - keptContractAddrs.AddAll(utils.Map(newOutOfRentContractsInfo, func(c types.ContractInfoV2) string { return c.ContractAddr })) - for failedContract, reason := range failedContractToReasons { - ctx.Logger().Info(fmt.Sprintf("Suspending invalid contract %s", failedContract)) - err := am.keeper.SuspendContract(ctx, failedContract, reason) - if err != nil { - ctx.Logger().Error(fmt.Sprintf("failed to suspend invalid contract %s: %s", failedContract, err)) - } - telemetry.IncrCounter(float32(1), am.Name(), "total_suspended_contracts") - } - validContractsInfo = am.keeper.GetAllProcessableContractInfo(ctx) // reload contract info to get updated dependencies due to unregister above - if len(failedContractToReasons) != 0 { - dexutils.GetMemState(ctx.Context()).ClearContractToDependencies(ctx) - } - // technically we don't really need this if `EndBlockerAtomic` guarantees that `validContractsInfo` size will - // always shrink if not `ok`, but just in case, we decided to have an explicit termination criteria here to - // prevent the chain from being stuck. - iterCounter-- - if iterCounter == 0 { - ctx.Logger().Error("All contracts failed in dex EndBlock. Doing nothing.") - break - } - } - telemetry.MeasureSince(endBlockerStartTime, am.Name(), "total_end_blocker_atomic") - - return []abci.ValidatorUpdate{} -} diff --git a/x/dex/module_simulation.go b/x/dex/module_simulation.go deleted file mode 100644 index c7b9f2942..000000000 --- a/x/dex/module_simulation.go +++ /dev/null @@ -1,91 +0,0 @@ -package dex - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/sei-protocol/sei-chain/testutil/sample" - dexsimulation "github.com/sei-protocol/sei-chain/x/dex/simulation" - "github.com/sei-protocol/sei-chain/x/dex/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = dexsimulation.FindAccount - _ = simappparams.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -//nolint:deadcode,unused,gosec // Assume this will be used later, and gosec is nolint because there are no hard-coded credentials here. -const ( - opWeightMsgLimitBuy = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgLimitBuy int = 100 - - opWeightMsgLimitSell = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgLimitSell int = 100 - - opWeightMsgMarketBuy = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgMarketBuy int = 100 - - opWeightMsgMarketSell = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgMarketSell int = 100 - - opWeightMsgCancelBuy = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgCancelBuy int = 100 - - opWeightMsgCancelSell = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgCancelSell int = 100 - - opWeightMsgCancelAll = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgCancelAll int = 100 - - // this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - dexGenesis := types.GenesisState{ - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&dexGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - -// RandomizedParams creates randomized param changes for the simulator -func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { - return []simtypes.ParamChange{} -} - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/dex/module_test.go b/x/dex/module_test.go deleted file mode 100644 index cea426c10..000000000 --- a/x/dex/module_test.go +++ /dev/null @@ -1,835 +0,0 @@ -package dex_test - -import ( - "context" - "io/ioutil" - "testing" - "time" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/utils/tracing" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - "github.com/sei-protocol/sei-chain/x/dex/contract" - "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" - minttypes "github.com/sei-protocol/sei-chain/x/mint/types" - "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/trace" -) - -const ( - GOOD_CONTRACT_INSTANTIATE = `{"whitelist": ["sei1h9yjz89tl0dl6zu65dpxcqnxfhq60wxx8s5kag"], - "use_whitelist":false,"admin":"sei1h9yjz89tl0dl6zu65dpxcqnxfhq60wxx8s5kag", - "limit_order_fee":{"decimal":"0.0001","negative":false}, - "market_order_fee":{"decimal":"0.0001","negative":false}, - "liquidation_order_fee":{"decimal":"0.0001","negative":false}, - "margin_ratio":{"decimal":"0.0625","negative":false}, - "max_leverage":{"decimal":"4","negative":false}, - "default_base":"USDC", - "native_token":"USDC","denoms": ["SEI","ATOM","USDC","SOL","ETH","OSMO","AVAX","BTC"], - "full_denom_mapping": [["usei","SEI","0.000001"],["uatom","ATOM","0.000001"],["uusdc","USDC","0.000001"]], - "funding_payment_lookback":3600,"spot_market_contract":"sei1h9yjz89tl0dl6zu65dpxcqnxfhq60wxx8s5kag", - "supported_collateral_denoms": ["USDC"], - "supported_multicollateral_denoms": ["ATOM"], - "oracle_denom_mapping": [["usei","SEI","1"],["uatom","ATOM","1"],["uusdc","USDC","1"],["ueth","ETH","1"]], - "multicollateral_whitelist": ["sei1h9yjz89tl0dl6zu65dpxcqnxfhq60wxx8s5kag"], - "multicollateral_whitelist_enable": true, - "funding_payment_pairs": [["USDC","ETH"]], - "default_margin_ratios":{ - "initial":"0.3", - "partial":"0.25", - "maintenance":"0.06" - }}` -) - -func TestEndBlockMarketOrder(t *testing.T) { - testApp := keepertest.TestApp() - dexkeeper := testApp.DexKeeper - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(dexkeeper.GetMemStoreKey()))) - pair := types.Pair{PriceDenom: "SEI", AssetDenom: "ATOM"} - - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(10000000)), sdk.NewCoin("uusdc", sdk.NewInt(10000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - dexAmounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(5000000)), sdk.NewCoin("uusdc", sdk.NewInt(10000000))) - bankkeeper.SendCoinsFromAccountToModule(ctx, testAccount, types.ModuleName, dexAmounts) - wasm, err := ioutil.ReadFile("./testdata/mars.wasm") - if err != nil { - panic(err) - } - wasmKeeper := testApp.WasmKeeper - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&wasmKeeper) - var perm *wasmtypes.AccessConfig - codeId, err := contractKeeper.Create(ctx, testAccount, wasm, perm) - if err != nil { - panic(err) - } - contractAddr, _, err := contractKeeper.Instantiate(ctx, codeId, testAccount, testAccount, []byte(GOOD_CONTRACT_INSTANTIATE), "test", - sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100000)))) - if err != nil { - panic(err) - } - err = dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: contractAddr.String(), NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000}) - if err != nil { - panic(err) - } - dexkeeper.AddRegisteredPair(ctx, contractAddr.String(), pair) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 1, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("1"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 2, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("2"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetDepositInfo(ctx, types.ContractAddress(contractAddr.String())).Add( - &types.DepositInfoEntry{ - Creator: testAccount.String(), - Denom: "uusdc", - Amount: sdk.MustNewDecFromStr("2000000"), - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - - ctx = ctx.WithBlockHeight(1) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - _, found := dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("1"), pair.PriceDenom, pair.AssetDenom) - // Long book should be populated - require.True(t, found) - - dexutils.GetMemState(ctx.Context()).Clear(ctx) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 3, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("1"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_MARKET, - PositionDirection: types.PositionDirection_SHORT, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - - ctx = ctx.WithBlockHeight(2) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - - // Long book should be removed since it's executed - // No state change should've been persisted for bad contract - _, found = dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("2"), pair.PriceDenom, pair.AssetDenom) - // Long book should be populated - require.False(t, found) - _, found = dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("1"), pair.PriceDenom, pair.AssetDenom) - require.True(t, found) - - matchResults, _ := dexkeeper.GetMatchResultState(ctx, contractAddr.String()) - require.Equal(t, 1, len(matchResults.Orders)) - require.Equal(t, 2, len(matchResults.Settlements)) - - dexutils.GetMemState(ctx.Context()).Clear(ctx) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 4, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("1000000"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_MARKET, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - - ctx = ctx.WithBlockHeight(3) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - - matchResults, _ = dexkeeper.GetMatchResultState(ctx, contractAddr.String()) - require.Equal(t, 1, len(matchResults.Orders)) - require.Equal(t, 0, len(matchResults.Settlements)) -} - -func TestEndBlockLimitOrder(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - dexkeeper := testApp.DexKeeper - pair := types.Pair{PriceDenom: "SEI", AssetDenom: "ATOM"} - - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(10000000)), sdk.NewCoin("uusdc", sdk.NewInt(10000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - dexAmounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(5000000)), sdk.NewCoin("uusdc", sdk.NewInt(10000000))) - bankkeeper.SendCoinsFromAccountToModule(ctx, testAccount, types.ModuleName, dexAmounts) - wasm, err := ioutil.ReadFile("./testdata/mars.wasm") - if err != nil { - panic(err) - } - wasmKeeper := testApp.WasmKeeper - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&wasmKeeper) - var perm *wasmtypes.AccessConfig - codeId, err := contractKeeper.Create(ctx, testAccount, wasm, perm) - if err != nil { - panic(err) - } - contractAddr, _, err := contractKeeper.Instantiate(ctx, codeId, testAccount, testAccount, []byte(GOOD_CONTRACT_INSTANTIATE), "test", - sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100000)))) - if err != nil { - panic(err) - } - - dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: contractAddr.String(), NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000}) - dexkeeper.AddRegisteredPair(ctx, contractAddr.String(), pair) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 1, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("1"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 2, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("2"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 3, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("3"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_SHORT, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetDepositInfo(ctx, types.ContractAddress(contractAddr.String())).Add( - &types.DepositInfoEntry{ - Creator: testAccount.String(), - Denom: "uusdc", - Amount: sdk.MustNewDecFromStr("2000000"), - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - - ctx = ctx.WithBlockHeight(1) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - _, found := dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("1"), pair.PriceDenom, pair.AssetDenom) - require.True(t, found) - _, found = dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("2"), pair.PriceDenom, pair.AssetDenom) - require.True(t, found) - _, found = dexkeeper.GetShortBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("3"), pair.PriceDenom, pair.AssetDenom) - require.True(t, found) - - dexutils.GetMemState(ctx.Context()).Clear(ctx) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 4, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("2"), - Quantity: sdk.MustNewDecFromStr("2"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_SHORT, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 5, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("3"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - - ctx = ctx.WithBlockHeight(2) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - - _, found = dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("2"), pair.PriceDenom, pair.AssetDenom) - require.False(t, found) - _, found = dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("1"), pair.PriceDenom, pair.AssetDenom) - require.True(t, found) - _, found = dexkeeper.GetShortBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("3"), pair.PriceDenom, pair.AssetDenom) - require.True(t, found) - _, found = dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("3"), pair.PriceDenom, pair.AssetDenom) - require.False(t, found) - - matchResults, _ := dexkeeper.GetMatchResultState(ctx, contractAddr.String()) - require.Equal(t, 2, len(matchResults.Orders)) - require.Equal(t, 4, len(matchResults.Settlements)) - - dexutils.GetMemState(ctx.Context()).Clear(ctx) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 6, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("1000000"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - - ctx = ctx.WithBlockHeight(3) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - - _, found = dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("1"), pair.PriceDenom, pair.AssetDenom) - require.True(t, found) - _, found = dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("1000000"), pair.PriceDenom, pair.AssetDenom) - require.False(t, found) - _, found = dexkeeper.GetShortBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("3"), pair.PriceDenom, pair.AssetDenom) - require.False(t, found) - - matchResults, _ = dexkeeper.GetMatchResultState(ctx, contractAddr.String()) - require.Equal(t, 1, len(matchResults.Orders)) - require.Equal(t, 2, len(matchResults.Settlements)) -} - -func TestEndBlockRollback(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - dexkeeper := testApp.DexKeeper - pair := TEST_PAIR() - // register contract and pair - dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: keepertest.TestContract, NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000}) - dexkeeper.AddRegisteredPair(ctx, keepertest.TestContract, pair) - // place one order to a nonexistent contract - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(keepertest.TestContract), pair).Add( - &types.Order{ - Id: 1, - Account: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - Price: sdk.MustNewDecFromStr("1"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, keepertest.TestContract, dexkeeper.GetContractWithoutGasCharge) - ctx = ctx.WithBlockHeight(1) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - // No state change should've been persisted - matchResult, _ := dexkeeper.GetMatchResultState(ctx, keepertest.TestContract) - require.Equal(t, &types.MatchResult{}, matchResult) - // contract should be suspended - contract, err := dexkeeper.GetContract(ctx, keepertest.TestContract) - require.Nil(t, err) - require.True(t, contract.Suspended) -} - -func TestEndBlockPartialRollback(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - // BAD CONTRACT - dexkeeper := testApp.DexKeeper - pair := TEST_PAIR() - // register contract and pair - dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: keepertest.TestContract, NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000}) - dexkeeper.AddRegisteredPair(ctx, keepertest.TestContract, pair) - // place one order to a nonexistent contract - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(keepertest.TestContract), pair).Add( - &types.Order{ - Id: 1, - Account: keepertest.TestAccount, - ContractAddr: keepertest.TestContract, - Price: sdk.MustNewDecFromStr("1"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, keepertest.TestContract, dexkeeper.GetContractWithoutGasCharge) - // GOOD CONTRACT - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(1000000)), sdk.NewCoin("uusdc", sdk.NewInt(1000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - dexAmounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(500000)), sdk.NewCoin("uusdc", sdk.NewInt(1000000))) - bankkeeper.SendCoinsFromAccountToModule(ctx, testAccount, types.ModuleName, dexAmounts) - wasm, err := ioutil.ReadFile("./testdata/mars.wasm") - if err != nil { - panic(err) - } - wasmKeeper := testApp.WasmKeeper - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&wasmKeeper) - var perm *wasmtypes.AccessConfig - codeId, err := contractKeeper.Create(ctx, testAccount, wasm, perm) - if err != nil { - panic(err) - } - contractAddr, _, err := contractKeeper.Instantiate(ctx, codeId, testAccount, testAccount, []byte(GOOD_CONTRACT_INSTANTIATE), "test", - sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100000)))) - if err != nil { - panic(err) - } - dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: contractAddr.String(), NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000}) - dexkeeper.AddRegisteredPair(ctx, contractAddr.String(), pair) - // place one order to the good contract - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 2, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("0.0001"), - Quantity: sdk.MustNewDecFromStr("0.0001"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetDepositInfo(ctx, types.ContractAddress(contractAddr.String())).Add( - &types.DepositInfoEntry{ - Creator: testAccount.String(), - Denom: "uusdc", - Amount: sdk.MustNewDecFromStr("10000"), - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - - ctx = ctx.WithBlockHeight(1) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - // No state change should've been persisted for bad contract - matchResult, _ := dexkeeper.GetMatchResultState(ctx, keepertest.TestContract) - require.Equal(t, &types.MatchResult{}, matchResult) - // bad contract should be suspended - contract, err := dexkeeper.GetContract(ctx, keepertest.TestContract) - require.Nil(t, err) - require.True(t, contract.Suspended) - // state change should've been persisted for good contract - matchResult, _ = dexkeeper.GetMatchResultState(ctx, contractAddr.String()) - require.Equal(t, 1, len(matchResult.Orders)) - _, found := dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("0.0001"), pair.PriceDenom, pair.AssetDenom) - require.True(t, found) -} - -func TestBeginBlock(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - dexkeeper := testApp.DexKeeper - - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(10000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - wasm, err := ioutil.ReadFile("./testdata/mars.wasm") - if err != nil { - panic(err) - } - wasmKeeper := testApp.WasmKeeper - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&wasmKeeper) - var perm *wasmtypes.AccessConfig - codeId, err := contractKeeper.Create(ctx, testAccount, wasm, perm) - if err != nil { - panic(err) - } - contractAddr, _, err := contractKeeper.Instantiate(ctx, codeId, testAccount, testAccount, []byte(GOOD_CONTRACT_INSTANTIATE), "test", - sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100000)))) - if err != nil { - panic(err) - } - dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: contractAddr.String(), NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000}) - - // right now just make sure it doesn't crash since it doesn't register any state to be checked against - testApp.BeginBlocker(ctx, abci.RequestBeginBlock{}) -} - -// Note that once the bug that causes EndBlock to panic is fixed, this test will need to be -// updated to trigger the next bug that causes panics, if any. -func TestEndBlockPanicHandling(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - dexkeeper := testApp.DexKeeper - pair := types.Pair{PriceDenom: "SEI", AssetDenom: "ATOM"} - - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(10000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - dexAmounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(5000000))) - bankkeeper.SendCoinsFromAccountToModule(ctx, testAccount, types.ModuleName, dexAmounts) - wasm, err := ioutil.ReadFile("./testdata/mars.wasm") - if err != nil { - panic(err) - } - wasmKeeper := testApp.WasmKeeper - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&wasmKeeper) - var perm *wasmtypes.AccessConfig - codeId, err := contractKeeper.Create(ctx, testAccount, wasm, perm) - if err != nil { - panic(err) - } - contractAddr, _, err := contractKeeper.Instantiate(ctx, codeId, testAccount, testAccount, []byte(GOOD_CONTRACT_INSTANTIATE), "test", - sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100000)))) - if err != nil { - panic(err) - } - dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: contractAddr.String(), NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000}) - dexkeeper.AddRegisteredPair(ctx, contractAddr.String(), pair) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 1, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.Dec{}, - Quantity: sdk.Dec{}, - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetDepositInfo(ctx, types.ContractAddress(contractAddr.String())).Add( - &types.DepositInfoEntry{ - Creator: testAccount.String(), - Denom: "usei", - Amount: sdk.MustNewDecFromStr("2000000"), - }, - ) - - require.NotPanics(t, func() { testApp.EndBlocker(ctx, abci.RequestEndBlock{}) }) - _, found := dexkeeper.GetLongBookByPrice(ctx, contractAddr.String(), sdk.MustNewDecFromStr("1"), pair.PriceDenom, pair.AssetDenom) - require.False(t, found) -} - -func TestEndBlockRollbackWithRentCharge(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - dexkeeper := testApp.DexKeeper - pair := TEST_PAIR() - // GOOD CONTRACT - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(1000000)), sdk.NewCoin("uusdc", sdk.NewInt(1000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - dexAmounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(500000)), sdk.NewCoin("uusdc", sdk.NewInt(1000000))) - bankkeeper.SendCoinsFromAccountToModule(ctx, testAccount, types.ModuleName, dexAmounts) - wasm, err := ioutil.ReadFile("./testdata/mars.wasm") - if err != nil { - panic(err) - } - wasmKeeper := testApp.WasmKeeper - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&wasmKeeper) - var perm *wasmtypes.AccessConfig - codeId, err := contractKeeper.Create(ctx, testAccount, wasm, perm) - if err != nil { - panic(err) - } - contractAddr, _, err := contractKeeper.Instantiate(ctx, codeId, testAccount, testAccount, []byte(GOOD_CONTRACT_INSTANTIATE), "test", - sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100000)))) - if err != nil { - panic(err) - } - dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: contractAddr.String(), NeedHook: false, NeedOrderMatching: true, RentBalance: 1}) - dexkeeper.AddRegisteredPair(ctx, contractAddr.String(), pair) - // place one order to a nonexistent contract - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 2, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("0.0001"), - Quantity: sdk.MustNewDecFromStr("0.0001"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetDepositInfo(ctx, types.ContractAddress(contractAddr.String())).Add( - &types.DepositInfoEntry{ - Creator: testAccount.String(), - Denom: "uusdc", - Amount: sdk.MustNewDecFromStr("10000"), - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - // overwrite params for testing - params := dexkeeper.GetParams(ctx) - params.MinProcessableRent = 0 - dexkeeper.SetParams(ctx, params) - - ctx = ctx.WithBlockHeight(1) - creatorBalanceBefore := bankkeeper.GetBalance(ctx, testAccount, "usei") - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - // no state change should've been persisted for good contract because it should've run out of gas - matchResult, _ := dexkeeper.GetMatchResultState(ctx, contractAddr.String()) - require.Equal(t, 0, len(matchResult.Orders)) - // rent should still be charged even if the contract failed - c, err := dexkeeper.GetContract(ctx, contractAddr.String()) - require.Nil(t, err) - require.True(t, c.Suspended) // bad contract is suspended not because of out-of-rent but because of execution error - require.Equal(t, uint64(0), c.RentBalance) // rent balance should be drained - require.Equal(t, int64(1), dexkeeper.BankKeeper.GetBalance( - ctx, - dexkeeper.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName), - "usei", - ).Amount.Int64()) // bad contract rent should be sent to fee collector - creatorBalanceAfter := bankkeeper.GetBalance(ctx, testAccount, "usei") - require.Equal(t, creatorBalanceBefore, creatorBalanceAfter) -} - -func TestEndBlockContractWithoutPair(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - dexkeeper := testApp.DexKeeper - - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(10000000)), sdk.NewCoin("uusdc", sdk.NewInt(10000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - dexAmounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(5000000)), sdk.NewCoin("uusdc", sdk.NewInt(10000000))) - bankkeeper.SendCoinsFromAccountToModule(ctx, testAccount, types.ModuleName, dexAmounts) - wasm, err := ioutil.ReadFile("./testdata/mars.wasm") - if err != nil { - panic(err) - } - wasmKeeper := testApp.WasmKeeper - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&wasmKeeper) - var perm *wasmtypes.AccessConfig - codeId, err := contractKeeper.Create(ctx, testAccount, wasm, perm) - if err != nil { - panic(err) - } - contractAddr, _, err := contractKeeper.Instantiate(ctx, codeId, testAccount, testAccount, []byte(GOOD_CONTRACT_INSTANTIATE), "test", - sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100000)))) - if err != nil { - panic(err) - } - - // no pair registered - contractInfo := types.ContractInfoV2{CodeId: 123, ContractAddr: contractAddr.String(), NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000} - dexkeeper.SetContract(ctx, &contractInfo) - - tp := trace.NewNoopTracerProvider() - otel.SetTracerProvider(trace.NewNoopTracerProvider()) - tr := tp.Tracer("component-main") - ti := tracing.Info{ - Tracer: &tr, - } - _, _, _, _, success := contract.EndBlockerAtomic(ctx, &testApp.DexKeeper, []types.ContractInfoV2{contractInfo}, &ti) - require.True(t, success) - - contractInfo, err = dexkeeper.GetContract(ctx, contractInfo.ContractAddr) - require.Nil(t, err) - require.False(t, contractInfo.Suspended) -} - -func TestOrderCountUpdate(t *testing.T) { - testApp := keepertest.TestApp() - ctx := testApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(testApp.GetMemKey(types.MemStoreKey)))) - dexkeeper := testApp.DexKeeper - pair := types.Pair{PriceDenom: "SEI", AssetDenom: "ATOM"} - - testAccount, _ := sdk.AccAddressFromBech32("sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx") - amounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(10000000)), sdk.NewCoin("uusdc", sdk.NewInt(10000000))) - bankkeeper := testApp.BankKeeper - bankkeeper.MintCoins(ctx, minttypes.ModuleName, amounts) - bankkeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, testAccount, amounts) - dexAmounts := sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(5000000)), sdk.NewCoin("uusdc", sdk.NewInt(10000000))) - bankkeeper.SendCoinsFromAccountToModule(ctx, testAccount, types.ModuleName, dexAmounts) - wasm, err := ioutil.ReadFile("./testdata/mars.wasm") - if err != nil { - panic(err) - } - wasmKeeper := testApp.WasmKeeper - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&wasmKeeper) - var perm *wasmtypes.AccessConfig - codeId, err := contractKeeper.Create(ctx, testAccount, wasm, perm) - if err != nil { - panic(err) - } - contractAddr, _, err := contractKeeper.Instantiate(ctx, codeId, testAccount, testAccount, []byte(GOOD_CONTRACT_INSTANTIATE), "test", - sdk.NewCoins(sdk.NewCoin("usei", sdk.NewInt(100000)))) - if err != nil { - panic(err) - } - - dexkeeper.SetContract(ctx, &types.ContractInfoV2{CodeId: 123, ContractAddr: contractAddr.String(), NeedHook: false, NeedOrderMatching: true, RentBalance: 100000000}) - dexkeeper.AddRegisteredPair(ctx, contractAddr.String(), pair) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 1, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("1"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 2, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("2"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 3, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("3"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_SHORT, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetDepositInfo(ctx, types.ContractAddress(contractAddr.String())).Add( - &types.DepositInfoEntry{ - Creator: testAccount.String(), - Denom: "uusdc", - Amount: sdk.MustNewDecFromStr("2000000"), - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - - ctx = ctx.WithBlockHeight(1) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - require.Equal(t, uint64(1), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(1))) - require.Equal(t, uint64(0), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_SHORT, sdk.NewDec(1))) - require.Equal(t, uint64(1), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(2))) - require.Equal(t, uint64(0), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_SHORT, sdk.NewDec(2))) - require.Equal(t, uint64(0), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(3))) - require.Equal(t, uint64(1), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_SHORT, sdk.NewDec(3))) - - dexutils.GetMemState(ctx.Context()).Clear(ctx) - dexutils.GetMemState(ctx.Context()).GetBlockOrders(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Order{ - Id: 4, - Account: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("1"), - Quantity: sdk.MustNewDecFromStr("1"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - OrderType: types.OrderType_LIMIT, - PositionDirection: types.PositionDirection_LONG, - Data: "{\"position_effect\":\"Open\",\"leverage\":\"1\"}", - }, - ) - dexutils.GetMemState(ctx.Context()).GetBlockCancels(ctx, types.ContractAddress(contractAddr.String()), pair).Add( - &types.Cancellation{ - Id: 2, - Creator: testAccount.String(), - ContractAddr: contractAddr.String(), - Price: sdk.MustNewDecFromStr("2"), - PriceDenom: pair.PriceDenom, - AssetDenom: pair.AssetDenom, - PositionDirection: types.PositionDirection_LONG, - }, - ) - dexutils.GetMemState(ctx.Context()).SetDownstreamsToProcess(ctx, contractAddr.String(), dexkeeper.GetContractWithoutGasCharge) - ctx = ctx.WithBlockHeight(2) - testApp.EndBlocker(ctx, abci.RequestEndBlock{}) - require.Equal(t, uint64(2), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(1))) - require.Equal(t, uint64(0), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_SHORT, sdk.NewDec(1))) - require.Equal(t, uint64(0), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(2))) - require.Equal(t, uint64(0), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_SHORT, sdk.NewDec(2))) - require.Equal(t, uint64(0), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_LONG, sdk.NewDec(3))) - require.Equal(t, uint64(1), dexkeeper.GetOrderCountState(ctx, contractAddr.String(), pair.PriceDenom, pair.AssetDenom, types.PositionDirection_SHORT, sdk.NewDec(3))) -} diff --git a/x/dex/simulation/simap.go b/x/dex/simulation/simap.go deleted file mode 100644 index 92c437c0d..000000000 --- a/x/dex/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/dex/spec/README.md b/x/dex/spec/README.md deleted file mode 100644 index 36f46e3bd..000000000 --- a/x/dex/spec/README.md +++ /dev/null @@ -1,56 +0,0 @@ -## Abstract -`dex` module is responsible for matching orders for registered contracts. - -## Concepts -### Frequent Batch Auction -The traditional implementation of exchange logic would look something like the following: -1. User A sends an order placement transaction -2. User B sends another order placement transaction -3. User A's transaction is processed by matching it against the order book state and settle accordingly -4. User B's transaction is processed similarly - -Sei's `dex` module takes a different approach: -1. User A sends an order placement transaction -2. User B sends another order placement transaction -3. User A's transaction is processed by simply adding the order to an in-memory queue, without matching -4. User B's transaction is processed similarly -5. At the end of the block that contains both transactions, the in-memory queue as a whole will be matched against the order book state - -Step 5 is where the majority of `dex`'s logic takes place. Specifically it consists of the follow stages for each market: -1. Cancel orders for transactions in the current block -2. Add new limit orders to the order book -3. Match market orders in the current block against the order book -4. Market limit orders in the current block against the order book - -### Contract Registration -Since `dex` only provides order matching logic, product logic specific to individual protocols still needs to be defined in CosmWasm contracts. As such, `dex` offers a way to inform the protocol contracts about order placement and matching results. `dex` achieves this by requiring contracts that want to leverage `dex`'s order matching logic to explicitly register via a special transaction type `MsgRegisterContract`. - -## State (KV Store) -The following prefixes are persisted in disk: -- "LongBook-value-": order book state on the long side where each entry represents a price level and can contain multiple orders at that same price. -- "ShortBook-value-": similar to the above but on the short side. -- "x-wasm-contract": contract registration information. -- "MatchResult-": match results of the most recent block. - -The following prefixes are only used intrablock and are cleared before committing the block, since they serve no purpose beyond the scope of its enclosing block and flushing them to disk would be computationally expensive: -- "MemOrder-": orders added by transactions in the current block and will be matched against the order book states at the end of the block. -- "MemCancel-": cancellations added by transactions in the current block and will update the order book states at the end of the block. - -## Hooks -A registered contract can define the following `sudo` hooks that will be called by the `dex` module at appropriate times: -- BulkOrderPlacements: informs the contract about order placements -- BulkOrderCancellations: informs the contract about order cancellations -- Settlement: informs the contract about matched orders and the settlement prices - -There are two more utility hooks that a contract can define for housekeeping purposes (e.g. recalculate TWAPs): -- NewBlock -- FinalizeBlock (note that this is distinct from ABCI++'s FinalizeBlock) - -## Transactions -- MsgPlaceOrders - place one or more orders against a registered contract -- MsgCancelOrders - cancel one or more orders against a registered contract -- MsgRegisterContract - register or reregister a CosmWasm contract with `dex` - - -## Spam Prevention -Conventionally, spamming to a blockchain is mainly mitigated through charging gas based on the resource a transaction consumes. With `dex`'s unique design though, the bulk of resource comsumption happens at the end of a block, which cannot be quantified precisely beforehand. Thus the `dex` module charges transaction messages of type MsgPlaceOrders and MsgCancelOrders based on a flat rate per order/cancel. This amount is guaranteed to well cover any `dex`-level computation, and any exceeded usage must have come from registered contract's logic being expensive and will be charged against the contract, which is required to post a rent sum upon registration. \ No newline at end of file diff --git a/x/dex/testdata/clearing_house.wasm b/x/dex/testdata/clearing_house.wasm deleted file mode 100644 index 358f884871f18c96d332d2a9ee1c3ccd333a57e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 833624 zcmeFa3z%hBRqwlA`%$&`u3FVy-Cg}ivi42`)tEjs8j~jGFTUc_)dOm`kYqdA^d5u<{)#b}}e<|ulj2cgA)eLUce8Z{_jt2r1YLc|E+nfv>X zG1uB_S69En%kO$RUuw@a*L;jQ=6KC9$DAv={DxP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gaM5?HLmv?MjdQ$Z>6@V z%l97QW|ZPyq#0m4d<)NYFPKF`DCM1TDgfSKnyPZ?2fWO2&x*cP=gr=U2+G8OB$HlZ zLG-qW(-~cnbf>wqV(xTGnqf+bfwAtHQ718yaC*jHwss-OWRmT|^ep=67fH8~awPQ0 F{|`2uo0k9p diff --git a/x/dex/types/alias.go b/x/dex/types/alias.go deleted file mode 100644 index e50603631..000000000 --- a/x/dex/types/alias.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import ( - "fmt" - "strings" -) - -type ( - ContractAddress string - PairString string -) - -const PairDelim = "|" - -func GetPairString(pair *Pair) PairString { - return PairString( - fmt.Sprintf("%s%s%s", pair.PriceDenom, PairDelim, pair.AssetDenom), - ) -} - -func GetPriceAssetString(pairString PairString) (string, string) { - output := strings.Split(string(pairString), "|") - return output[0], output[1] -} diff --git a/x/dex/types/alias_test.go b/x/dex/types/alias_test.go deleted file mode 100644 index 76736bb99..000000000 --- a/x/dex/types/alias_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetPairString(t *testing.T) { - pair := types.Pair{PriceDenom: "USDC", AssetDenom: "ATOM"} - expected := types.PairString("USDC|ATOM") - require.Equal(t, expected, types.GetPairString(&pair)) -} - -func TestGetPriceAssetString(t *testing.T) { - priceDenom, assetDenom := types.GetPriceAssetString(types.PairString("USDC|ATOM")) - require.Equal(t, "USDC", priceDenom) - require.Equal(t, "ATOM", assetDenom) -} diff --git a/x/dex/types/asset_list.pb.go b/x/dex/types/asset_list.pb.go deleted file mode 100644 index 4ae77c2d8..000000000 --- a/x/dex/types/asset_list.pb.go +++ /dev/null @@ -1,768 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/asset_list.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/x/bank/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type AssetIBCInfo struct { - SourceChannel string `protobuf:"bytes,1,opt,name=sourceChannel,proto3" json:"source_channel"` - DstChannel string `protobuf:"bytes,2,opt,name=dstChannel,proto3" json:"dst_channel"` - SourceDenom string `protobuf:"bytes,3,opt,name=sourceDenom,proto3" json:"source_denom"` - SourceChainID string `protobuf:"bytes,4,opt,name=sourceChainID,proto3" json:"source_chain_id"` -} - -func (m *AssetIBCInfo) Reset() { *m = AssetIBCInfo{} } -func (m *AssetIBCInfo) String() string { return proto.CompactTextString(m) } -func (*AssetIBCInfo) ProtoMessage() {} -func (*AssetIBCInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_65992190d1b6a2ed, []int{0} -} -func (m *AssetIBCInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AssetIBCInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AssetIBCInfo.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 *AssetIBCInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_AssetIBCInfo.Merge(m, src) -} -func (m *AssetIBCInfo) XXX_Size() int { - return m.Size() -} -func (m *AssetIBCInfo) XXX_DiscardUnknown() { - xxx_messageInfo_AssetIBCInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_AssetIBCInfo proto.InternalMessageInfo - -func (m *AssetIBCInfo) GetSourceChannel() string { - if m != nil { - return m.SourceChannel - } - return "" -} - -func (m *AssetIBCInfo) GetDstChannel() string { - if m != nil { - return m.DstChannel - } - return "" -} - -func (m *AssetIBCInfo) GetSourceDenom() string { - if m != nil { - return m.SourceDenom - } - return "" -} - -func (m *AssetIBCInfo) GetSourceChainID() string { - if m != nil { - return m.SourceChainID - } - return "" -} - -type AssetMetadata struct { - IbcInfo *AssetIBCInfo `protobuf:"bytes,1,opt,name=ibcInfo,proto3" json:"ibc_info"` - TypeAsset string `protobuf:"bytes,2,opt,name=type_asset,json=typeAsset,proto3" json:"type_asset"` - Metadata types.Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata"` -} - -func (m *AssetMetadata) Reset() { *m = AssetMetadata{} } -func (m *AssetMetadata) String() string { return proto.CompactTextString(m) } -func (*AssetMetadata) ProtoMessage() {} -func (*AssetMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_65992190d1b6a2ed, []int{1} -} -func (m *AssetMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AssetMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AssetMetadata.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 *AssetMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_AssetMetadata.Merge(m, src) -} -func (m *AssetMetadata) XXX_Size() int { - return m.Size() -} -func (m *AssetMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_AssetMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_AssetMetadata proto.InternalMessageInfo - -func (m *AssetMetadata) GetIbcInfo() *AssetIBCInfo { - if m != nil { - return m.IbcInfo - } - return nil -} - -func (m *AssetMetadata) GetTypeAsset() string { - if m != nil { - return m.TypeAsset - } - return "" -} - -func (m *AssetMetadata) GetMetadata() types.Metadata { - if m != nil { - return m.Metadata - } - return types.Metadata{} -} - -func init() { - proto.RegisterType((*AssetIBCInfo)(nil), "seiprotocol.seichain.dex.AssetIBCInfo") - proto.RegisterType((*AssetMetadata)(nil), "seiprotocol.seichain.dex.AssetMetadata") -} - -func init() { proto.RegisterFile("dex/asset_list.proto", fileDescriptor_65992190d1b6a2ed) } - -var fileDescriptor_65992190d1b6a2ed = []byte{ - // 404 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x31, 0xcf, 0xd3, 0x30, - 0x10, 0x4d, 0x00, 0xc1, 0xf7, 0x39, 0xfd, 0xda, 0xca, 0x74, 0x88, 0x2a, 0x91, 0xa0, 0x0e, 0x88, - 0xa5, 0xb6, 0x5a, 0x16, 0x18, 0x49, 0x2b, 0xa1, 0x0a, 0xc1, 0x90, 0x91, 0x25, 0x72, 0x1c, 0xb7, - 0xb5, 0x68, 0xec, 0xaa, 0x76, 0x51, 0xf9, 0x17, 0xfc, 0xac, 0x8e, 0x1d, 0x91, 0x90, 0x22, 0xd4, - 0x2e, 0x28, 0xbf, 0x02, 0xd9, 0x49, 0x4a, 0x3a, 0xb0, 0x3d, 0xdf, 0xdd, 0xbb, 0x7b, 0xef, 0xce, - 0x60, 0x90, 0xb1, 0x03, 0x26, 0x4a, 0x31, 0x9d, 0x6c, 0xb8, 0xd2, 0x68, 0xbb, 0x93, 0x5a, 0x42, - 0x5f, 0x31, 0x6e, 0x11, 0x95, 0x1b, 0xa4, 0x18, 0xa7, 0x6b, 0xc2, 0x05, 0xca, 0xd8, 0x61, 0x18, - 0x50, 0xa9, 0x72, 0xa9, 0x70, 0x4a, 0xc4, 0x57, 0xfc, 0x6d, 0x92, 0x32, 0x4d, 0x26, 0xf6, 0x51, - 0x31, 0x87, 0x83, 0x95, 0x5c, 0x49, 0x0b, 0xb1, 0x41, 0x55, 0x74, 0xf4, 0xc7, 0x05, 0x9d, 0xf7, - 0x66, 0xc8, 0x22, 0x9a, 0x2d, 0xc4, 0x52, 0xc2, 0xb7, 0xe0,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, - 0x2d, 0xbe, 0xa2, 0xe8, 0xc3, 0xf1, 0x1c, 0xb8, 0xa7, 0x73, 0xe0, 0xfe, 0x3e, 0x07, 0xee, 0x8f, - 0x4b, 0xe0, 0x9c, 0x2e, 0x81, 0xf3, 0xf3, 0x12, 0x38, 0x5f, 0xc6, 0x2b, 0xae, 0xd7, 0xfb, 0x14, - 0x51, 0x99, 0x63, 0xc5, 0xf8, 0xb8, 0xf1, 0x67, 0x1f, 0xd6, 0x20, 0x3e, 0x60, 0xf3, 0xd9, 0x8c, - 0x32, 0x95, 0x3e, 0xb5, 0xf9, 0x37, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xaa, 0x78, 0x83, - 0x80, 0x02, 0x00, 0x00, -} - -func (m *AssetIBCInfo) 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 *AssetIBCInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AssetIBCInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SourceChainID) > 0 { - i -= len(m.SourceChainID) - copy(dAtA[i:], m.SourceChainID) - i = encodeVarintAssetList(dAtA, i, uint64(len(m.SourceChainID))) - i-- - dAtA[i] = 0x22 - } - if len(m.SourceDenom) > 0 { - i -= len(m.SourceDenom) - copy(dAtA[i:], m.SourceDenom) - i = encodeVarintAssetList(dAtA, i, uint64(len(m.SourceDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.DstChannel) > 0 { - i -= len(m.DstChannel) - copy(dAtA[i:], m.DstChannel) - i = encodeVarintAssetList(dAtA, i, uint64(len(m.DstChannel))) - i-- - dAtA[i] = 0x12 - } - if len(m.SourceChannel) > 0 { - i -= len(m.SourceChannel) - copy(dAtA[i:], m.SourceChannel) - i = encodeVarintAssetList(dAtA, i, uint64(len(m.SourceChannel))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AssetMetadata) 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 *AssetMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AssetMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAssetList(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.TypeAsset) > 0 { - i -= len(m.TypeAsset) - copy(dAtA[i:], m.TypeAsset) - i = encodeVarintAssetList(dAtA, i, uint64(len(m.TypeAsset))) - i-- - dAtA[i] = 0x12 - } - if m.IbcInfo != nil { - { - size, err := m.IbcInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAssetList(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAssetList(dAtA []byte, offset int, v uint64) int { - offset -= sovAssetList(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AssetIBCInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SourceChannel) - if l > 0 { - n += 1 + l + sovAssetList(uint64(l)) - } - l = len(m.DstChannel) - if l > 0 { - n += 1 + l + sovAssetList(uint64(l)) - } - l = len(m.SourceDenom) - if l > 0 { - n += 1 + l + sovAssetList(uint64(l)) - } - l = len(m.SourceChainID) - if l > 0 { - n += 1 + l + sovAssetList(uint64(l)) - } - return n -} - -func (m *AssetMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.IbcInfo != nil { - l = m.IbcInfo.Size() - n += 1 + l + sovAssetList(uint64(l)) - } - l = len(m.TypeAsset) - if l > 0 { - n += 1 + l + sovAssetList(uint64(l)) - } - l = m.Metadata.Size() - n += 1 + l + sovAssetList(uint64(l)) - return n -} - -func sovAssetList(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAssetList(x uint64) (n int) { - return sovAssetList(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *AssetIBCInfo) 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 ErrIntOverflowAssetList - } - 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: AssetIBCInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AssetIBCInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAssetList - } - 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 ErrInvalidLengthAssetList - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAssetList - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourceChannel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DstChannel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAssetList - } - 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 ErrInvalidLengthAssetList - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAssetList - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DstChannel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAssetList - } - 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 ErrInvalidLengthAssetList - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAssetList - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAssetList - } - 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 ErrInvalidLengthAssetList - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAssetList - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourceChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAssetList(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAssetList - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AssetMetadata) 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 ErrIntOverflowAssetList - } - 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: AssetMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AssetMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IbcInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAssetList - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAssetList - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAssetList - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IbcInfo == nil { - m.IbcInfo = &AssetIBCInfo{} - } - if err := m.IbcInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TypeAsset", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAssetList - } - 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 ErrInvalidLengthAssetList - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAssetList - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TypeAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAssetList - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAssetList - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAssetList - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAssetList(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAssetList - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAssetList(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAssetList - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAssetList - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAssetList - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthAssetList - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAssetList - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAssetList - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAssetList = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAssetList = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAssetList = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/codec.go b/x/dex/types/codec.go deleted file mode 100644 index 1dcfae37c..000000000 --- a/x/dex/types/codec.go +++ /dev/null @@ -1,71 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgPlaceOrders{}, "dex/MsgPlaceOrders", nil) - cdc.RegisterConcrete(&MsgCancelOrders{}, "dex/MsgCancelOrders", nil) - cdc.RegisterConcrete(&MsgRegisterContract{}, "dex/MsgRegisterContract", nil) - cdc.RegisterConcrete(&MsgRegisterPairs{}, "dex/MsgRegisterPairs", nil) - cdc.RegisterConcrete(&MsgUpdatePriceTickSize{}, "dex/MsgUpdatePriceTickSize", nil) - cdc.RegisterConcrete(&MsgUpdateQuantityTickSize{}, "dex/MsgUpdateQuantityTickSize", nil) - cdc.RegisterConcrete(&AddAssetMetadataProposal{}, "dex/AddAssetMetadataProposal", nil) - cdc.RegisterConcrete(&MsgUnregisterContract{}, "dex/MsgUnregisterContract", nil) - cdc.RegisterConcrete(&MsgContractDepositRent{}, "dex/MsgContractDepositRent", nil) - cdc.RegisterConcrete(&MsgUnsuspendContract{}, "dex/MsgUnsuspendContract", nil) - // this line is used by starport scaffolding # 2 -} - -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgPlaceOrders{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgCancelOrders{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgRegisterContract{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgRegisterPairs{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUpdatePriceTickSize{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUpdateQuantityTickSize{}, - ) - registry.RegisterImplementations((*govtypes.Content)(nil), - &AddAssetMetadataProposal{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUnregisterContract{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgContractDepositRent{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUnsuspendContract{}, - ) - // this line is used by starport scaffolding # 3 - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) - -func init() { - RegisterCodec(Amino) - cryptocodec.RegisterCrypto(Amino) - Amino.Seal() -} diff --git a/x/dex/types/contract.pb.go b/x/dex/types/contract.pb.go deleted file mode 100644 index 701429157..000000000 --- a/x/dex/types/contract.pb.go +++ /dev/null @@ -1,1902 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/contract.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ContractInfo struct { - CodeId uint64 `protobuf:"varint,1,opt,name=codeId,proto3" json:"codeId,omitempty"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` - NeedHook bool `protobuf:"varint,3,opt,name=needHook,proto3" json:"needHook,omitempty"` - NeedOrderMatching bool `protobuf:"varint,4,opt,name=needOrderMatching,proto3" json:"needOrderMatching,omitempty"` - Dependencies []*ContractDependencyInfo `protobuf:"bytes,5,rep,name=dependencies,proto3" json:"dependencies,omitempty"` - NumIncomingDependencies int64 `protobuf:"varint,6,opt,name=numIncomingDependencies,proto3" json:"numIncomingDependencies,omitempty"` -} - -func (m *ContractInfo) Reset() { *m = ContractInfo{} } -func (m *ContractInfo) String() string { return proto.CompactTextString(m) } -func (*ContractInfo) ProtoMessage() {} -func (*ContractInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ee35557664974a8a, []int{0} -} -func (m *ContractInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContractInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContractInfo.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 *ContractInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractInfo.Merge(m, src) -} -func (m *ContractInfo) XXX_Size() int { - return m.Size() -} -func (m *ContractInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ContractInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ContractInfo proto.InternalMessageInfo - -func (m *ContractInfo) GetCodeId() uint64 { - if m != nil { - return m.CodeId - } - return 0 -} - -func (m *ContractInfo) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *ContractInfo) GetNeedHook() bool { - if m != nil { - return m.NeedHook - } - return false -} - -func (m *ContractInfo) GetNeedOrderMatching() bool { - if m != nil { - return m.NeedOrderMatching - } - return false -} - -func (m *ContractInfo) GetDependencies() []*ContractDependencyInfo { - if m != nil { - return m.Dependencies - } - return nil -} - -func (m *ContractInfo) GetNumIncomingDependencies() int64 { - if m != nil { - return m.NumIncomingDependencies - } - return 0 -} - -type ContractInfoV2 struct { - CodeId uint64 `protobuf:"varint,1,opt,name=codeId,proto3" json:"codeId,omitempty"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` - NeedHook bool `protobuf:"varint,3,opt,name=needHook,proto3" json:"needHook,omitempty"` - NeedOrderMatching bool `protobuf:"varint,4,opt,name=needOrderMatching,proto3" json:"needOrderMatching,omitempty"` - Dependencies []*ContractDependencyInfo `protobuf:"bytes,5,rep,name=dependencies,proto3" json:"dependencies,omitempty"` - NumIncomingDependencies int64 `protobuf:"varint,6,opt,name=numIncomingDependencies,proto3" json:"numIncomingDependencies,omitempty"` - Creator string `protobuf:"bytes,7,opt,name=creator,proto3" json:"creator,omitempty"` - RentBalance uint64 `protobuf:"varint,8,opt,name=rentBalance,proto3" json:"rentBalance,omitempty"` - Suspended bool `protobuf:"varint,9,opt,name=suspended,proto3" json:"suspended,omitempty"` - SuspensionReason string `protobuf:"bytes,10,opt,name=suspensionReason,proto3" json:"suspensionReason,omitempty"` -} - -func (m *ContractInfoV2) Reset() { *m = ContractInfoV2{} } -func (m *ContractInfoV2) String() string { return proto.CompactTextString(m) } -func (*ContractInfoV2) ProtoMessage() {} -func (*ContractInfoV2) Descriptor() ([]byte, []int) { - return fileDescriptor_ee35557664974a8a, []int{1} -} -func (m *ContractInfoV2) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContractInfoV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContractInfoV2.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 *ContractInfoV2) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractInfoV2.Merge(m, src) -} -func (m *ContractInfoV2) XXX_Size() int { - return m.Size() -} -func (m *ContractInfoV2) XXX_DiscardUnknown() { - xxx_messageInfo_ContractInfoV2.DiscardUnknown(m) -} - -var xxx_messageInfo_ContractInfoV2 proto.InternalMessageInfo - -func (m *ContractInfoV2) GetCodeId() uint64 { - if m != nil { - return m.CodeId - } - return 0 -} - -func (m *ContractInfoV2) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *ContractInfoV2) GetNeedHook() bool { - if m != nil { - return m.NeedHook - } - return false -} - -func (m *ContractInfoV2) GetNeedOrderMatching() bool { - if m != nil { - return m.NeedOrderMatching - } - return false -} - -func (m *ContractInfoV2) GetDependencies() []*ContractDependencyInfo { - if m != nil { - return m.Dependencies - } - return nil -} - -func (m *ContractInfoV2) GetNumIncomingDependencies() int64 { - if m != nil { - return m.NumIncomingDependencies - } - return 0 -} - -func (m *ContractInfoV2) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *ContractInfoV2) GetRentBalance() uint64 { - if m != nil { - return m.RentBalance - } - return 0 -} - -func (m *ContractInfoV2) GetSuspended() bool { - if m != nil { - return m.Suspended - } - return false -} - -func (m *ContractInfoV2) GetSuspensionReason() string { - if m != nil { - return m.SuspensionReason - } - return "" -} - -// suppose A is first registered and depends on X, then B is added and depends on X, -// and then C is added and depends on X, then A is the elder sibling to B and B is -// the younger sibling to A, and B is the elder sibling to C and C is the younger to B -type ContractDependencyInfo struct { - Dependency string `protobuf:"bytes,1,opt,name=dependency,proto3" json:"dependency,omitempty"` - ImmediateElderSibling string `protobuf:"bytes,2,opt,name=immediateElderSibling,proto3" json:"immediateElderSibling,omitempty"` - ImmediateYoungerSibling string `protobuf:"bytes,3,opt,name=immediateYoungerSibling,proto3" json:"immediateYoungerSibling,omitempty"` -} - -func (m *ContractDependencyInfo) Reset() { *m = ContractDependencyInfo{} } -func (m *ContractDependencyInfo) String() string { return proto.CompactTextString(m) } -func (*ContractDependencyInfo) ProtoMessage() {} -func (*ContractDependencyInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ee35557664974a8a, []int{2} -} -func (m *ContractDependencyInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContractDependencyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContractDependencyInfo.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 *ContractDependencyInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractDependencyInfo.Merge(m, src) -} -func (m *ContractDependencyInfo) XXX_Size() int { - return m.Size() -} -func (m *ContractDependencyInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ContractDependencyInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ContractDependencyInfo proto.InternalMessageInfo - -func (m *ContractDependencyInfo) GetDependency() string { - if m != nil { - return m.Dependency - } - return "" -} - -func (m *ContractDependencyInfo) GetImmediateElderSibling() string { - if m != nil { - return m.ImmediateElderSibling - } - return "" -} - -func (m *ContractDependencyInfo) GetImmediateYoungerSibling() string { - if m != nil { - return m.ImmediateYoungerSibling - } - return "" -} - -type LegacyContractInfo struct { - CodeId uint64 `protobuf:"varint,1,opt,name=codeId,proto3" json:"codeId,omitempty"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` - NeedHook bool `protobuf:"varint,3,opt,name=needHook,proto3" json:"needHook,omitempty"` - NeedOrderMatching bool `protobuf:"varint,4,opt,name=needOrderMatching,proto3" json:"needOrderMatching,omitempty"` - DependentContractAddrs []string `protobuf:"bytes,5,rep,name=dependentContractAddrs,proto3" json:"dependentContractAddrs,omitempty"` -} - -func (m *LegacyContractInfo) Reset() { *m = LegacyContractInfo{} } -func (m *LegacyContractInfo) String() string { return proto.CompactTextString(m) } -func (*LegacyContractInfo) ProtoMessage() {} -func (*LegacyContractInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ee35557664974a8a, []int{3} -} -func (m *LegacyContractInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LegacyContractInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LegacyContractInfo.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 *LegacyContractInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_LegacyContractInfo.Merge(m, src) -} -func (m *LegacyContractInfo) XXX_Size() int { - return m.Size() -} -func (m *LegacyContractInfo) XXX_DiscardUnknown() { - xxx_messageInfo_LegacyContractInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_LegacyContractInfo proto.InternalMessageInfo - -func (m *LegacyContractInfo) GetCodeId() uint64 { - if m != nil { - return m.CodeId - } - return 0 -} - -func (m *LegacyContractInfo) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *LegacyContractInfo) GetNeedHook() bool { - if m != nil { - return m.NeedHook - } - return false -} - -func (m *LegacyContractInfo) GetNeedOrderMatching() bool { - if m != nil { - return m.NeedOrderMatching - } - return false -} - -func (m *LegacyContractInfo) GetDependentContractAddrs() []string { - if m != nil { - return m.DependentContractAddrs - } - return nil -} - -type DownsteamContracts struct { - ContractAddrs []string `protobuf:"bytes,1,rep,name=contractAddrs,proto3" json:"contractAddrs,omitempty"` -} - -func (m *DownsteamContracts) Reset() { *m = DownsteamContracts{} } -func (m *DownsteamContracts) String() string { return proto.CompactTextString(m) } -func (*DownsteamContracts) ProtoMessage() {} -func (*DownsteamContracts) Descriptor() ([]byte, []int) { - return fileDescriptor_ee35557664974a8a, []int{4} -} -func (m *DownsteamContracts) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DownsteamContracts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DownsteamContracts.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 *DownsteamContracts) XXX_Merge(src proto.Message) { - xxx_messageInfo_DownsteamContracts.Merge(m, src) -} -func (m *DownsteamContracts) XXX_Size() int { - return m.Size() -} -func (m *DownsteamContracts) XXX_DiscardUnknown() { - xxx_messageInfo_DownsteamContracts.DiscardUnknown(m) -} - -var xxx_messageInfo_DownsteamContracts proto.InternalMessageInfo - -func (m *DownsteamContracts) GetContractAddrs() []string { - if m != nil { - return m.ContractAddrs - } - return nil -} - -func init() { - proto.RegisterType((*ContractInfo)(nil), "seiprotocol.seichain.dex.ContractInfo") - proto.RegisterType((*ContractInfoV2)(nil), "seiprotocol.seichain.dex.ContractInfoV2") - proto.RegisterType((*ContractDependencyInfo)(nil), "seiprotocol.seichain.dex.ContractDependencyInfo") - proto.RegisterType((*LegacyContractInfo)(nil), "seiprotocol.seichain.dex.LegacyContractInfo") - proto.RegisterType((*DownsteamContracts)(nil), "seiprotocol.seichain.dex.DownsteamContracts") -} - -func init() { proto.RegisterFile("dex/contract.proto", fileDescriptor_ee35557664974a8a) } - -var fileDescriptor_ee35557664974a8a = []byte{ - // 481 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x54, 0x41, 0x8b, 0x13, 0x31, - 0x14, 0x6e, 0xb6, 0x6b, 0xb7, 0x7d, 0x5b, 0x45, 0x03, 0xd6, 0x20, 0x32, 0x0c, 0x83, 0x87, 0x22, - 0xee, 0x54, 0x56, 0x11, 0xf1, 0xe6, 0x6e, 0x45, 0x0b, 0x8a, 0x30, 0x8a, 0xa0, 0xb7, 0x34, 0x79, - 0x4e, 0x83, 0x9d, 0xa4, 0x4c, 0x52, 0x6c, 0xff, 0x85, 0x3f, 0xc2, 0x83, 0x07, 0x7f, 0x88, 0xc7, - 0xc5, 0x93, 0x47, 0x69, 0xff, 0x88, 0x4c, 0xba, 0xd3, 0x9d, 0xb2, 0xed, 0xdd, 0x83, 0xb7, 0xbc, - 0xef, 0x4b, 0xbe, 0xc7, 0xf7, 0xbd, 0x37, 0x03, 0x54, 0xe2, 0xac, 0x27, 0x8c, 0x76, 0x39, 0x17, - 0x2e, 0x9e, 0xe4, 0xc6, 0x19, 0xca, 0x2c, 0x2a, 0x7f, 0x12, 0x66, 0x1c, 0x5b, 0x54, 0x62, 0xc4, - 0x95, 0x8e, 0x25, 0xce, 0xa2, 0x6f, 0x7b, 0xd0, 0x3e, 0x3d, 0xbf, 0x3c, 0xd0, 0x9f, 0x0c, 0xed, - 0x40, 0x43, 0x18, 0x89, 0x03, 0xc9, 0x48, 0x48, 0xba, 0xfb, 0xc9, 0x79, 0x45, 0x23, 0x68, 0x97, - 0xa2, 0xcf, 0xa4, 0xcc, 0xd9, 0x5e, 0x48, 0xba, 0xad, 0x64, 0x03, 0xa3, 0xb7, 0xa1, 0xa9, 0x11, - 0xe5, 0x4b, 0x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 0x8e, 0x8b, 0x11, 0xac, 0xe6, 0xb8, 0x9d, 0x2c, - 0x02, 0x5b, 0x13, 0x1f, 0xcc, 0x54, 0xa7, 0x17, 0xef, 0xea, 0xfe, 0xdd, 0x2e, 0x3a, 0xfa, 0x45, - 0x80, 0xbe, 0xc2, 0x94, 0x8b, 0xf9, 0x3f, 0xf8, 0x19, 0x3e, 0x86, 0x4e, 0x19, 0x8d, 0x3b, 0xad, - 0xb4, 0x58, 0xed, 0x59, 0x2b, 0xd9, 0xc1, 0x46, 0x4f, 0x81, 0xf6, 0xcd, 0x17, 0x6d, 0x1d, 0xf2, - 0xac, 0x64, 0x2c, 0xbd, 0x0b, 0x57, 0xc5, 0x86, 0x08, 0xf1, 0x22, 0x9b, 0xe0, 0xc9, 0x8b, 0x9f, - 0x8b, 0x80, 0x9c, 0x2d, 0x02, 0xf2, 0x67, 0x11, 0x90, 0xaf, 0xcb, 0xa0, 0x76, 0xb6, 0x0c, 0x6a, - 0xbf, 0x97, 0x41, 0xed, 0xe3, 0x51, 0xaa, 0xdc, 0x68, 0x3a, 0x8c, 0x85, 0xc9, 0x7a, 0x16, 0xd5, - 0x51, 0xb9, 0xe0, 0xbe, 0xf0, 0x1b, 0xde, 0x9b, 0xf5, 0x8a, 0xbf, 0x9f, 0x9b, 0x4f, 0xd0, 0x0e, - 0x1b, 0x9e, 0x7f, 0xf8, 0x37, 0x00, 0x00, 0xff, 0xff, 0x37, 0xae, 0xf3, 0x6f, 0x11, 0x05, 0x00, - 0x00, -} - -func (m *ContractInfo) 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 *ContractInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContractInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumIncomingDependencies != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.NumIncomingDependencies)) - i-- - dAtA[i] = 0x30 - } - if len(m.Dependencies) > 0 { - for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.NeedOrderMatching { - i-- - if m.NeedOrderMatching { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.NeedHook { - i-- - if m.NeedHook { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintContract(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if m.CodeId != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.CodeId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ContractInfoV2) 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 *ContractInfoV2) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContractInfoV2) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SuspensionReason) > 0 { - i -= len(m.SuspensionReason) - copy(dAtA[i:], m.SuspensionReason) - i = encodeVarintContract(dAtA, i, uint64(len(m.SuspensionReason))) - i-- - dAtA[i] = 0x52 - } - if m.Suspended { - i-- - if m.Suspended { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - if m.RentBalance != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.RentBalance)) - i-- - dAtA[i] = 0x40 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintContract(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0x3a - } - if m.NumIncomingDependencies != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.NumIncomingDependencies)) - i-- - dAtA[i] = 0x30 - } - if len(m.Dependencies) > 0 { - for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.NeedOrderMatching { - i-- - if m.NeedOrderMatching { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.NeedHook { - i-- - if m.NeedHook { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintContract(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if m.CodeId != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.CodeId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ContractDependencyInfo) 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 *ContractDependencyInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContractDependencyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ImmediateYoungerSibling) > 0 { - i -= len(m.ImmediateYoungerSibling) - copy(dAtA[i:], m.ImmediateYoungerSibling) - i = encodeVarintContract(dAtA, i, uint64(len(m.ImmediateYoungerSibling))) - i-- - dAtA[i] = 0x1a - } - if len(m.ImmediateElderSibling) > 0 { - i -= len(m.ImmediateElderSibling) - copy(dAtA[i:], m.ImmediateElderSibling) - i = encodeVarintContract(dAtA, i, uint64(len(m.ImmediateElderSibling))) - i-- - dAtA[i] = 0x12 - } - if len(m.Dependency) > 0 { - i -= len(m.Dependency) - copy(dAtA[i:], m.Dependency) - i = encodeVarintContract(dAtA, i, uint64(len(m.Dependency))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LegacyContractInfo) 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 *LegacyContractInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LegacyContractInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DependentContractAddrs) > 0 { - for iNdEx := len(m.DependentContractAddrs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DependentContractAddrs[iNdEx]) - copy(dAtA[i:], m.DependentContractAddrs[iNdEx]) - i = encodeVarintContract(dAtA, i, uint64(len(m.DependentContractAddrs[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.NeedOrderMatching { - i-- - if m.NeedOrderMatching { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.NeedHook { - i-- - if m.NeedHook { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintContract(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if m.CodeId != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.CodeId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DownsteamContracts) 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 *DownsteamContracts) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DownsteamContracts) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddrs) > 0 { - for iNdEx := len(m.ContractAddrs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ContractAddrs[iNdEx]) - copy(dAtA[i:], m.ContractAddrs[iNdEx]) - i = encodeVarintContract(dAtA, i, uint64(len(m.ContractAddrs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintContract(dAtA []byte, offset int, v uint64) int { - offset -= sovContract(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ContractInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeId != 0 { - n += 1 + sovContract(uint64(m.CodeId)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - if m.NeedHook { - n += 2 - } - if m.NeedOrderMatching { - n += 2 - } - if len(m.Dependencies) > 0 { - for _, e := range m.Dependencies { - l = e.Size() - n += 1 + l + sovContract(uint64(l)) - } - } - if m.NumIncomingDependencies != 0 { - n += 1 + sovContract(uint64(m.NumIncomingDependencies)) - } - return n -} - -func (m *ContractInfoV2) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeId != 0 { - n += 1 + sovContract(uint64(m.CodeId)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - if m.NeedHook { - n += 2 - } - if m.NeedOrderMatching { - n += 2 - } - if len(m.Dependencies) > 0 { - for _, e := range m.Dependencies { - l = e.Size() - n += 1 + l + sovContract(uint64(l)) - } - } - if m.NumIncomingDependencies != 0 { - n += 1 + sovContract(uint64(m.NumIncomingDependencies)) - } - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - if m.RentBalance != 0 { - n += 1 + sovContract(uint64(m.RentBalance)) - } - if m.Suspended { - n += 2 - } - l = len(m.SuspensionReason) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - return n -} - -func (m *ContractDependencyInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Dependency) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - l = len(m.ImmediateElderSibling) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - l = len(m.ImmediateYoungerSibling) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - return n -} - -func (m *LegacyContractInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeId != 0 { - n += 1 + sovContract(uint64(m.CodeId)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - if m.NeedHook { - n += 2 - } - if m.NeedOrderMatching { - n += 2 - } - if len(m.DependentContractAddrs) > 0 { - for _, s := range m.DependentContractAddrs { - l = len(s) - n += 1 + l + sovContract(uint64(l)) - } - } - return n -} - -func (m *DownsteamContracts) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ContractAddrs) > 0 { - for _, s := range m.ContractAddrs { - l = len(s) - n += 1 + l + sovContract(uint64(l)) - } - } - return n -} - -func sovContract(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozContract(x uint64) (n int) { - return sovContract(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ContractInfo) 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 ErrIntOverflowContract - } - 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: ContractInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContractInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeId", wireType) - } - m.CodeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NeedHook", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NeedHook = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NeedOrderMatching", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NeedOrderMatching = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dependencies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Dependencies = append(m.Dependencies, &ContractDependencyInfo{}) - if err := m.Dependencies[len(m.Dependencies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumIncomingDependencies", wireType) - } - m.NumIncomingDependencies = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumIncomingDependencies |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContractInfoV2) 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 ErrIntOverflowContract - } - 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: ContractInfoV2: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContractInfoV2: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeId", wireType) - } - m.CodeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NeedHook", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NeedHook = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NeedOrderMatching", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NeedOrderMatching = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dependencies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Dependencies = append(m.Dependencies, &ContractDependencyInfo{}) - if err := m.Dependencies[len(m.Dependencies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumIncomingDependencies", wireType) - } - m.NumIncomingDependencies = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumIncomingDependencies |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RentBalance", wireType) - } - m.RentBalance = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RentBalance |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Suspended", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Suspended = bool(v != 0) - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SuspensionReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SuspensionReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContractDependencyInfo) 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 ErrIntOverflowContract - } - 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: ContractDependencyInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContractDependencyInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dependency", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Dependency = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImmediateElderSibling", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImmediateElderSibling = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImmediateYoungerSibling", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImmediateYoungerSibling = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LegacyContractInfo) 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 ErrIntOverflowContract - } - 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: LegacyContractInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LegacyContractInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeId", wireType) - } - m.CodeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NeedHook", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NeedHook = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NeedOrderMatching", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NeedOrderMatching = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DependentContractAddrs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DependentContractAddrs = append(m.DependentContractAddrs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DownsteamContracts) 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 ErrIntOverflowContract - } - 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: DownsteamContracts: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DownsteamContracts: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddrs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddrs = append(m.ContractAddrs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipContract(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowContract - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowContract - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowContract - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthContract - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupContract - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthContract - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthContract = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowContract = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupContract = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/deposit.go b/x/dex/types/deposit.go deleted file mode 100644 index 3479571ad..000000000 --- a/x/dex/types/deposit.go +++ /dev/null @@ -1,19 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -type ContractDepositInfo struct { - Account string `json:"account"` - Denom string `json:"denom"` - Amount sdk.Dec `json:"amount"` -} - -func (d *DepositInfoEntry) ToContractDepositInfo() ContractDepositInfo { - return ContractDepositInfo{ - Account: d.Creator, - Denom: d.Denom, - Amount: d.Amount, - } -} diff --git a/x/dex/types/deposit.pb.go b/x/dex/types/deposit.pb.go deleted file mode 100644 index fbdaff23c..000000000 --- a/x/dex/types/deposit.pb.go +++ /dev/null @@ -1,422 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/deposit.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type DepositInfoEntry struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom"` - Amount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"amount" yaml:"amount"` -} - -func (m *DepositInfoEntry) Reset() { *m = DepositInfoEntry{} } -func (m *DepositInfoEntry) String() string { return proto.CompactTextString(m) } -func (*DepositInfoEntry) ProtoMessage() {} -func (*DepositInfoEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_93caea15661b640e, []int{0} -} -func (m *DepositInfoEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DepositInfoEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DepositInfoEntry.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 *DepositInfoEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_DepositInfoEntry.Merge(m, src) -} -func (m *DepositInfoEntry) XXX_Size() int { - return m.Size() -} -func (m *DepositInfoEntry) XXX_DiscardUnknown() { - xxx_messageInfo_DepositInfoEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_DepositInfoEntry proto.InternalMessageInfo - -func (m *DepositInfoEntry) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *DepositInfoEntry) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func init() { - proto.RegisterType((*DepositInfoEntry)(nil), "seiprotocol.seichain.dex.DepositInfoEntry") -} - -func init() { proto.RegisterFile("dex/deposit.proto", fileDescriptor_93caea15661b640e) } - -var fileDescriptor_93caea15661b640e = []byte{ - // 273 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x50, 0x3f, 0x4b, 0xfb, 0x40, - 0x18, 0xce, 0xfd, 0x7e, 0x58, 0x69, 0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c, 0x7c, 0xff, 0xa3, - 0xd9, 0x79, 0x9b, 0x16, 0xdb, 0xc7, 0xc0, 0xf2, 0x20, 0x19, 0x8d, 0xc5, 0xf3, 0xbe, 0xa3, 0xe4, - 0xd0, 0x51, 0xf2, 0xdd, 0x51, 0xf2, 0xde, 0x53, 0xe7, 0xd0, 0x53, 0xe7, 0xb3, 0xa7, 0xce, 0x4b, - 0xf8, 0xa7, 0x44, 0x82, 0x08, 0xa7, 0x55, 0x0c, 0x31, 0xb3, 0xc4, 0xc7, 0xf1, 0x1a, 0xdb, 0xb7, - 0x9e, 0x19, 0xff, 0xe1, 0x37, 0x00, 0x00, 0xff, 0xff, 0x06, 0xf6, 0x98, 0x0a, 0x54, 0x01, 0x00, - 0x00, -} - -func (m *DepositInfoEntry) 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 *DepositInfoEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DepositInfoEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDeposit(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintDeposit(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintDeposit(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDeposit(dAtA []byte, offset int, v uint64) int { - offset -= sovDeposit(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DepositInfoEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovDeposit(uint64(l)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovDeposit(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovDeposit(uint64(l)) - return n -} - -func sovDeposit(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDeposit(x uint64) (n int) { - return sovDeposit(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *DepositInfoEntry) 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 ErrIntOverflowDeposit - } - 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: DepositInfoEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DepositInfoEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDeposit - } - 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 ErrInvalidLengthDeposit - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDeposit - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDeposit - } - 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 ErrInvalidLengthDeposit - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDeposit - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 ErrIntOverflowDeposit - } - 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 ErrInvalidLengthDeposit - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDeposit - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDeposit(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDeposit - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDeposit(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDeposit - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDeposit - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDeposit - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDeposit - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDeposit - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDeposit - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDeposit = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDeposit = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDeposit = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/enums.go b/x/dex/types/enums.go deleted file mode 100644 index 0ac28ea0e..000000000 --- a/x/dex/types/enums.go +++ /dev/null @@ -1,29 +0,0 @@ -package types - -import ( - "fmt" - "strings" -) - -func GetPositionEffectFromStr(str string) (PositionEffect, error) { - val, err := getEnumFromStr(str, PositionEffect_value) - return PositionEffect(val), err -} - -func GetPositionDirectionFromStr(str string) (PositionDirection, error) { - val, err := getEnumFromStr(str, PositionDirection_value) - return PositionDirection(val), err -} - -func GetOrderTypeFromStr(str string) (OrderType, error) { - val, err := getEnumFromStr(str, OrderType_value) - return OrderType(val), err -} - -func getEnumFromStr(str string, enumMap map[string]int32) (int32, error) { - upperStr := strings.ToUpper(str) - if val, ok := enumMap[upperStr]; ok { - return val, nil - } - return 0, fmt.Errorf("unknown enum literal: %s", str) -} diff --git a/x/dex/types/enums.pb.go b/x/dex/types/enums.pb.go deleted file mode 100644 index 97464194a..000000000 --- a/x/dex/types/enums.pb.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/enums.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PositionDirection int32 - -const ( - PositionDirection_LONG PositionDirection = 0 - PositionDirection_SHORT PositionDirection = 1 -) - -var PositionDirection_name = map[int32]string{ - 0: "LONG", - 1: "SHORT", -} - -var PositionDirection_value = map[string]int32{ - "LONG": 0, - "SHORT": 1, -} - -func (x PositionDirection) String() string { - return proto.EnumName(PositionDirection_name, int32(x)) -} - -func (PositionDirection) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b8c5bb23c6eb0b88, []int{0} -} - -type PositionEffect int32 - -const ( - PositionEffect_OPEN PositionEffect = 0 - PositionEffect_CLOSE PositionEffect = 1 -) - -var PositionEffect_name = map[int32]string{ - 0: "OPEN", - 1: "CLOSE", -} - -var PositionEffect_value = map[string]int32{ - "OPEN": 0, - "CLOSE": 1, -} - -func (x PositionEffect) String() string { - return proto.EnumName(PositionEffect_name, int32(x)) -} - -func (PositionEffect) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b8c5bb23c6eb0b88, []int{1} -} - -type OrderType int32 - -const ( - OrderType_LIMIT OrderType = 0 - OrderType_MARKET OrderType = 1 - OrderType_FOKMARKET OrderType = 3 - OrderType_FOKMARKETBYVALUE OrderType = 4 - OrderType_STOPLOSS OrderType = 5 - OrderType_STOPLIMIT OrderType = 6 -) - -var OrderType_name = map[int32]string{ - 0: "LIMIT", - 1: "MARKET", - 3: "FOKMARKET", - 4: "FOKMARKETBYVALUE", - 5: "STOPLOSS", - 6: "STOPLIMIT", -} - -var OrderType_value = map[string]int32{ - "LIMIT": 0, - "MARKET": 1, - "FOKMARKET": 3, - "FOKMARKETBYVALUE": 4, - "STOPLOSS": 5, - "STOPLIMIT": 6, -} - -func (x OrderType) String() string { - return proto.EnumName(OrderType_name, int32(x)) -} - -func (OrderType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b8c5bb23c6eb0b88, []int{2} -} - -type Unit int32 - -const ( - Unit_STANDARD Unit = 0 - Unit_MILLI Unit = 1 - Unit_MICRO Unit = 2 - Unit_NANO Unit = 3 -) - -var Unit_name = map[int32]string{ - 0: "STANDARD", - 1: "MILLI", - 2: "MICRO", - 3: "NANO", -} - -var Unit_value = map[string]int32{ - "STANDARD": 0, - "MILLI": 1, - "MICRO": 2, - "NANO": 3, -} - -func (x Unit) String() string { - return proto.EnumName(Unit_name, int32(x)) -} - -func (Unit) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b8c5bb23c6eb0b88, []int{3} -} - -type OrderStatus int32 - -const ( - OrderStatus_PLACED OrderStatus = 0 - OrderStatus_FAILED_TO_PLACE OrderStatus = 1 - OrderStatus_CANCELLED OrderStatus = 2 - OrderStatus_FULFILLED OrderStatus = 3 -) - -var OrderStatus_name = map[int32]string{ - 0: "PLACED", - 1: "FAILED_TO_PLACE", - 2: "CANCELLED", - 3: "FULFILLED", -} - -var OrderStatus_value = map[string]int32{ - "PLACED": 0, - "FAILED_TO_PLACE": 1, - "CANCELLED": 2, - "FULFILLED": 3, -} - -func (x OrderStatus) String() string { - return proto.EnumName(OrderStatus_name, int32(x)) -} - -func (OrderStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b8c5bb23c6eb0b88, []int{4} -} - -type CancellationInitiator int32 - -const ( - CancellationInitiator_USER CancellationInitiator = 0 - CancellationInitiator_LIQUIDATED CancellationInitiator = 1 -) - -var CancellationInitiator_name = map[int32]string{ - 0: "USER", - 1: "LIQUIDATED", -} - -var CancellationInitiator_value = map[string]int32{ - "USER": 0, - "LIQUIDATED": 1, -} - -func (x CancellationInitiator) String() string { - return proto.EnumName(CancellationInitiator_name, int32(x)) -} - -func (CancellationInitiator) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b8c5bb23c6eb0b88, []int{5} -} - -func init() { - proto.RegisterEnum("seiprotocol.seichain.dex.PositionDirection", PositionDirection_name, PositionDirection_value) - proto.RegisterEnum("seiprotocol.seichain.dex.PositionEffect", PositionEffect_name, PositionEffect_value) - proto.RegisterEnum("seiprotocol.seichain.dex.OrderType", OrderType_name, OrderType_value) - proto.RegisterEnum("seiprotocol.seichain.dex.Unit", Unit_name, Unit_value) - proto.RegisterEnum("seiprotocol.seichain.dex.OrderStatus", OrderStatus_name, OrderStatus_value) - proto.RegisterEnum("seiprotocol.seichain.dex.CancellationInitiator", CancellationInitiator_name, CancellationInitiator_value) -} - -func init() { proto.RegisterFile("dex/enums.proto", fileDescriptor_b8c5bb23c6eb0b88) } - -var fileDescriptor_b8c5bb23c6eb0b88 = []byte{ - // 394 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x91, 0xdf, 0x6e, 0xd3, 0x30, - 0x18, 0xc5, 0xe3, 0xb5, 0xab, 0xd6, 0x0f, 0xd8, 0x8c, 0x01, 0x89, 0xab, 0xdc, 0x21, 0xa1, 0x48, - 0x6b, 0x84, 0xe0, 0x05, 0xbc, 0xc4, 0x1d, 0xd6, 0xdc, 0x38, 0xe4, 0x0f, 0x12, 0xdc, 0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 0x3c, 0x62, 0xac, 0xb8, 0x10, 0x1c, 0xa3, 0x51, 0x46, 0x99, 0xc4, - 0x47, 0x16, 0x33, 0xa1, 0x89, 0xc4, 0x93, 0x40, 0xc0, 0x33, 0xc7, 0x96, 0x9b, 0xca, 0x6c, 0x07, - 0x8b, 0x94, 0x0a, 0x1a, 0x31, 0xbb, 0xfa, 0x0a, 0xce, 0x96, 0x94, 0x0b, 0x16, 0x5f, 0x17, 0xf2, - 0xda, 0x4d, 0x47, 0xce, 0x88, 0x26, 0x11, 0x13, 0x82, 0xc5, 0xf8, 0xc8, 0x61, 0x97, 0x62, 0xc9, - 0x9d, 0x9d, 0x04, 0x1f, 0xe0, 0x4d, 0x54, 0xb5, 0xb5, 0x5a, 0xaf, 0x2b, 0xfb, 0x29, 0xbc, 0xd5, - 0x46, 0x57, 0xa6, 0xeb, 0xed, 0x83, 0x65, 0xce, 0x32, 0xec, 0x91, 0x53, 0x00, 0xc1, 0xbf, 0x94, - 0x3c, 0xa6, 0x05, 0x8b, 0x31, 0xba, 0xb8, 0xfc, 0xb5, 0xf7, 0xd1, 0xe3, 0xde, 0x47, 0x7f, 0xf6, - 0x3e, 0xfa, 0x79, 0xf0, 0xbd, 0xc7, 0x83, 0xef, 0xfd, 0x3e, 0xf8, 0xde, 0xf7, 0xf3, 0x1f, 0xda, - 0xdc, 0x6d, 0x6f, 0x16, 0x75, 0x77, 0x1f, 0x0e, 0x4a, 0x9f, 0x3f, 0xb5, 0xe5, 0x8c, 0xab, 0x2b, - 0xdc, 0x85, 0xb6, 0x56, 0xf3, 0xb0, 0x51, 0xc3, 0xcd, 0xcc, 0x9d, 0x7f, 0xfc, 0x1b, 0x00, 0x00, - 0xff, 0xff, 0x40, 0x7d, 0x48, 0x4c, 0xea, 0x01, 0x00, 0x00, -} diff --git a/x/dex/types/enums_test.go b/x/dex/types/enums_test.go deleted file mode 100644 index 1f8d1515b..000000000 --- a/x/dex/types/enums_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGetPositionEffectFromStr(t *testing.T) { - effect := "Close" - expected := types.PositionEffect_CLOSE - actual, err := types.GetPositionEffectFromStr(effect) - - require.Nil(t, err) - require.Equal(t, expected, actual) - - // unidentified effect - effect = "invalid_effect" - _, err = types.GetPositionEffectFromStr(effect) - - require.NotNil(t, err) -} - -func TestGetPositionDirectionFromStr(t *testing.T) { - direction := "Long" - expected := types.PositionDirection_LONG - actual, err := types.GetPositionDirectionFromStr(direction) - - require.Nil(t, err) - require.Equal(t, expected, actual) - - // unidentified direction - direction = "invalid_direction" - _, err = types.GetPositionEffectFromStr(direction) - - require.NotNil(t, err) -} - -func TestGetOrderTypeFromStr(t *testing.T) { - orderType := "Market" - expected := types.OrderType_MARKET - actual, err := types.GetOrderTypeFromStr(orderType) - - require.Nil(t, err) - require.Equal(t, expected, actual) - - // unidentified direction - orderType = "invalid" - _, err = types.GetPositionEffectFromStr(orderType) - - require.NotNil(t, err) -} diff --git a/x/dex/types/errors.go b/x/dex/types/errors.go deleted file mode 100644 index ecdd0253d..000000000 --- a/x/dex/types/errors.go +++ /dev/null @@ -1,28 +0,0 @@ -package types - -// DONTCOVER - -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// x/dex module sentinel errors -var ( - ErrEncodeDexPlaceOrders = sdkerrors.Register(ModuleName, 2, "Error while encoding dex order placement msg in wasmd") - ErrEncodeDexCancelOrders = sdkerrors.Register(ModuleName, 3, "Error while encoding dex order cancellation msg in wasmd") - ErrParsingSeiDexQuery = sdkerrors.Register(ModuleName, 4, "Error parsing SeiDexQuery") - ErrEncodingDexTwaps = sdkerrors.Register(ModuleName, 6, "Error encoding dex twaps as JSON") - ErrEncodingOrders = sdkerrors.Register(ModuleName, 8, "Error encoding orders as JSON") - ErrEncodingOrder = sdkerrors.Register(ModuleName, 10, "Error encoding order as JSON") - ErrEncodingOrderSimulation = sdkerrors.Register(ModuleName, 12, "Error encoding order simulation as JSON") - ErrInvalidOrderID = sdkerrors.Register(ModuleName, 13, "Error order id not found") - ErrEncodingLatestPrice = sdkerrors.Register(ModuleName, 14, "Error encoding latest price as JSON") - ErrUnknownSeiDexQuery = sdkerrors.Register(ModuleName, 15, "Error unknown sei dex query") - ErrPairNotRegistered = sdkerrors.Register(ModuleName, 16, "pair is not registered") - ErrContractNotExists = sdkerrors.Register(ModuleName, 17, "Error finding contract info") - ErrParsingContractInfo = sdkerrors.Register(ModuleName, 18, "Error parsing contract info") - ErrInsufficientRent = sdkerrors.Register(ModuleName, 19, "Error contract does not have sufficient fee") - ErrCircularContractDependency = sdkerrors.Register(ModuleName, 1103, "circular contract dependency detected") - ErrContractSuspended = sdkerrors.Register(ModuleName, 1104, "contract suspended") - ErrContractNotSuspended = sdkerrors.Register(ModuleName, 1105, "contract not suspended") -) diff --git a/x/dex/types/events.go b/x/dex/types/events.go deleted file mode 100644 index a4a34ae5d..000000000 --- a/x/dex/types/events.go +++ /dev/null @@ -1,21 +0,0 @@ -package types - -const ( - EventTypePlaceOrder = "place_order" - EventTypeCancelOrder = "cancel_order" - EventTypeDepositRent = "deposit_rent" - EventTypeRegisterContract = "register_contract" - EventTypeUnregisterContract = "unregister_contract" - EventTypeRegisterPair = "register_pair" - EventTypeSetQuantityTickSize = "set_quantity_tick_size" - EventTypeSetPriceTickSize = "set_price_tick_size" - - AttributeKeyOrderID = "order_id" - AttributeKeyCancellationID = "cancellation_id" - AttributeKeyContractAddress = "contract_address" - AttributeKeyRentBalance = "rent_balance" - AttributeKeyPriceDenom = "price_denom" - AttributeKeyAssetDenom = "asset_denom" - - AttributeValueCategory = ModuleName -) diff --git a/x/dex/types/expected_keepers.go b/x/dex/types/expected_keepers.go deleted file mode 100644 index 6aa6e9778..000000000 --- a/x/dex/types/expected_keepers.go +++ /dev/null @@ -1,18 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -// AccountKeeper defines the expected account keeper used for simulations (noalias) -type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - // Methods imported from account should be defined here -} - -// BankKeeper defines the expected interface needed to retrieve account balances. -type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - // Methods imported from bank should be defined here -} diff --git a/x/dex/types/genesis.go b/x/dex/types/genesis.go deleted file mode 100644 index 9c8f79642..000000000 --- a/x/dex/types/genesis.go +++ /dev/null @@ -1,75 +0,0 @@ -package types - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// DefaultGenesis returns the default Capability genesis state -func DefaultGenesis() *GenesisState { - return &GenesisState{ - Params: DefaultParams(), - ContractState: []ContractState{}, - } -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - paramErr := gs.Params.Validate() - if paramErr != nil { - return paramErr - } - for _, cs := range gs.ContractState { - csErr := cs.Validate() - if csErr != nil { - return csErr - } - } - return nil -} - -func (cs ContractState) Validate() error { - if len(cs.ContractInfo.ContractAddr) == 0 { - return fmt.Errorf("empty contract addr") - } - if _, err := sdk.AccAddressFromBech32(cs.ContractInfo.ContractAddr); err != nil { - return fmt.Errorf("contract address is invalid") - } - // Check for duplicated price in a single market - // Can only be a one price per pair per contract - type MarketPrice struct { - priceDenom string - assetDenom string - price uint64 - } - - // Check for duplication in longbook - longBookPriceMap := make(map[MarketPrice]struct{}) - for _, elem := range cs.LongBookList { - priceElem := MarketPrice{ - priceDenom: elem.Entry.PriceDenom, - assetDenom: elem.Entry.AssetDenom, - price: elem.Price.BigInt().Uint64(), - } - if _, ok := longBookPriceMap[priceElem]; ok { - return fmt.Errorf("duplicated price for longBook") - } - longBookPriceMap[priceElem] = struct{}{} - } - // Check for duplication in shortbook - shortBookPriceMap := make(map[MarketPrice]struct{}) - for _, elem := range cs.ShortBookList { - priceElem := MarketPrice{ - priceDenom: elem.Entry.PriceDenom, - assetDenom: elem.Entry.AssetDenom, - price: elem.Price.BigInt().Uint64(), - } - if _, ok := shortBookPriceMap[priceElem]; ok { - return fmt.Errorf("duplicated price for shortBook") - } - shortBookPriceMap[priceElem] = struct{}{} - } - return nil -} diff --git a/x/dex/types/genesis.pb.go b/x/dex/types/genesis.pb.go deleted file mode 100644 index 4bd5241f6..000000000 --- a/x/dex/types/genesis.pb.go +++ /dev/null @@ -1,1188 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the dex module's genesis state. -type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - ContractState []ContractState `protobuf:"bytes,2,rep,name=contractState,proto3" json:"contractState"` - LastEpoch uint64 `protobuf:"varint,3,opt,name=lastEpoch,proto3" json:"lastEpoch,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_a803aaabd08db59d, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetContractState() []ContractState { - if m != nil { - return m.ContractState - } - return nil -} - -func (m *GenesisState) GetLastEpoch() uint64 { - if m != nil { - return m.LastEpoch - } - return 0 -} - -type ContractState struct { - ContractInfo ContractInfoV2 `protobuf:"bytes,1,opt,name=contractInfo,proto3" json:"contractInfo"` - LongBookList []LongBook `protobuf:"bytes,2,rep,name=longBookList,proto3" json:"longBookList"` - ShortBookList []ShortBook `protobuf:"bytes,3,rep,name=shortBookList,proto3" json:"shortBookList"` - TriggeredOrdersList []Order `protobuf:"bytes,4,rep,name=triggeredOrdersList,proto3" json:"triggeredOrdersList"` - PairList []Pair `protobuf:"bytes,5,rep,name=pairList,proto3" json:"pairList"` - PriceList []ContractPairPrices `protobuf:"bytes,6,rep,name=priceList,proto3" json:"priceList"` - NextOrderId uint64 `protobuf:"varint,7,opt,name=nextOrderId,proto3" json:"nextOrderId,omitempty"` -} - -func (m *ContractState) Reset() { *m = ContractState{} } -func (m *ContractState) String() string { return proto.CompactTextString(m) } -func (*ContractState) ProtoMessage() {} -func (*ContractState) Descriptor() ([]byte, []int) { - return fileDescriptor_a803aaabd08db59d, []int{1} -} -func (m *ContractState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContractState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContractState.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 *ContractState) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractState.Merge(m, src) -} -func (m *ContractState) XXX_Size() int { - return m.Size() -} -func (m *ContractState) XXX_DiscardUnknown() { - xxx_messageInfo_ContractState.DiscardUnknown(m) -} - -var xxx_messageInfo_ContractState proto.InternalMessageInfo - -func (m *ContractState) GetContractInfo() ContractInfoV2 { - if m != nil { - return m.ContractInfo - } - return ContractInfoV2{} -} - -func (m *ContractState) GetLongBookList() []LongBook { - if m != nil { - return m.LongBookList - } - return nil -} - -func (m *ContractState) GetShortBookList() []ShortBook { - if m != nil { - return m.ShortBookList - } - return nil -} - -func (m *ContractState) GetTriggeredOrdersList() []Order { - if m != nil { - return m.TriggeredOrdersList - } - return nil -} - -func (m *ContractState) GetPairList() []Pair { - if m != nil { - return m.PairList - } - return nil -} - -func (m *ContractState) GetPriceList() []ContractPairPrices { - if m != nil { - return m.PriceList - } - return nil -} - -func (m *ContractState) GetNextOrderId() uint64 { - if m != nil { - return m.NextOrderId - } - return 0 -} - -type ContractPairPrices struct { - PricePair Pair `protobuf:"bytes,1,opt,name=pricePair,proto3" json:"pricePair"` - Prices []*Price `protobuf:"bytes,2,rep,name=prices,proto3" json:"prices,omitempty"` -} - -func (m *ContractPairPrices) Reset() { *m = ContractPairPrices{} } -func (m *ContractPairPrices) String() string { return proto.CompactTextString(m) } -func (*ContractPairPrices) ProtoMessage() {} -func (*ContractPairPrices) Descriptor() ([]byte, []int) { - return fileDescriptor_a803aaabd08db59d, []int{2} -} -func (m *ContractPairPrices) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContractPairPrices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContractPairPrices.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 *ContractPairPrices) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractPairPrices.Merge(m, src) -} -func (m *ContractPairPrices) XXX_Size() int { - return m.Size() -} -func (m *ContractPairPrices) XXX_DiscardUnknown() { - xxx_messageInfo_ContractPairPrices.DiscardUnknown(m) -} - -var xxx_messageInfo_ContractPairPrices proto.InternalMessageInfo - -func (m *ContractPairPrices) GetPricePair() Pair { - if m != nil { - return m.PricePair - } - return Pair{} -} - -func (m *ContractPairPrices) GetPrices() []*Price { - if m != nil { - return m.Prices - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "seiprotocol.seichain.dex.GenesisState") - proto.RegisterType((*ContractState)(nil), "seiprotocol.seichain.dex.ContractState") - proto.RegisterType((*ContractPairPrices)(nil), "seiprotocol.seichain.dex.ContractPairPrices") -} - -func init() { proto.RegisterFile("dex/genesis.proto", fileDescriptor_a803aaabd08db59d) } - -var fileDescriptor_a803aaabd08db59d = []byte{ - // 497 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4f, 0x6f, 0xd3, 0x30, - 0x18, 0xc6, 0x1b, 0x5a, 0x0a, 0x73, 0x5b, 0xfe, 0x78, 0x3b, 0x44, 0x15, 0xca, 0xa2, 0x72, 0xa0, - 0x07, 0x96, 0x48, 0xe5, 0xc0, 0x0d, 0xa1, 0x22, 0x34, 0x4d, 0xaa, 0xb4, 0xaa, 0x95, 0x40, 0xe2, - 0x82, 0xd2, 0xc4, 0xa4, 0xd6, 0xba, 0xbc, 0x91, 0x6d, 0xa4, 0xf2, 0x2d, 0xd8, 0x47, 0xe2, 0xb6, - 0xe3, 0x8e, 0x9c, 0x10, 0x6a, 0xbf, 0x08, 0xf2, 0x1b, 0x7b, 0x4d, 0x04, 0x59, 0xb9, 0xc5, 0x8f, - 0x9f, 0xf7, 0xe7, 0xf7, 0xb5, 0x9f, 0x90, 0xa7, 0x09, 0x5b, 0x87, 0x29, 0xcb, 0x98, 0xe4, 0x32, - 0xc8, 0x05, 0x28, 0xa0, 0xae, 0x64, 0x1c, 0xbf, 0x62, 0x58, 0x05, 0x92, 0xf1, 0x78, 0x19, 0xf1, - 0x2c, 0x48, 0xd8, 0xba, 0x7f, 0x94, 0x42, 0x0a, 0xb8, 0x15, 0xea, 0xaf, 0xc2, 0xdf, 0x7f, 0xa2, - 0x11, 0x79, 0x24, 0xa2, 0x4b, 0x43, 0xe8, 0x1f, 0x6a, 0x65, 0x05, 0x59, 0xfa, 0x79, 0x01, 0x70, - 0x61, 0xc4, 0x23, 0x2d, 0xca, 0x25, 0x08, 0x55, 0x56, 0x1f, 0x6b, 0x15, 0x44, 0xc2, 0x84, 0x11, - 0xa8, 0x16, 0x62, 0xc8, 0x94, 0x88, 0x62, 0x65, 0xb4, 0x47, 0xc5, 0x09, 0x5c, 0x94, 0x8b, 0x72, - 0xc1, 0x63, 0x56, 0x08, 0x83, 0x1f, 0x0e, 0xe9, 0x9e, 0x16, 0x43, 0xcc, 0x55, 0xa4, 0x18, 0x7d, - 0x43, 0xda, 0x45, 0x47, 0xae, 0xe3, 0x3b, 0xc3, 0xce, 0xc8, 0x0f, 0xea, 0x86, 0x0a, 0xa6, 0xe8, - 0x1b, 0xb7, 0xae, 0x7f, 0x1d, 0x37, 0x66, 0xa6, 0x8a, 0xce, 0x49, 0xcf, 0xf6, 0x80, 0x40, 0xf7, - 0x9e, 0xdf, 0x1c, 0x76, 0x46, 0x2f, 0xea, 0x31, 0xef, 0xca, 0x76, 0x43, 0xab, 0x32, 0xe8, 0x33, - 0x72, 0xb0, 0x8a, 0xa4, 0x7a, 0x9f, 0x43, 0xbc, 0x74, 0x9b, 0xbe, 0x33, 0x6c, 0xcd, 0x76, 0xc2, - 0xe0, 0xaa, 0x45, 0x7a, 0x15, 0x08, 0x9d, 0x91, 0xae, 0x05, 0x9c, 0x65, 0x5f, 0xc0, 0x8c, 0x32, - 0xdc, 0xdf, 0x83, 0x76, 0x7f, 0x18, 0x99, 0x26, 0x2a, 0x0c, 0x3a, 0x21, 0x5d, 0xfd, 0x30, 0x63, -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 0x05, 0xe2, 0xc2, 0x75, 0xa8, 0x7f, 0x5d, 0xf5, 0x2d, 0x67, 0x72, 0xd1, - 0xc6, 0xfd, 0x57, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x4d, 0x7c, 0x7f, 0x83, 0x04, 0x00, - 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastEpoch != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.LastEpoch)) - i-- - dAtA[i] = 0x18 - } - if len(m.ContractState) > 0 { - for iNdEx := len(m.ContractState) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ContractState[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ContractState) 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 *ContractState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContractState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NextOrderId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.NextOrderId)) - i-- - dAtA[i] = 0x38 - } - if len(m.PriceList) > 0 { - for iNdEx := len(m.PriceList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PriceList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.PairList) > 0 { - for iNdEx := len(m.PairList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PairList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.TriggeredOrdersList) > 0 { - for iNdEx := len(m.TriggeredOrdersList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TriggeredOrdersList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.ShortBookList) > 0 { - for iNdEx := len(m.ShortBookList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ShortBookList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.LongBookList) > 0 { - for iNdEx := len(m.LongBookList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LongBookList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ContractInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ContractPairPrices) 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 *ContractPairPrices) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContractPairPrices) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Prices) > 0 { - for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.PricePair.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.ContractState) > 0 { - for _, e := range m.ContractState { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.LastEpoch != 0 { - n += 1 + sovGenesis(uint64(m.LastEpoch)) - } - return n -} - -func (m *ContractState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ContractInfo.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.LongBookList) > 0 { - for _, e := range m.LongBookList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ShortBookList) > 0 { - for _, e := range m.ShortBookList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.TriggeredOrdersList) > 0 { - for _, e := range m.TriggeredOrdersList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.PairList) > 0 { - for _, e := range m.PairList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.PriceList) > 0 { - for _, e := range m.PriceList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.NextOrderId != 0 { - n += 1 + sovGenesis(uint64(m.NextOrderId)) - } - return n -} - -func (m *ContractPairPrices) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PricePair.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.Prices) > 0 { - for _, e := range m.Prices { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractState = append(m.ContractState, ContractState{}) - if err := m.ContractState[len(m.ContractState)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastEpoch", wireType) - } - m.LastEpoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastEpoch |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContractState) 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 ErrIntOverflowGenesis - } - 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: ContractState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContractState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ContractInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LongBookList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LongBookList = append(m.LongBookList, LongBook{}) - if err := m.LongBookList[len(m.LongBookList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShortBookList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShortBookList = append(m.ShortBookList, ShortBook{}) - if err := m.ShortBookList[len(m.ShortBookList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TriggeredOrdersList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TriggeredOrdersList = append(m.TriggeredOrdersList, Order{}) - if err := m.TriggeredOrdersList[len(m.TriggeredOrdersList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PairList = append(m.PairList, Pair{}) - if err := m.PairList[len(m.PairList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceList = append(m.PriceList, ContractPairPrices{}) - if err := m.PriceList[len(m.PriceList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextOrderId", wireType) - } - m.NextOrderId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NextOrderId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContractPairPrices) 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 ErrIntOverflowGenesis - } - 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: ContractPairPrices: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContractPairPrices: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PricePair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PricePair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Prices = append(m.Prices, &Price{}) - if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/genesis_test.go b/x/dex/types/genesis_test.go deleted file mode 100644 index 49384da41..000000000 --- a/x/dex/types/genesis_test.go +++ /dev/null @@ -1,228 +0,0 @@ -package types_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestGenesisState_Validate(t *testing.T) { - for _, tc := range []struct { - desc string - genState *types.GenesisState - valid bool - }{ - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - { - desc: "valid genesis state", - genState: &types.GenesisState{ - Params: types.DefaultParams(), - ContractState: []types.ContractState{ - { - LongBookList: []types.LongBook{ - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - { - Price: sdk.NewDec(1), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - }, - ShortBookList: []types.ShortBook{ - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - { - Price: sdk.NewDec(1), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - }, - ContractInfo: types.ContractInfoV2{ - CodeId: uint64(1), - ContractAddr: "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m", - }, - }, - }, - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, - }, - { - desc: "same price multiple markets", - genState: &types.GenesisState{ - Params: types.DefaultParams(), - ContractState: []types.ContractState{ - { - LongBookList: []types.LongBook{ - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "USDC", - AssetDenom: "ATOM", - }, - }, - }, - ShortBookList: []types.ShortBook{ - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - { - Price: sdk.NewDec(1), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - }, - ContractInfo: types.ContractInfoV2{ - CodeId: uint64(1), - ContractAddr: "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m", - }, - }, - }, - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, - }, - { - desc: "duplicated longBook", - genState: &types.GenesisState{ - Params: types.DefaultParams(), - ContractState: []types.ContractState{ - { - LongBookList: []types.LongBook{ - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - }, - ContractInfo: types.ContractInfoV2{ - CodeId: uint64(1), - ContractAddr: "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m", - }, - }, - }, - }, - valid: false, - }, - { - desc: "duplicated shortBook", - genState: &types.GenesisState{ - Params: types.DefaultParams(), - ContractState: []types.ContractState{ - { - ShortBookList: []types.ShortBook{ - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - }, - ContractInfo: types.ContractInfoV2{ - CodeId: uint64(1), - ContractAddr: "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m", - }, - }, - }, - }, - valid: false, - }, - { - desc: "invalid contract addr", - genState: &types.GenesisState{ - Params: types.DefaultParams(), - ContractState: []types.ContractState{ - { - ShortBookList: []types.ShortBook{ - { - Price: sdk.NewDec(0), - Entry: &types.OrderEntry{ - Price: sdk.NewDec(0), - PriceDenom: "SEI", - AssetDenom: "ATOM", - }, - }, - }, - ContractInfo: types.ContractInfoV2{ - CodeId: uint64(1), - ContractAddr: "invalid", - }, - }, - }, - }, - valid: false, - }, - // this line is used by starport scaffolding # types/genesis/testcase - } { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} diff --git a/x/dex/types/gov.go b/x/dex/types/gov.go deleted file mode 100644 index 72cd85c4c..000000000 --- a/x/dex/types/gov.go +++ /dev/null @@ -1,57 +0,0 @@ -package types - -import ( - "fmt" - "strings" - - sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -const ( - ProposalTypeAddAssetMetadata = "AddAssetMetadata" -) - -func init() { - // for routing - govtypes.RegisterProposalType(ProposalTypeAddAssetMetadata) - // for marshal and unmarshal - govtypes.RegisterProposalTypeCodec(&AddAssetMetadataProposal{}, "dex/AddAssetMetadataProposal") -} - -func (p *AddAssetMetadataProposal) GetTitle() string { return p.Title } - -func (p *AddAssetMetadataProposal) GetDescription() string { return p.Description } - -func (p *AddAssetMetadataProposal) ProposalRoute() string { return RouterKey } - -func (p *AddAssetMetadataProposal) ProposalType() string { - return ProposalTypeAddAssetMetadata -} - -func (p *AddAssetMetadataProposal) ValidateBasic() error { - // Verify base denoms specified in proposal are well formed - for _, asset := range p.AssetList { - err := sdk.ValidateDenom(asset.Metadata.Base) - if err != nil { - return err - } - } - - err := govtypes.ValidateAbstract(p) - return err -} - -func (p AddAssetMetadataProposal) String() string { - assetRecords := "" - for _, asset := range p.AssetList { - assetRecords += asset.String() - } - var b strings.Builder - b.WriteString(fmt.Sprintf(`Add Asset Metadata Proposal: - Title: %s - Description: %s - Records: %s -`, p.Title, p.Description, assetRecords)) - return b.String() -} diff --git a/x/dex/types/gov.pb.go b/x/dex/types/gov.pb.go deleted file mode 100644 index cbfe56b15..000000000 --- a/x/dex/types/gov.pb.go +++ /dev/null @@ -1,418 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/gov.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// AddAssetMetadataProposal is a gov Content type for adding a new asset -// to the dex module's asset list. -type AddAssetMetadataProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - AssetList []AssetMetadata `protobuf:"bytes,3,rep,name=assetList,proto3" json:"assetList" yaml:"asset_list"` -} - -func (m *AddAssetMetadataProposal) Reset() { *m = AddAssetMetadataProposal{} } -func (*AddAssetMetadataProposal) ProtoMessage() {} -func (*AddAssetMetadataProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_dab07ca1a96062d0, []int{0} -} -func (m *AddAssetMetadataProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddAssetMetadataProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddAssetMetadataProposal.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 *AddAssetMetadataProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddAssetMetadataProposal.Merge(m, src) -} -func (m *AddAssetMetadataProposal) XXX_Size() int { - return m.Size() -} -func (m *AddAssetMetadataProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AddAssetMetadataProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AddAssetMetadataProposal proto.InternalMessageInfo - -func init() { - proto.RegisterType((*AddAssetMetadataProposal)(nil), "seiprotocol.seichain.dex.AddAssetMetadataProposal") -} - -func init() { proto.RegisterFile("dex/gov.proto", fileDescriptor_dab07ca1a96062d0) } - -var fileDescriptor_dab07ca1a96062d0 = []byte{ - // 307 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0x49, 0xad, 0xd0, - 0x4f, 0xcf, 0x2f, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x28, 0x4e, 0xcd, 0x04, 0xb3, - 0x92, 0xf3, 0x73, 0xf4, 0x8a, 0x53, 0x33, 0x93, 0x33, 0x12, 0x33, 0xf3, 0xf4, 0x52, 0x52, 0x2b, - 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0xbd, 0x94, 0x08, 0x48, - 0x7b, 0x62, 0x71, 0x71, 0x6a, 0x49, 0x7c, 0x4e, 0x66, 0x71, 0x09, 0x44, 0x54, 0xe9, 0x0d, 0x23, - 0x97, 0x84, 0x63, 0x4a, 0x8a, 0x23, 0x48, 0xdc, 0x37, 0xb5, 0x24, 0x31, 0x25, 0xb1, 0x24, 0x31, - 0xa0, 0x28, 0xbf, 0x20, 0xbf, 0x38, 0x31, 0x47, 0x48, 0x8d, 0x8b, 0xb5, 0x24, 0xb3, 0x24, 0x27, - 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe0, 0xd3, 0x3d, 0x79, 0x9e, 0xca, 0xc4, 0xdc, - 0x1c, 0x2b, 0x25, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0x5a, 0xc8, 0x82, 0x8b, 0x3b, 0x25, 0xb5, 0x38, - 0xb9, 0x28, 0xb3, 0xa0, 0x24, 0x33, 0x3f, 0x4f, 0x82, 0x09, 0xac, 0x5a, 0xec, 0xd3, 0x3d, 0x79, - 0x21, 0x88, 0x6a, 0x24, 0x49, 0xa5, 0x20, 0x64, 0xa5, 0x42, 0x09, 0x5c, 0x9c, 0x60, 0x27, 0xf9, - 0x64, 0x16, 0x97, 0x48, 0x30, 0x2b, 0x30, 0x6b, 0x70, 0x1b, 0xa9, 0xeb, 0xe1, 0xf2, 0x98, 0x1e, - 0x8a, 0x2b, 0x9d, 0x24, 0x4f, 0xdc, 0x93, 0x67, 0xf8, 0x74, 0x4f, 0x5e, 0x10, 0x62, 0x09, 0xc2, - 0x6b, 0x4a, 0x41, 0x08, 0x43, 0xad, 0x78, 0x3a, 0x16, 0xc8, 0x33, 0xcc, 0x58, 0x20, 0xcf, 0xf0, - 0x62, 0x81, 0x3c, 0x83, 0x93, 0xfb, 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, - 0xe9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x17, 0xa7, 0x66, 0xea, - 0xc2, 0x5c, 0x00, 0xe6, 0x80, 0x9d, 0xa0, 0x5f, 0xa1, 0x0f, 0x0a, 0xc2, 0x92, 0xca, 0x82, 0xd4, - 0xe2, 0x24, 0x36, 0xb0, 0xbc, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xce, 0xe9, 0x08, 0x1a, 0x95, - 0x01, 0x00, 0x00, -} - -func (m *AddAssetMetadataProposal) 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 *AddAssetMetadataProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddAssetMetadataProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetList) > 0 { - for iNdEx := len(m.AssetList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AssetList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGov(dAtA []byte, offset int, v uint64) int { - offset -= sovGov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AddAssetMetadataProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if len(m.AssetList) > 0 { - for _, e := range m.AssetList { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - return n -} - -func sovGov(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGov(x uint64) (n int) { - return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *AddAssetMetadataProposal) 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 ErrIntOverflowGov - } - 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: AddAssetMetadataProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddAssetMetadataProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetList = append(m.AssetList, AssetMetadata{}) - if err := m.AssetList[len(m.AssetList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGov(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGov - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGov - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGov - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/keys.go b/x/dex/types/keys.go deleted file mode 100644 index c56c1be90..000000000 --- a/x/dex/types/keys.go +++ /dev/null @@ -1,190 +0,0 @@ -package types - -import ( - "encoding/binary" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" -) - -const ( - // ModuleName defines the module name - ModuleName = "dex" - - // StoreKey defines the primary module store key - StoreKey = ModuleName - - // RouterKey is the message route for slashing - RouterKey = ModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - - // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_dex" -) - -func KeyPrefix(p string) []byte { - return []byte(p) -} - -func AddressKeyPrefix(contractAddr string) []byte { - addr, _ := sdk.AccAddressFromBech32(contractAddr) - return address.MustLengthPrefix(addr) -} - -func ContractKeyPrefix(p string, contractAddr string) []byte { - return append([]byte(p), AddressKeyPrefix(contractAddr)...) -} - -func DenomPrefix(denom string) []byte { - length := uint16(len(denom)) - bz := make([]byte, 2) - binary.BigEndian.PutUint16(bz, length) - return append(bz, []byte(denom)...) -} - -func PairPrefix(priceDenom string, assetDenom string) []byte { - return append(DenomPrefix(priceDenom), DenomPrefix(assetDenom)...) -} - -func OrderBookPrefix(long bool, contractAddr string, priceDenom string, assetDenom string) []byte { - return append( - OrderBookContractPrefix(long, contractAddr), - PairPrefix(priceDenom, assetDenom)..., - ) -} - -func OrderBookContractPrefix(long bool, contractAddr string) []byte { - var prefix []byte - if long { - prefix = KeyPrefix(LongBookKey) - } else { - prefix = KeyPrefix(ShortBookKey) - } - return append(prefix, AddressKeyPrefix(contractAddr)...) -} - -// `Price` constant + contract + price denom + asset denom -func PricePrefix(contractAddr string, priceDenom string, assetDenom string) []byte { - return append( - PriceContractPrefix(contractAddr), - PairPrefix(priceDenom, assetDenom)..., - ) -} - -func PriceContractPrefix(contractAddr string) []byte { - return append(KeyPrefix(PriceKey), AddressKeyPrefix(contractAddr)...) -} - -func RegisteredPairPrefix(contractAddr string) []byte { - return append(KeyPrefix(RegisteredPairKey), AddressKeyPrefix(contractAddr)...) -} - -func OrderPrefix(contractAddr string) []byte { - return append(KeyPrefix(OrderKey), AddressKeyPrefix(contractAddr)...) -} - -func AssetListPrefix(assetDenom string) []byte { - return append(KeyPrefix(AssetListKey), DenomPrefix(assetDenom)...) -} - -func NextOrderIDPrefix(contractAddr string) []byte { - return append(KeyPrefix(NextOrderIDKey), AddressKeyPrefix(contractAddr)...) -} - -func MatchResultPrefix(contractAddr string) []byte { - return append(KeyPrefix(MatchResultKey), AddressKeyPrefix(contractAddr)...) -} - -func GetSettlementOrderIDPrefix(orderID uint64, account string) []byte { - accountBytes := append([]byte(account), []byte("|")...) - orderIDBytes := make([]byte, 8) - binary.BigEndian.PutUint64(orderIDBytes, orderID) - return append(accountBytes, orderIDBytes...) -} - -func GetSettlementKey(orderID uint64, account string, settlementID uint64) []byte { - settlementIDBytes := make([]byte, 8) - binary.BigEndian.PutUint64(settlementIDBytes, settlementID) - return append(GetSettlementOrderIDPrefix(orderID, account), settlementIDBytes...) -} - -func MemOrderPrefixForPair(contractAddr string, priceDenom string, assetDenom string) []byte { - return append( - append(KeyPrefix(MemOrderKey), AddressKeyPrefix(contractAddr)...), - PairPrefix(priceDenom, assetDenom)..., - ) -} - -func MemCancelPrefixForPair(contractAddr string, priceDenom string, assetDenom string) []byte { - return append( - append(KeyPrefix(MemCancelKey), AddressKeyPrefix(contractAddr)...), - PairPrefix(priceDenom, assetDenom)..., - ) -} - -func MemOrderPrefix(contractAddr string) []byte { - return append(KeyPrefix(MemOrderKey), AddressKeyPrefix(contractAddr)...) -} - -func MemCancelPrefix(contractAddr string) []byte { - return append(KeyPrefix(MemCancelKey), AddressKeyPrefix(contractAddr)...) -} - -func MemDepositPrefix(contractAddr string) []byte { - return append(KeyPrefix(MemDepositKey), AddressKeyPrefix(contractAddr)...) -} - -func MemDepositSubprefix(creator, denom string) []byte { - return append([]byte(creator), DenomPrefix(denom)...) -} - -func MemContractsToProcessKey(contractAddr string) []byte { - return append(KeyPrefix(MemContractsToProcess), AddressKeyPrefix(contractAddr)...) -} - -func MemDownstreamContractsKey(contractAddr string) []byte { - return append(KeyPrefix(MemDownstreamContracts), AddressKeyPrefix(contractAddr)...) -} - -func ContractKey(contractAddr string) []byte { - return AddressKeyPrefix(contractAddr) -} - -func OrderCountPrefix(contractAddr string, priceDenom string, assetDenom string, long bool) []byte { - var prefix []byte - if long { - prefix = KeyPrefix(LongOrderCountKey) - } else { - prefix = KeyPrefix(ShortOrderCountKey) - } - return append(prefix, append(AddressKeyPrefix(contractAddr), PairPrefix(priceDenom, assetDenom)...)...) -} - -const ( - LongBookKey = "LongBook-value-" - - ShortBookKey = "ShortBook-value-" - - OrderKey = "order" - AccountActiveOrdersKey = "account-active-orders" - CancelKey = "cancel" - - TwapKey = "TWAP-" - PriceKey = "Price-" - SettlementEntryKey = "SettlementEntry-" - NextSettlementIDKey = "NextSettlementID-" - NextOrderIDKey = "noid" - RegisteredPairKey = "rp" - AssetListKey = "AssetList-" - MatchResultKey = "MatchResult-" - LongOrderCountKey = "loc-" - ShortOrderCountKey = "soc-" - - MemOrderKey = "MemOrder-" - MemDepositKey = "MemDeposit-" - MemCancelKey = "MemCancel-" - MemContractsToProcess = "MemContractsToProcess-" - MemDownstreamContracts = "MemDownstreamContracts-" -) diff --git a/x/dex/types/keys_test.go b/x/dex/types/keys_test.go deleted file mode 100644 index a635435ba..000000000 --- a/x/dex/types/keys_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package types_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestOrderPrefix(t *testing.T) { - testContract := "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m" - addr, _ := sdk.AccAddressFromBech32(testContract) - addr = address.MustLengthPrefix(addr) - expected := append([]byte(types.OrderKey), addr...) - require.Equal(t, expected, types.OrderPrefix(testContract)) -} - -func TestPricePrefix(t *testing.T) { - testContract := "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m" - testPriceDenom := "SEI" - testAssetDenom := "ATOM" - address := types.AddressKeyPrefix(testContract) - priceContractBytes := append([]byte(types.PriceKey), address...) - pairBytes := types.PairPrefix(testPriceDenom, testAssetDenom) - expectedKey := append(priceContractBytes, pairBytes...) - require.Equal(t, expectedKey, types.PricePrefix(testContract, testPriceDenom, testAssetDenom)) -} diff --git a/x/dex/types/long_book.pb.go b/x/dex/types/long_book.pb.go deleted file mode 100644 index 2f5167c99..000000000 --- a/x/dex/types/long_book.pb.go +++ /dev/null @@ -1,380 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/long_book.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type LongBook struct { - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price" yaml:"price"` - Entry *OrderEntry `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry"` -} - -func (m *LongBook) Reset() { *m = LongBook{} } -func (m *LongBook) String() string { return proto.CompactTextString(m) } -func (*LongBook) ProtoMessage() {} -func (*LongBook) Descriptor() ([]byte, []int) { - return fileDescriptor_daa9d9e2359557c9, []int{0} -} -func (m *LongBook) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LongBook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LongBook.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 *LongBook) XXX_Merge(src proto.Message) { - xxx_messageInfo_LongBook.Merge(m, src) -} -func (m *LongBook) XXX_Size() int { - return m.Size() -} -func (m *LongBook) XXX_DiscardUnknown() { - xxx_messageInfo_LongBook.DiscardUnknown(m) -} - -var xxx_messageInfo_LongBook proto.InternalMessageInfo - -func (m *LongBook) GetEntry() *OrderEntry { - if m != nil { - return m.Entry - } - return nil -} - -func init() { - proto.RegisterType((*LongBook)(nil), "seiprotocol.seichain.dex.LongBook") -} - -func init() { proto.RegisterFile("dex/long_book.proto", fileDescriptor_daa9d9e2359557c9) } - -var fileDescriptor_daa9d9e2359557c9 = []byte{ - // 278 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00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f4, 0x70, - 0x79, 0x41, 0xcf, 0x1f, 0xe4, 0x7a, 0x57, 0x90, 0x5a, 0x27, 0x4e, 0x90, 0xb1, 0x60, 0x6d, 0x41, - 0x10, 0xca, 0xc9, 0xfd, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, - 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x74, 0x91, - 0x1c, 0x5a, 0x9c, 0x9a, 0xa9, 0x0b, 0x33, 0x1c, 0xcc, 0x01, 0x9b, 0xae, 0x5f, 0xa1, 0x0f, 0x0a, - 0x1d, 0xb0, 0x9b, 0x93, 0xd8, 0xc0, 0xf2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xf1, - 0xb1, 0x25, 0x60, 0x01, 0x00, 0x00, -} - -func (m *LongBook) 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 *LongBook) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LongBook) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Entry != nil { - { - size, err := m.Entry.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLongBook(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintLongBook(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintLongBook(dAtA []byte, offset int, v uint64) int { - offset -= sovLongBook(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *LongBook) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Price.Size() - n += 1 + l + sovLongBook(uint64(l)) - if m.Entry != nil { - l = m.Entry.Size() - n += 1 + l + sovLongBook(uint64(l)) - } - return n -} - -func sovLongBook(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozLongBook(x uint64) (n int) { - return sovLongBook(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *LongBook) 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 ErrIntOverflowLongBook - } - 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: LongBook: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LongBook: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLongBook - } - 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 ErrInvalidLengthLongBook - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLongBook - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLongBook - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLongBook - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLongBook - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Entry == nil { - m.Entry = &OrderEntry{} - } - if err := m.Entry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLongBook(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLongBook - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipLongBook(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLongBook - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLongBook - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLongBook - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthLongBook - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupLongBook - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthLongBook - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthLongBook = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLongBook = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupLongBook = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/match_result.go b/x/dex/types/match_result.go deleted file mode 100644 index d77c3767d..000000000 --- a/x/dex/types/match_result.go +++ /dev/null @@ -1,28 +0,0 @@ -package types - -import ( - "sort" -) - -func NewMatchResult( - orders []*Order, - cancellations []*Cancellation, - settlements []*SettlementEntry, -) *MatchResult { - // Note that we use string comparator since it is more robust. E.g. in the case that 2 orders match - // on the same orderId, we will then sort on the next field - sort.SliceStable(orders, func(i, j int) bool { - return orders[i].String() < orders[j].String() - }) - sort.SliceStable(cancellations, func(i, j int) bool { - return cancellations[i].String() < cancellations[j].String() - }) - sort.SliceStable(settlements, func(i, j int) bool { - return settlements[i].String() < settlements[j].String() - }) - return &MatchResult{ - Orders: orders, - Cancellations: cancellations, - Settlements: settlements, - } -} diff --git a/x/dex/types/match_result.pb.go b/x/dex/types/match_result.pb.go deleted file mode 100644 index 82966f289..000000000 --- a/x/dex/types/match_result.pb.go +++ /dev/null @@ -1,548 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/match_result.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MatchResult struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contract_address"` - Orders []*Order `protobuf:"bytes,3,rep,name=orders,proto3" json:"orders"` - Settlements []*SettlementEntry `protobuf:"bytes,4,rep,name=settlements,proto3" json:"settlements"` - Cancellations []*Cancellation `protobuf:"bytes,5,rep,name=cancellations,proto3" json:"cancellations"` -} - -func (m *MatchResult) Reset() { *m = MatchResult{} } -func (m *MatchResult) String() string { return proto.CompactTextString(m) } -func (*MatchResult) ProtoMessage() {} -func (*MatchResult) Descriptor() ([]byte, []int) { - return fileDescriptor_9225b122096d4ce7, []int{0} -} -func (m *MatchResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MatchResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MatchResult.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 *MatchResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_MatchResult.Merge(m, src) -} -func (m *MatchResult) XXX_Size() int { - return m.Size() -} -func (m *MatchResult) XXX_DiscardUnknown() { - xxx_messageInfo_MatchResult.DiscardUnknown(m) -} - -var xxx_messageInfo_MatchResult proto.InternalMessageInfo - -func (m *MatchResult) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *MatchResult) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *MatchResult) GetOrders() []*Order { - if m != nil { - return m.Orders - } - return nil -} - -func (m *MatchResult) GetSettlements() []*SettlementEntry { - if m != nil { - return m.Settlements - } - return nil -} - -func (m *MatchResult) GetCancellations() []*Cancellation { - if m != nil { - return m.Cancellations - } - return nil -} - -func init() { - proto.RegisterType((*MatchResult)(nil), "seiprotocol.seichain.dex.MatchResult") -} - -func init() { proto.RegisterFile("dex/match_result.proto", fileDescriptor_9225b122096d4ce7) } - -var fileDescriptor_9225b122096d4ce7 = []byte{ - // 345 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x6a, 0xfa, 0x40, - 0x10, 0xc6, 0x8d, 0xfe, 0xff, 0x42, 0xd7, 0x16, 0xdb, 0x20, 0x25, 0x78, 0x48, 0xc4, 0x43, 0xb1, - 0x07, 0x13, 0x68, 0x2f, 0xbd, 0x36, 0x52, 0x7a, 0x2a, 0x85, 0xf4, 0x56, 0x0a, 0x12, 0x77, 0x87, - 0x64, 0x21, 0x66, 0x65, 0x77, 0x04, 0x7d, 0x8b, 0x3e, 0x56, 0x8f, 0x1e, 0x7b, 0x0a, 0x45, 0x6f, - 0xb9, 0xf4, 0x15, 0xca, 0x6e, 0xb4, 0xd5, 0x83, 0xa7, 0x99, 0xf9, 0xf2, 0xcd, 0xef, 0xcb, 0xb0, - 0xe4, 0x92, 0xc1, 0x22, 0x98, 0xc6, 0x48, 0xd3, 0xb1, 0x04, 0x35, 0xcf, 0xd0, 0x9f, 0x49, 0x81, - 0xc2, 0x76, 0x14, 0x70, 0xd3, 0x51, 0x91, 0xf9, 0x0a, 0x38, 0x4d, 0x63, 0x9e, 0xfb, 0x0c, 0x16, - 0xdd, 0xb6, 0xde, 0x10, 0x92, 0x81, 0xac, 0xac, 0xdd, 0x8e, 0x16, 0x14, 0x20, 0x66, 0x30, 0x85, - 0x1c, 0x77, 0x6a, 0x22, 0x12, 0x61, 0xda, 0x40, 0x77, 0x95, 0xda, 0xff, 0xae, 0x93, 0xd6, 0x93, - 0x4e, 0x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3, 0x7c, 0xbf, 0xfd, 0x09, 0x00, 0x00, 0xff, - 0xff, 0x40, 0xd8, 0xfe, 0x79, 0x32, 0x02, 0x00, 0x00, -} - -func (m *MatchResult) 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 *MatchResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MatchResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Cancellations) > 0 { - for iNdEx := len(m.Cancellations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Cancellations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMatchResult(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Settlements) > 0 { - for iNdEx := len(m.Settlements) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Settlements[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMatchResult(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Orders) > 0 { - for iNdEx := len(m.Orders) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Orders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMatchResult(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintMatchResult(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if m.Height != 0 { - i = encodeVarintMatchResult(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintMatchResult(dAtA []byte, offset int, v uint64) int { - offset -= sovMatchResult(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MatchResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovMatchResult(uint64(m.Height)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovMatchResult(uint64(l)) - } - if len(m.Orders) > 0 { - for _, e := range m.Orders { - l = e.Size() - n += 1 + l + sovMatchResult(uint64(l)) - } - } - if len(m.Settlements) > 0 { - for _, e := range m.Settlements { - l = e.Size() - n += 1 + l + sovMatchResult(uint64(l)) - } - } - if len(m.Cancellations) > 0 { - for _, e := range m.Cancellations { - l = e.Size() - n += 1 + l + sovMatchResult(uint64(l)) - } - } - return n -} - -func sovMatchResult(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMatchResult(x uint64) (n int) { - return sovMatchResult(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MatchResult) 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 ErrIntOverflowMatchResult - } - 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: MatchResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MatchResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMatchResult - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMatchResult - } - 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 ErrInvalidLengthMatchResult - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMatchResult - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Orders", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMatchResult - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMatchResult - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMatchResult - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Orders = append(m.Orders, &Order{}) - if err := m.Orders[len(m.Orders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Settlements", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMatchResult - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMatchResult - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMatchResult - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Settlements = append(m.Settlements, &SettlementEntry{}) - if err := m.Settlements[len(m.Settlements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cancellations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMatchResult - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMatchResult - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMatchResult - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cancellations = append(m.Cancellations, &Cancellation{}) - if err := m.Cancellations[len(m.Cancellations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMatchResult(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMatchResult - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMatchResult(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMatchResult - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMatchResult - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMatchResult - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthMatchResult - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMatchResult - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMatchResult - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMatchResult = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMatchResult = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMatchResult = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/match_result_test.go b/x/dex/types/match_result_test.go deleted file mode 100644 index 79da33ec3..000000000 --- a/x/dex/types/match_result_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestMatchResultSorted(t *testing.T) { - // Test stable sorting - order1 := &types.Order{ - Id: 1, - } - order2 := &types.Order{ - Id: 1, - } - order3 := &types.Order{ - Id: 2, - } - - // Test sort on different field - cancellation1 := &types.Cancellation{ - Id: 1, - AssetDenom: "a", - } - cancellation2 := &types.Cancellation{ - Id: 1, - AssetDenom: "b", - } - - // Test sort on string - settlement1 := &types.SettlementEntry{ - Account: "a", - } - settlement2 := &types.SettlementEntry{ - Account: "b", - } - - orders := []*types.Order{order3, order1, order2} - cancellations := []*types.Cancellation{cancellation2, cancellation1} - settlements := []*types.SettlementEntry{settlement2, settlement1} - - matchResult := types.NewMatchResult(orders, cancellations, settlements) - expectedOrders := []*types.Order{order1, order2, order3} - expectedCancellations := []*types.Cancellation{cancellation1, cancellation2} - expectedSettlements := []*types.SettlementEntry{settlement1, settlement2} - require.Equal(t, expectedOrders, matchResult.Orders) - // Check actual elements, since slice match above don't seem to capture if the orders point to different objects - require.True(t, order1 == matchResult.Orders[0]) - require.True(t, order2 == matchResult.Orders[1]) - require.Equal(t, expectedCancellations, matchResult.Cancellations) - require.Equal(t, expectedSettlements, matchResult.Settlements) -} diff --git a/x/dex/types/message_cancel_orders.go b/x/dex/types/message_cancel_orders.go deleted file mode 100644 index e211e6b2c..000000000 --- a/x/dex/types/message_cancel_orders.go +++ /dev/null @@ -1,72 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgCancelOrders = "cancel_orders" - -var _ sdk.Msg = &MsgCancelOrders{} - -func NewMsgCancelOrders( - creator string, - cancellations []*Cancellation, - contractAddr string, -) *MsgCancelOrders { - return &MsgCancelOrders{ - Creator: creator, - Cancellations: cancellations, - ContractAddr: contractAddr, - } -} - -func (msg *MsgCancelOrders) Route() string { - return RouterKey -} - -func (msg *MsgCancelOrders) Type() string { - return TypeMsgCancelOrders -} - -func (msg *MsgCancelOrders) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgCancelOrders) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgCancelOrders) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - _, err = sdk.AccAddressFromBech32(msg.ContractAddr) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract address (%s)", err) - } - - for _, cancellation := range msg.Cancellations { - if cancellation.Price.IsNil() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cancellation price (%s)", err) - } - if cancellation.Price.IsNegative() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cancellation price (cannot be negative) (%s)", err) - } - if len(cancellation.AssetDenom) == 0 || sdk.ValidateDenom(cancellation.AssetDenom) != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cancellation, asset denom is empty or invalid (%s)", err) - } - if len(cancellation.PriceDenom) == 0 || sdk.ValidateDenom(cancellation.PriceDenom) != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid cancellation, price denom is empty or invalid (%s)", err) - } - } - - return nil -} diff --git a/x/dex/types/message_cancel_orders_test.go b/x/dex/types/message_cancel_orders_test.go deleted file mode 100644 index 1dff4ec30..000000000 --- a/x/dex/types/message_cancel_orders_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package types_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestValidateMsgCancelOrder(t *testing.T) { - msg := &types.MsgCancelOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", - Cancellations: []*types.Cancellation{{ - Price: sdk.OneDec().Neg(), - AssetDenom: "denom1", - PriceDenom: "denom2", - }}, - } - require.Error(t, msg.ValidateBasic()) - msg = &types.MsgCancelOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", - Cancellations: []*types.Cancellation{{ - Price: sdk.OneDec(), - AssetDenom: "invalid denom", - PriceDenom: "denom2", - }}, - } - require.Error(t, msg.ValidateBasic()) - msg = &types.MsgCancelOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc", - Cancellations: []*types.Cancellation{{ - Price: sdk.OneDec(), - AssetDenom: "denom1", - PriceDenom: "invalid denom", - }}, - } - require.Error(t, msg.ValidateBasic()) -} diff --git a/x/dex/types/message_contract_deposit_rent.go b/x/dex/types/message_contract_deposit_rent.go deleted file mode 100644 index 7b94c93bf..000000000 --- a/x/dex/types/message_contract_deposit_rent.go +++ /dev/null @@ -1,56 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgContractDepositRent = "contract_deposit_rent" - -var _ sdk.Msg = &MsgContractDepositRent{} - -func NewMsgContractDepositRent( - contractAddr string, - amount uint64, - sender string, -) *MsgContractDepositRent { - return &MsgContractDepositRent{ - Sender: sender, - ContractAddr: contractAddr, - Amount: amount, - } -} - -func (msg *MsgContractDepositRent) Route() string { - return RouterKey -} - -func (msg *MsgContractDepositRent) Type() string { - return TypeMsgContractDepositRent -} - -func (msg *MsgContractDepositRent) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgContractDepositRent) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgContractDepositRent) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - _, err = sdk.AccAddressFromBech32(msg.ContractAddr) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract address (%s)", err) - } - return nil -} diff --git a/x/dex/types/message_place_orders.go b/x/dex/types/message_place_orders.go deleted file mode 100644 index 839dad45a..000000000 --- a/x/dex/types/message_place_orders.go +++ /dev/null @@ -1,85 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgPlaceOrders = "place_orders" - -var _ sdk.Msg = &MsgPlaceOrders{} - -func NewMsgPlaceOrders( - creator string, - orders []*Order, - contractAddr string, - fund sdk.Coins, -) *MsgPlaceOrders { - return &MsgPlaceOrders{ - Creator: creator, - Orders: orders, - ContractAddr: contractAddr, - Funds: fund, - } -} - -func (msg *MsgPlaceOrders) Route() string { - return RouterKey -} - -func (msg *MsgPlaceOrders) Type() string { - return TypeMsgPlaceOrders -} - -func (msg *MsgPlaceOrders) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgPlaceOrders) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -// perform statelss check on basic property of msg like sig verification -func (msg *MsgPlaceOrders) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - _, err = sdk.AccAddressFromBech32(msg.ContractAddr) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract address (%s)", err) - } - - if len(msg.Orders) == 0 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "at least one order needs to be placed (%s)", err) - } - - for _, order := range msg.Orders { - if order.Quantity.IsNil() || order.Quantity.IsNegative() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid order quantity (%s)", err) - } - if order.Price.IsNil() || order.Price.IsNegative() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid order price (%s)", err) - } - if len(order.AssetDenom) == 0 || sdk.ValidateDenom(order.AssetDenom) != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid order, asset denom is empty or invalid (%s)", err) - } - if len(order.PriceDenom) == 0 || sdk.ValidateDenom(order.PriceDenom) != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid order, price denom is empty or invalid (%s)", err) - } - if order.OrderType == OrderType_FOKMARKETBYVALUE || order.OrderType == OrderType_FOKMARKET { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "FOK orders are temporarily disabled") - } - if order.OrderType == OrderType_STOPLIMIT || order.OrderType == OrderType_STOPLOSS { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "stop loss/limit order (%s) are not supported yet", err) - } - } - - return nil -} diff --git a/x/dex/types/message_place_orders_test.go b/x/dex/types/message_place_orders_test.go deleted file mode 100644 index 470de9cd1..000000000 --- a/x/dex/types/message_place_orders_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package types_test - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "testing" - - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestValidateMsgPlaceOrder(t *testing.T) { - TEST_CONTRACT := "sei1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqladqwc" - msg := &types.MsgPlaceOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: TEST_CONTRACT, - Orders: []*types.Order{ - { - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - Quantity: sdk.OneDec(), - Price: sdk.OneDec(), - AssetDenom: "denom1", - PriceDenom: "denom2", - }, - }, - } - require.NoError(t, msg.ValidateBasic()) - - // Empty orders - msg = &types.MsgPlaceOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: TEST_CONTRACT, - Orders: []*types.Order{}, - } - require.Error(t, msg.ValidateBasic()) - - // Test various invalid orders field - msg = &types.MsgPlaceOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: TEST_CONTRACT, - Orders: []*types.Order{ - { - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - Quantity: sdk.OneDec().Neg(), - Price: sdk.OneDec(), - AssetDenom: "denom1", - PriceDenom: "denom2", - }, - }, - } - require.Error(t, msg.ValidateBasic()) - msg = &types.MsgPlaceOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: TEST_CONTRACT, - Orders: []*types.Order{ - { - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - Quantity: sdk.OneDec(), - AssetDenom: "denom1", - PriceDenom: "denom2", - }, - }, - } - require.Error(t, msg.ValidateBasic()) - msg = &types.MsgPlaceOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: TEST_CONTRACT, - Orders: []*types.Order{ - { - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - Quantity: sdk.OneDec(), - Price: sdk.OneDec(), - AssetDenom: "invalid denom", - PriceDenom: "denom2", - }, - }, - } - require.Error(t, msg.ValidateBasic()) - msg = &types.MsgPlaceOrders{ - Creator: "sei1yezq49upxhunjjhudql2fnj5dgvcwjj87pn2wx", - ContractAddr: TEST_CONTRACT, - Orders: []*types.Order{ - { - Id: 1, - Account: "test", - ContractAddr: TEST_CONTRACT, - Quantity: sdk.OneDec().Neg(), - Price: sdk.OneDec(), - AssetDenom: "denom1", - PriceDenom: "invalid denom", - }, - }, - } - require.Error(t, msg.ValidateBasic()) -} diff --git a/x/dex/types/message_register_contract.go b/x/dex/types/message_register_contract.go deleted file mode 100644 index 2ac7240ea..000000000 --- a/x/dex/types/message_register_contract.go +++ /dev/null @@ -1,75 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgRegisterContract = "register_contract" - -var _ sdk.Msg = &MsgRegisterContract{} - -func NewMsgRegisterContract( - creator string, - codeID uint64, - contractAddr string, - needOrderMatching bool, - dependencies []*ContractDependencyInfo, - deposit uint64, -) *MsgRegisterContract { - return &MsgRegisterContract{ - Creator: creator, - Contract: &ContractInfoV2{ - CodeId: codeID, - ContractAddr: contractAddr, - NeedOrderMatching: needOrderMatching, - Dependencies: dependencies, - Creator: creator, - RentBalance: deposit, - }, - } -} - -func (msg *MsgRegisterContract) Route() string { - return RouterKey -} - -func (msg *MsgRegisterContract) Type() string { - return TypeMsgRegisterContract -} - -func (msg *MsgRegisterContract) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgRegisterContract) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgRegisterContract) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - _, err = sdk.AccAddressFromBech32(msg.Contract.ContractAddr) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract address (%s)", err) - } - - for _, dependency := range msg.Contract.Dependencies { - contractAddress := dependency.Dependency - - _, err = sdk.AccAddressFromBech32(contractAddress) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid dependency contract address (%s)", err) - } - } - - return nil -} diff --git a/x/dex/types/message_register_pairs.go b/x/dex/types/message_register_pairs.go deleted file mode 100644 index 47fb42af1..000000000 --- a/x/dex/types/message_register_pairs.go +++ /dev/null @@ -1,83 +0,0 @@ -package types - -import ( - "errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgRegisterPairs = "register_pairs" - -var _ sdk.Msg = &MsgRegisterPairs{} - -func NewMsgRegisterPairs( - creator string, - contractPairs []BatchContractPair, -) *MsgRegisterPairs { - return &MsgRegisterPairs{ - Creator: creator, - Batchcontractpair: contractPairs, - } -} - -func (msg *MsgRegisterPairs) Route() string { - return RouterKey -} - -func (msg *MsgRegisterPairs) Type() string { - return TypeMsgRegisterPairs -} - -func (msg *MsgRegisterPairs) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgRegisterPairs) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgRegisterPairs) ValidateBasic() error { - if msg.Creator == "" { - return errors.New("creator address is empty") - } - - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - if len(msg.Batchcontractpair) == 0 { - return errors.New("no data provided in register pairs transaction") - } - - for _, batchContractPair := range msg.Batchcontractpair { - contractAddress := batchContractPair.ContractAddr - - if contractAddress == "" { - return errors.New("contract address is empty") - } - - _, err = sdk.AccAddressFromBech32(contractAddress) - if err != nil { - return errors.New("contract address format is not bech32") - } - - if len(batchContractPair.Pairs) == 0 { - return errors.New("no pairs provided in register pairs transaction") - } - - for _, pair := range batchContractPair.Pairs { - if pair == nil { - return errors.New("empty pair info") - } - } - } - - return nil -} diff --git a/x/dex/types/message_unregister_contract.go b/x/dex/types/message_unregister_contract.go deleted file mode 100644 index 667805c66..000000000 --- a/x/dex/types/message_unregister_contract.go +++ /dev/null @@ -1,55 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgUnregisterContract = "unregister_contract" - -var _ sdk.Msg = &MsgUnregisterContract{} - -func NewMsgUnregisterContract( - creator string, - contractAddr string, -) *MsgUnregisterContract { - return &MsgUnregisterContract{ - Creator: creator, - ContractAddr: contractAddr, - } -} - -func (msg *MsgUnregisterContract) Route() string { - return RouterKey -} - -func (msg *MsgUnregisterContract) Type() string { - return TypeMsgUnregisterContract -} - -func (msg *MsgUnregisterContract) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgUnregisterContract) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgUnregisterContract) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - _, err = sdk.AccAddressFromBech32(msg.ContractAddr) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract address (%s)", err) - } - - return nil -} diff --git a/x/dex/types/message_unsuspend_contract.go b/x/dex/types/message_unsuspend_contract.go deleted file mode 100644 index 75581625e..000000000 --- a/x/dex/types/message_unsuspend_contract.go +++ /dev/null @@ -1,55 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgUnsuspendContract = "unsuspend_contract" - -var _ sdk.Msg = &MsgUnsuspendContract{} - -func NewMsgUnsuspendContract( - creator string, - contractAddr string, -) *MsgUnsuspendContract { - return &MsgUnsuspendContract{ - Creator: creator, - ContractAddr: contractAddr, - } -} - -func (msg *MsgUnsuspendContract) Route() string { - return RouterKey -} - -func (msg *MsgUnsuspendContract) Type() string { - return TypeMsgUnsuspendContract -} - -func (msg *MsgUnsuspendContract) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgUnsuspendContract) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgUnsuspendContract) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - _, err = sdk.AccAddressFromBech32(msg.ContractAddr) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract address (%s)", err) - } - - return nil -} diff --git a/x/dex/types/message_update_price_tick_size.go b/x/dex/types/message_update_price_tick_size.go deleted file mode 100644 index 1594bcffb..000000000 --- a/x/dex/types/message_update_price_tick_size.go +++ /dev/null @@ -1,69 +0,0 @@ -package types - -import ( - "errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgUpdatePriceTickSize = "update_price_tick_size" - -var _ sdk.Msg = &MsgUpdatePriceTickSize{} - -func NewMsgUpdatePriceTickSize( - creator string, - tickSizeList []TickSize, -) *MsgUpdatePriceTickSize { - return &MsgUpdatePriceTickSize{ - Creator: creator, - TickSizeList: tickSizeList, - } -} - -func (msg *MsgUpdatePriceTickSize) Route() string { - return RouterKey -} - -func (msg *MsgUpdatePriceTickSize) Type() string { - return TypeMsgUpdatePriceTickSize -} - -func (msg *MsgUpdatePriceTickSize) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgUpdatePriceTickSize) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgUpdatePriceTickSize) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - if len(msg.TickSizeList) == 0 { - return errors.New("no data provided in update price tick size transaction") - } - - for _, tickSize := range msg.TickSizeList { - contractAddress := tickSize.ContractAddr - - _, err = sdk.AccAddressFromBech32(contractAddress) - if err != nil { - return errors.New("contract address format is not bech32") - } - - if tickSize.Pair == nil { - return errors.New("empty pair info") - } - } - - return nil -} diff --git a/x/dex/types/message_update_quantity_tick_size.go b/x/dex/types/message_update_quantity_tick_size.go deleted file mode 100644 index 7beafec5d..000000000 --- a/x/dex/types/message_update_quantity_tick_size.go +++ /dev/null @@ -1,69 +0,0 @@ -package types - -import ( - "errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgUpdateQuantityTickSize = "update_quantity_tick_size" - -var _ sdk.Msg = &MsgUpdateQuantityTickSize{} - -func NewMsgUpdateQuantityTickSize( - creator string, - tickSizeList []TickSize, -) *MsgUpdateQuantityTickSize { - return &MsgUpdateQuantityTickSize{ - Creator: creator, - TickSizeList: tickSizeList, - } -} - -func (msg *MsgUpdateQuantityTickSize) Route() string { - return RouterKey -} - -func (msg *MsgUpdateQuantityTickSize) Type() string { - return TypeMsgUpdateQuantityTickSize -} - -func (msg *MsgUpdateQuantityTickSize) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgUpdateQuantityTickSize) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgUpdateQuantityTickSize) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - - if len(msg.TickSizeList) == 0 { - return errors.New("no data provided in update quantity tick size transaction") - } - - for _, tickSize := range msg.TickSizeList { - contractAddress := tickSize.ContractAddr - - _, err = sdk.AccAddressFromBech32(contractAddress) - if err != nil { - return errors.New("contract address format is not bech32") - } - - if tickSize.Pair == nil { - return errors.New("empty pair info") - } - } - - return nil -} diff --git a/x/dex/types/order.pb.go b/x/dex/types/order.pb.go deleted file mode 100644 index 69c89707d..000000000 --- a/x/dex/types/order.pb.go +++ /dev/null @@ -1,1680 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/order.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Order struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` - Status OrderStatus `protobuf:"varint,2,opt,name=status,proto3,enum=seiprotocol.seichain.dex.OrderStatus" json:"status"` - Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account"` - ContractAddr string `protobuf:"bytes,4,opt,name=contractAddr,proto3" json:"contract_address"` - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price" yaml:"price"` - Quantity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=quantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quantity" yaml:"quantity"` - PriceDenom string `protobuf:"bytes,7,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,8,opt,name=assetDenom,proto3" json:"asset_denom"` - OrderType OrderType `protobuf:"varint,9,opt,name=orderType,proto3,enum=seiprotocol.seichain.dex.OrderType" json:"order_type"` - PositionDirection PositionDirection `protobuf:"varint,10,opt,name=positionDirection,proto3,enum=seiprotocol.seichain.dex.PositionDirection" json:"position_direction"` - Data string `protobuf:"bytes,11,opt,name=data,proto3" json:"data"` - StatusDescription string `protobuf:"bytes,12,opt,name=statusDescription,proto3" json:"status_description"` - Nominal github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=nominal,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"nominal" yaml:"nominal"` - TriggerPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,14,opt,name=triggerPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"trigger_price" yaml:"trigger_price"` - TriggerStatus bool `protobuf:"varint,15,opt,name=triggerStatus,proto3" json:"trigger_status"` -} - -func (m *Order) Reset() { *m = Order{} } -func (m *Order) String() string { return proto.CompactTextString(m) } -func (*Order) ProtoMessage() {} -func (*Order) Descriptor() ([]byte, []int) { - return fileDescriptor_c2d5fab85368797d, []int{0} -} -func (m *Order) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Order.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 *Order) XXX_Merge(src proto.Message) { - xxx_messageInfo_Order.Merge(m, src) -} -func (m *Order) XXX_Size() int { - return m.Size() -} -func (m *Order) XXX_DiscardUnknown() { - xxx_messageInfo_Order.DiscardUnknown(m) -} - -var xxx_messageInfo_Order proto.InternalMessageInfo - -func (m *Order) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Order) GetStatus() OrderStatus { - if m != nil { - return m.Status - } - return OrderStatus_PLACED -} - -func (m *Order) GetAccount() string { - if m != nil { - return m.Account - } - return "" -} - -func (m *Order) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *Order) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *Order) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *Order) GetOrderType() OrderType { - if m != nil { - return m.OrderType - } - return OrderType_LIMIT -} - -func (m *Order) GetPositionDirection() PositionDirection { - if m != nil { - return m.PositionDirection - } - return PositionDirection_LONG -} - -func (m *Order) GetData() string { - if m != nil { - return m.Data - } - return "" -} - -func (m *Order) GetStatusDescription() string { - if m != nil { - return m.StatusDescription - } - return "" -} - -func (m *Order) GetTriggerStatus() bool { - if m != nil { - return m.TriggerStatus - } - return false -} - -type Cancellation struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` - Initiator CancellationInitiator `protobuf:"varint,2,opt,name=initiator,proto3,enum=seiprotocol.seichain.dex.CancellationInitiator" json:"initiator"` - Creator string `protobuf:"bytes,3,opt,name=creator,proto3" json:"creator"` - ContractAddr string `protobuf:"bytes,4,opt,name=contractAddr,proto3" json:"contract_address"` - PriceDenom string `protobuf:"bytes,5,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,6,opt,name=assetDenom,proto3" json:"asset_denom"` - PositionDirection PositionDirection `protobuf:"varint,7,opt,name=positionDirection,proto3,enum=seiprotocol.seichain.dex.PositionDirection" json:"position_direction"` - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price" yaml:"price"` -} - -func (m *Cancellation) Reset() { *m = Cancellation{} } -func (m *Cancellation) String() string { return proto.CompactTextString(m) } -func (*Cancellation) ProtoMessage() {} -func (*Cancellation) Descriptor() ([]byte, []int) { - return fileDescriptor_c2d5fab85368797d, []int{1} -} -func (m *Cancellation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Cancellation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Cancellation.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 *Cancellation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Cancellation.Merge(m, src) -} -func (m *Cancellation) XXX_Size() int { - return m.Size() -} -func (m *Cancellation) XXX_DiscardUnknown() { - xxx_messageInfo_Cancellation.DiscardUnknown(m) -} - -var xxx_messageInfo_Cancellation proto.InternalMessageInfo - -func (m *Cancellation) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Cancellation) GetInitiator() CancellationInitiator { - if m != nil { - return m.Initiator - } - return CancellationInitiator_USER -} - -func (m *Cancellation) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *Cancellation) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *Cancellation) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *Cancellation) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *Cancellation) GetPositionDirection() PositionDirection { - if m != nil { - return m.PositionDirection - } - return PositionDirection_LONG -} - -type ActiveOrders struct { - Ids []uint64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids"` -} - -func (m *ActiveOrders) Reset() { *m = ActiveOrders{} } -func (m *ActiveOrders) String() string { return proto.CompactTextString(m) } -func (*ActiveOrders) ProtoMessage() {} -func (*ActiveOrders) Descriptor() ([]byte, []int) { - return fileDescriptor_c2d5fab85368797d, []int{2} -} -func (m *ActiveOrders) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActiveOrders) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActiveOrders.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 *ActiveOrders) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActiveOrders.Merge(m, src) -} -func (m *ActiveOrders) XXX_Size() int { - return m.Size() -} -func (m *ActiveOrders) XXX_DiscardUnknown() { - xxx_messageInfo_ActiveOrders.DiscardUnknown(m) -} - -var xxx_messageInfo_ActiveOrders proto.InternalMessageInfo - -func (m *ActiveOrders) GetIds() []uint64 { - if m != nil { - return m.Ids - } - return nil -} - -func init() { - proto.RegisterType((*Order)(nil), "seiprotocol.seichain.dex.Order") - proto.RegisterType((*Cancellation)(nil), "seiprotocol.seichain.dex.Cancellation") - proto.RegisterType((*ActiveOrders)(nil), "seiprotocol.seichain.dex.ActiveOrders") -} - -func init() { proto.RegisterFile("dex/order.proto", fileDescriptor_c2d5fab85368797d) } - -var fileDescriptor_c2d5fab85368797d = []byte{ - // 737 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6a, 0xdb, 0x4c, - 0x14, 0xb5, 0x1c, 0xff, 0x4e, 0x1c, 0xfb, 0xcb, 0x10, 0x82, 0xbe, 0x50, 0x2c, 0xa3, 0xd2, 0xe2, - 0x50, 0x62, 0x41, 0xbb, 0x09, 0xa5, 0x9b, 0xa8, 0x86, 0x50, 0x4a, 0x68, 0x3a, 0x2d, 0x14, 0x4a, - 0x8b, 0x51, 0x34, 0x83, 0x33, 0xd4, 0xd6, 0x38, 0x9a, 0x71, 0x89, 0xe9, 0x4b, 0xf4, 0x05, 0xfa, - 0x3e, 0xd9, 0x35, 0xcb, 0xd2, 0x85, 0x28, 0xc9, 0x4e, 0xcb, 0x3c, 0x41, 0xd1, 0x95, 0x26, 0xb6, - 0xf3, 0x43, 0xea, 0x45, 0x36, 0xd6, 0x9d, 0x73, 0xcf, 0x39, 0x57, 0x9a, 0x99, 0x7b, 0x8d, 0x1a, - 0x94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x42, 0x66, 0x8f, 0x2d, 0x49, 0xbf, 0x38, 0x6a, 0x32, 0x62, 0xb2, - 0xd3, 0x65, 0x7e, 0x1c, 0x59, 0xa9, 0xfc, 0x22, 0xb2, 0x6a, 0x13, 0x6f, 0x38, 0x78, 0x6e, 0xc3, - 0xd2, 0x26, 0x29, 0x8c, 0x39, 0xaa, 0x1c, 0x8d, 0xbd, 0x40, 0x71, 0x35, 0x31, 0x4b, 0x50, 0x61, - 0x6f, 0xe1, 0x0a, 0x97, 0x0e, 0x17, 0x91, 0xd5, 0x48, 0x8b, 0x68, 0xc4, 0x26, 0x97, 0x49, 0xec, - 0x20, 0x04, 0x35, 0xbb, 0x2c, 0x10, 0x43, 0xb3, 0x9c, 0xee, 0x5a, 0x1c, 0x59, 0xcb, 0x80, 0xf6, - 0x68, 0x02, 0x93, 0x19, 0x4a, 0x22, 0xf0, 0xa4, 0x64, 0x2a, 0x15, 0x54, 0xa6, 0x02, 0x40, 0xb5, - 0x60, 0x4a, 0xc1, 0x6f, 0x51, 0x15, 0x6e, 0xd6, 0xfb, 0xc9, 0x88, 0x99, 0x55, 0x38, 0xe6, 0x87, - 0x77, 0x1c, 0x73, 0x42, 0x75, 0xeb, 0x71, 0x64, 0x21, 0x50, 0xf6, 0x92, 0xef, 0x22, 0x53, 0x17, - 0x7c, 0x84, 0x56, 0x47, 0x42, 0x72, 0xc5, 0x45, 0xd0, 0xe5, 0x21, 0xf3, 0x93, 0xc0, 0x44, 0x60, - 0xfd, 0xe4, 0x76, 0xeb, 0xfd, 0xab, 0x12, 0x77, 0x3d, 0x8e, 0x2c, 0xac, 0x9d, 0x7a, 0x54, 0xe3, - 0xe4, 0xba, 0x3b, 0x7e, 0x80, 0x0a, 0xd4, 0x53, 0x9e, 0xb9, 0x0c, 0x1f, 0x5c, 0x89, 0x23, 0x0b, - 0xd6, 0x04, 0x7e, 0x71, 0x17, 0xad, 0xa6, 0x57, 0xb0, 0xcb, 0xa4, 0x1f, 0xf2, 0x11, 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9, 0x8f, 0xa1, 0x69, 0x6f, 0xa2, 0xda, 0x8e, 0xaf, 0xf8, 0x57, 0x06, 0x23, 0x44, - 0xe2, 0xff, 0xd1, 0x12, 0xa7, 0xd2, 0x34, 0x5a, 0x4b, 0xed, 0x82, 0x5b, 0x8e, 0x23, 0x2b, 0x59, - 0x92, 0xe4, 0xc7, 0xdd, 0x3d, 0x39, 0x6b, 0x1a, 0xa7, 0x67, 0x4d, 0xe3, 0xcf, 0x59, 0xd3, 0xf8, - 0x7e, 0xde, 0xcc, 0x9d, 0x9e, 0x37, 0x73, 0xbf, 0xce, 0x9b, 0xb9, 0x8f, 0x5b, 0x33, 0x2f, 0x23, - 0x19, 0xdf, 0xd2, 0xdb, 0x00, 0x0b, 0xd8, 0x07, 0xe7, 0xd8, 0x49, 0xfe, 0xeb, 0xe0, 0xbd, 0x0e, - 0x4a, 0x90, 0x7f, 0xf6, 0x37, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x4e, 0x8b, 0xbe, 0x40, 0x07, 0x00, - 0x00, -} - -func (m *Order) 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 *Order) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TriggerStatus { - i-- - if m.TriggerStatus { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x78 - } - { - size := m.TriggerPrice.Size() - i -= size - if _, err := m.TriggerPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintOrder(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - { - size := m.Nominal.Size() - i -= size - if _, err := m.Nominal.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintOrder(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - if len(m.StatusDescription) > 0 { - i -= len(m.StatusDescription) - copy(dAtA[i:], m.StatusDescription) - i = encodeVarintOrder(dAtA, i, uint64(len(m.StatusDescription))) - i-- - dAtA[i] = 0x62 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintOrder(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x5a - } - if m.PositionDirection != 0 { - i = encodeVarintOrder(dAtA, i, uint64(m.PositionDirection)) - i-- - dAtA[i] = 0x50 - } - if m.OrderType != 0 { - i = encodeVarintOrder(dAtA, i, uint64(m.OrderType)) - i-- - dAtA[i] = 0x48 - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintOrder(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x42 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintOrder(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x3a - } - { - size := m.Quantity.Size() - i -= size - if _, err := m.Quantity.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintOrder(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintOrder(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintOrder(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x22 - } - if len(m.Account) > 0 { - i -= len(m.Account) - copy(dAtA[i:], m.Account) - i = encodeVarintOrder(dAtA, i, uint64(len(m.Account))) - i-- - dAtA[i] = 0x1a - } - if m.Status != 0 { - i = encodeVarintOrder(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintOrder(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Cancellation) 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 *Cancellation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Cancellation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintOrder(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if m.PositionDirection != 0 { - i = encodeVarintOrder(dAtA, i, uint64(m.PositionDirection)) - i-- - dAtA[i] = 0x38 - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintOrder(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x32 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintOrder(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x2a - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintOrder(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x22 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintOrder(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0x1a - } - if m.Initiator != 0 { - i = encodeVarintOrder(dAtA, i, uint64(m.Initiator)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintOrder(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ActiveOrders) 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 *ActiveOrders) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActiveOrders) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Ids) > 0 { - dAtA2 := make([]byte, len(m.Ids)*10) - var j1 int - for _, num := range m.Ids { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintOrder(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintOrder(dAtA []byte, offset int, v uint64) int { - offset -= sovOrder(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Order) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovOrder(uint64(m.Id)) - } - if m.Status != 0 { - n += 1 + sovOrder(uint64(m.Status)) - } - l = len(m.Account) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - l = m.Price.Size() - n += 1 + l + sovOrder(uint64(l)) - l = m.Quantity.Size() - n += 1 + l + sovOrder(uint64(l)) - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - if m.OrderType != 0 { - n += 1 + sovOrder(uint64(m.OrderType)) - } - if m.PositionDirection != 0 { - n += 1 + sovOrder(uint64(m.PositionDirection)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - l = len(m.StatusDescription) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - l = m.Nominal.Size() - n += 1 + l + sovOrder(uint64(l)) - l = m.TriggerPrice.Size() - n += 1 + l + sovOrder(uint64(l)) - if m.TriggerStatus { - n += 2 - } - return n -} - -func (m *Cancellation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovOrder(uint64(m.Id)) - } - if m.Initiator != 0 { - n += 1 + sovOrder(uint64(m.Initiator)) - } - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovOrder(uint64(l)) - } - if m.PositionDirection != 0 { - n += 1 + sovOrder(uint64(m.PositionDirection)) - } - l = m.Price.Size() - n += 1 + l + sovOrder(uint64(l)) - return n -} - -func (m *ActiveOrders) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Ids) > 0 { - l = 0 - for _, e := range m.Ids { - l += sovOrder(uint64(e)) - } - n += 1 + sovOrder(uint64(l)) + l - } - return n -} - -func sovOrder(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozOrder(x uint64) (n int) { - return sovOrder(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Order) 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 ErrIntOverflowOrder - } - 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: Order: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Order: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= OrderStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Account = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) - } - m.OrderType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OrderType |= OrderType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PositionDirection", wireType) - } - m.PositionDirection = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PositionDirection |= PositionDirection(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StatusDescription", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StatusDescription = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nominal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Nominal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TriggerPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TriggerStatus", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TriggerStatus = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipOrder(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthOrder - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Cancellation) 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 ErrIntOverflowOrder - } - 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: Cancellation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Cancellation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Initiator", wireType) - } - m.Initiator = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Initiator |= CancellationInitiator(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PositionDirection", wireType) - } - m.PositionDirection = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PositionDirection |= PositionDirection(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - 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 ErrInvalidLengthOrder - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrder(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthOrder - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActiveOrders) 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 ErrIntOverflowOrder - } - 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: ActiveOrders: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActiveOrders: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ids = append(m.Ids, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthOrder - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthOrder - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Ids) == 0 { - m.Ids = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ids = append(m.Ids, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipOrder(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthOrder - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipOrder(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOrder - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOrder - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOrder - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthOrder - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupOrder - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthOrder - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthOrder = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowOrder = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupOrder = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/order_cancellation.go b/x/dex/types/order_cancellation.go deleted file mode 100644 index 7067b98f6..000000000 --- a/x/dex/types/order_cancellation.go +++ /dev/null @@ -1,9 +0,0 @@ -package types - -type SudoOrderCancellationMsg struct { - OrderCancellations OrderCancellationMsgDetails `json:"bulk_order_cancellations"` -} - -type OrderCancellationMsgDetails struct { - IdsToCancel []uint64 `json:"ids"` -} diff --git a/x/dex/types/order_entry.pb.go b/x/dex/types/order_entry.pb.go deleted file mode 100644 index dafbc63fc..000000000 --- a/x/dex/types/order_entry.pb.go +++ /dev/null @@ -1,790 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/order_entry.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type OrderEntry struct { - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price" yaml:"price"` - Quantity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=quantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quantity" yaml:"quantity"` - Allocations []*Allocation `protobuf:"bytes,3,rep,name=allocations,proto3" json:"allocations"` - PriceDenom string `protobuf:"bytes,4,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,5,opt,name=assetDenom,proto3" json:"asset_denom"` -} - -func (m *OrderEntry) Reset() { *m = OrderEntry{} } -func (m *OrderEntry) String() string { return proto.CompactTextString(m) } -func (*OrderEntry) ProtoMessage() {} -func (*OrderEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_25878922effe12c2, []int{0} -} -func (m *OrderEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *OrderEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OrderEntry.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 *OrderEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderEntry.Merge(m, src) -} -func (m *OrderEntry) XXX_Size() int { - return m.Size() -} -func (m *OrderEntry) XXX_DiscardUnknown() { - xxx_messageInfo_OrderEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_OrderEntry proto.InternalMessageInfo - -func (m *OrderEntry) GetAllocations() []*Allocation { - if m != nil { - return m.Allocations - } - return nil -} - -func (m *OrderEntry) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *OrderEntry) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -type Allocation struct { - OrderId uint64 `protobuf:"varint,1,opt,name=orderId,proto3" json:"order_id"` - Quantity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=quantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quantity" yaml:"quantity"` - Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account"` -} - -func (m *Allocation) Reset() { *m = Allocation{} } -func (m *Allocation) String() string { return proto.CompactTextString(m) } -func (*Allocation) ProtoMessage() {} -func (*Allocation) Descriptor() ([]byte, []int) { - return fileDescriptor_25878922effe12c2, []int{1} -} -func (m *Allocation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Allocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Allocation.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 *Allocation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Allocation.Merge(m, src) -} -func (m *Allocation) XXX_Size() int { - return m.Size() -} -func (m *Allocation) XXX_DiscardUnknown() { - xxx_messageInfo_Allocation.DiscardUnknown(m) -} - -var xxx_messageInfo_Allocation proto.InternalMessageInfo - -func (m *Allocation) GetOrderId() uint64 { - if m != nil { - return m.OrderId - } - return 0 -} - -func (m *Allocation) GetAccount() string { - if m != nil { - return m.Account - } - return "" -} - -func init() { - proto.RegisterType((*OrderEntry)(nil), "seiprotocol.seichain.dex.OrderEntry") - proto.RegisterType((*Allocation)(nil), "seiprotocol.seichain.dex.Allocation") -} - -func init() { proto.RegisterFile("dex/order_entry.proto", fileDescriptor_25878922effe12c2) } - -var fileDescriptor_25878922effe12c2 = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x52, 0xb1, 0x6a, 0xe3, 0x40, - 0x10, 0x95, 0x4e, 0xf6, 0xf9, 0x6e, 0x6d, 0x30, 0x88, 0x3b, 0x10, 0x29, 0x24, 0x23, 0x12, 0xe3, - 0xc6, 0x12, 0x24, 0x5d, 0xba, 0x08, 0x07, 0x93, 0x22, 0x04, 0xd4, 0x04, 0x02, 0xc1, 0xc8, 0xab, - 0xc5, 0x5e, 0x22, 0x69, 0x1d, 0xed, 0x1a, 0xac, 0xbf, 0x48, 0x7e, 0x2a, 0xb8, 0x74, 0x19, 0x52, - 0x88, 0x60, 0x77, 0x2e, 0xfd, 0x05, 0x61, 0x47, 0x91, 0xad, 0x26, 0x45, 0x9a, 0x54, 0x9a, 0x79, - 0x33, 0x6f, 0xde, 0xec, 0x3c, 0xa1, 0xff, 0x21, 0x59, 0xb8, 0x2c, 0x0d, 0x49, 0x3a, 0x22, 0x89, - 0x48, 0x33, 0x67, 0x96, 0x32, 0xc1, 0x74, 0x83, 0x13, 0x0a, 0x11, 0x66, 0x91, 0xc3, 0x09, 0xc5, - 0xd3, 0x80, 0x26, 0x4e, 0x48, 0x16, 0x47, 0xff, 0x26, 0x6c, 0xc2, 0xa0, 0xe4, 0xca, 0xa8, 0xe8, - 0xb7, 0x9f, 0x35, 0x84, 0x6e, 0xe4, 0x94, 0x4b, 0x39, 0x44, 0xbf, 0x47, 0xf5, 0x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0xb3, 0x79, 0x22, 0x0c, 0x0d, 0x94, 0x9a, 0xdb, 0xdc, 0x2a, 0x21, 0xbf, - 0x0c, 0xbc, 0xe1, 0x72, 0x6d, 0xaa, 0xab, 0xb5, 0xa9, 0xbe, 0xaf, 0x4d, 0xf5, 0x69, 0x63, 0x2a, - 0xab, 0x8d, 0xa9, 0xbc, 0x6e, 0x4c, 0xe5, 0xae, 0x5f, 0xd9, 0x88, 0x13, 0xda, 0x2f, 0x3d, 0x81, - 0x04, 0x4c, 0x71, 0x17, 0xae, 0xfc, 0xc3, 0x61, 0xb9, 0xf1, 0x6f, 0xa8, 0x9f, 0x7d, 0x04, 0x00, - 0x00, 0xff, 0xff, 0x59, 0x65, 0xd6, 0x5e, 0xf5, 0x02, 0x00, 0x00, -} - -func (m *OrderEntry) 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 *OrderEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OrderEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintOrderEntry(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x2a - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintOrderEntry(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x22 - } - if len(m.Allocations) > 0 { - for iNdEx := len(m.Allocations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Allocations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOrderEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - { - size := m.Quantity.Size() - i -= size - if _, err := m.Quantity.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintOrderEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintOrderEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Allocation) 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 *Allocation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Allocation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Account) > 0 { - i -= len(m.Account) - copy(dAtA[i:], m.Account) - i = encodeVarintOrderEntry(dAtA, i, uint64(len(m.Account))) - i-- - dAtA[i] = 0x1a - } - { - size := m.Quantity.Size() - i -= size - if _, err := m.Quantity.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintOrderEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.OrderId != 0 { - i = encodeVarintOrderEntry(dAtA, i, uint64(m.OrderId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintOrderEntry(dAtA []byte, offset int, v uint64) int { - offset -= sovOrderEntry(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *OrderEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Price.Size() - n += 1 + l + sovOrderEntry(uint64(l)) - l = m.Quantity.Size() - n += 1 + l + sovOrderEntry(uint64(l)) - if len(m.Allocations) > 0 { - for _, e := range m.Allocations { - l = e.Size() - n += 1 + l + sovOrderEntry(uint64(l)) - } - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovOrderEntry(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovOrderEntry(uint64(l)) - } - return n -} - -func (m *Allocation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.OrderId != 0 { - n += 1 + sovOrderEntry(uint64(m.OrderId)) - } - l = m.Quantity.Size() - n += 1 + l + sovOrderEntry(uint64(l)) - l = len(m.Account) - if l > 0 { - n += 1 + l + sovOrderEntry(uint64(l)) - } - return n -} - -func sovOrderEntry(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozOrderEntry(x uint64) (n int) { - return sovOrderEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *OrderEntry) 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 ErrIntOverflowOrderEntry - } - 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: OrderEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OrderEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrderEntry - } - 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 ErrInvalidLengthOrderEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrderEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrderEntry - } - 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 ErrInvalidLengthOrderEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrderEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allocations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrderEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthOrderEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthOrderEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Allocations = append(m.Allocations, &Allocation{}) - if err := m.Allocations[len(m.Allocations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrderEntry - } - 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 ErrInvalidLengthOrderEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrderEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrderEntry - } - 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 ErrInvalidLengthOrderEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrderEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrderEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthOrderEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Allocation) 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 ErrIntOverflowOrderEntry - } - 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: Allocation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Allocation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderId", wireType) - } - m.OrderId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrderEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OrderId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrderEntry - } - 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 ErrInvalidLengthOrderEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrderEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrderEntry - } - 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 ErrInvalidLengthOrderEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrderEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Account = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrderEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthOrderEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipOrderEntry(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOrderEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOrderEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOrderEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthOrderEntry - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupOrderEntry - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthOrderEntry - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthOrderEntry = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowOrderEntry = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupOrderEntry = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/order_placement.go b/x/dex/types/order_placement.go deleted file mode 100644 index 1104e1e01..000000000 --- a/x/dex/types/order_placement.go +++ /dev/null @@ -1,31 +0,0 @@ -package types - -import ( - "fmt" -) - -type SudoOrderPlacementMsg struct { - OrderPlacements OrderPlacementMsgDetails `json:"bulk_order_placements"` -} - -type OrderPlacementMsgDetails struct { - Orders []Order `json:"orders"` - Deposits []ContractDepositInfo `json:"deposits"` -} - -func (m *SudoOrderPlacementMsg) IsEmpty() bool { - return len(m.OrderPlacements.Deposits) == 0 && len(m.OrderPlacements.Orders) == 0 -} - -type SudoOrderPlacementResponse struct { - UnsuccessfulOrders []UnsuccessfulOrder `json:"unsuccessful_orders"` -} - -type UnsuccessfulOrder struct { - ID uint64 `json:"id"` - Reason string `json:"reason"` -} - -func (r SudoOrderPlacementResponse) String() string { - return fmt.Sprintf("Unsuccessful orders count: %d", len(r.UnsuccessfulOrders)) -} diff --git a/x/dex/types/orders.go b/x/dex/types/orders.go deleted file mode 100644 index 54c0eaf77..000000000 --- a/x/dex/types/orders.go +++ /dev/null @@ -1,244 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/utils" -) - -type OrderBook struct { - Contract ContractAddress - Pair Pair - Longs *CachedSortedOrderBookEntries - Shorts *CachedSortedOrderBookEntries -} - -// entries are always sorted by prices in ascending order, regardless of side -type CachedSortedOrderBookEntries struct { - CachedEntries []OrderBookEntry - currentPtr int - currentChanged bool - - loader func(ctx sdk.Context, startingPriceExclusive sdk.Dec, withLimit bool) []OrderBookEntry - setter func(sdk.Context, OrderBookEntry) - deleter func(sdk.Context, OrderBookEntry) -} - -func NewCachedSortedOrderBookEntries( - loader func(ctx sdk.Context, startingPriceExclusive sdk.Dec, withLimit bool) []OrderBookEntry, - setter func(sdk.Context, OrderBookEntry), - deleter func(sdk.Context, OrderBookEntry), -) *CachedSortedOrderBookEntries { - return &CachedSortedOrderBookEntries{ - CachedEntries: []OrderBookEntry{}, - currentPtr: 0, - currentChanged: false, - loader: loader, - setter: setter, - deleter: deleter, - } -} - -func (c *CachedSortedOrderBookEntries) load(ctx sdk.Context) { - var loaded []OrderBookEntry - if len(c.CachedEntries) == 0 { - loaded = c.loader(ctx, sdk.ZeroDec(), false) - } else { - loaded = c.loader(ctx, c.CachedEntries[len(c.CachedEntries)-1].GetOrderEntry().Price, true) - } - c.CachedEntries = append(c.CachedEntries, loaded...) -} - -// Reduce quantity of the order book entry currently being pointed at by the specified quantity. -// Also remove/reduce allocations of the order book entry in FIFO order. If the order book entry -// does not have enough quantity to settle against, the returned `settled` value will equal to -// the quantity of the order book entry; otherwise it will equal to the specified quantity. -func (c *CachedSortedOrderBookEntries) SettleQuantity(_ sdk.Context, quantity sdk.Dec) (res []ToSettle, settled sdk.Dec) { - if quantity.IsZero() { - return []ToSettle{}, quantity - } - currentEntry := c.CachedEntries[c.currentPtr].GetOrderEntry() - c.currentChanged = true - - if quantity.GTE(currentEntry.Quantity) { - res = utils.Map(currentEntry.Allocations, AllocationToSettle) - settled = currentEntry.Quantity - currentEntry.Quantity = sdk.ZeroDec() - currentEntry.Allocations = []*Allocation{} - return res, settled - } - - settled = sdk.ZeroDec() - newFirstAllocationIdx := 0 - for idx, a := range currentEntry.Allocations { - postSettle := settled.Add(a.Quantity) - if postSettle.LTE(quantity) { - settled = postSettle - res = append(res, AllocationToSettle(a)) - } else { - newFirstAllocationIdx = idx - if settled.Equal(quantity) { - break - } - res = append(res, ToSettle{ - OrderID: a.OrderId, - Account: a.Account, - Amount: quantity.Sub(settled), - }) - a.Quantity = a.Quantity.Sub(quantity.Sub(settled)) - settled = quantity - break - } - } - currentEntry.Quantity = currentEntry.Quantity.Sub(quantity) - currentEntry.Allocations = currentEntry.Allocations[newFirstAllocationIdx:] - return res, settled -} - -// Discard all dirty changes and reload -func (c *CachedSortedOrderBookEntries) Refresh(ctx sdk.Context) { - c.CachedEntries = c.loader(ctx, sdk.ZeroDec(), false) - c.currentPtr = 0 - c.currentChanged = false -} - -func (c *CachedSortedOrderBookEntries) Flush(ctx sdk.Context) { - stop := c.currentPtr - if !c.currentChanged { - stop-- - } - for i := 0; i <= stop; i++ { - if i >= len(c.CachedEntries) { - break - } - entry := c.CachedEntries[i] - if entry.GetOrderEntry().Quantity.IsZero() { - c.deleter(ctx, entry) - } else { - c.setter(ctx, entry) - } - } - c.CachedEntries = c.CachedEntries[c.currentPtr:] - c.currentPtr = 0 - c.currentChanged = false -} - -// Next will only move on to the next order if the current order quantity hits zero. -// So it should not be used for read-only iteration -func (c *CachedSortedOrderBookEntries) Next(ctx sdk.Context) OrderBookEntry { - for c.currentPtr < len(c.CachedEntries) && c.CachedEntries[c.currentPtr].GetOrderEntry().Quantity.IsZero() { - c.currentPtr++ - c.currentChanged = false - } - if c.currentPtr >= len(c.CachedEntries) { - c.load(ctx) - // if nothing is loaded, we've reached the end - if c.currentPtr >= len(c.CachedEntries) { - return nil - } - } - return c.CachedEntries[c.currentPtr] -} - -type OrderBookEntry interface { - GetPrice() sdk.Dec - GetOrderEntry() *OrderEntry - DeepCopy() OrderBookEntry - SetEntry(*OrderEntry) - SetPrice(sdk.Dec) -} - -func (m *LongBook) SetPrice(p sdk.Dec) { - m.Price = p -} - -type PriceStore struct { - Store prefix.Store - PriceKeys [][]byte -} - -func (m *LongBook) GetPrice() sdk.Dec { - return m.Price -} - -func (m *LongBook) GetOrderEntry() *OrderEntry { - return m.Entry -} - -func (m *LongBook) SetEntry(newEntry *OrderEntry) { - m.Entry = newEntry -} - -func (m *LongBook) DeepCopy() OrderBookEntry { - allocations := []*Allocation{} - for _, allo := range m.Entry.Allocations { - allocations = append(allocations, &Allocation{ - OrderId: allo.OrderId, - Quantity: allo.Quantity, - Account: allo.Account, - }) - } - newOrderEntry := OrderEntry{ - Price: m.Entry.Price, - Quantity: m.Entry.Quantity, - PriceDenom: m.Entry.PriceDenom, - AssetDenom: m.Entry.AssetDenom, - Allocations: allocations, - } - return &LongBook{ - Price: m.Price, - Entry: &newOrderEntry, - } -} - -func (m *ShortBook) SetPrice(p sdk.Dec) { - m.Price = p -} - -func (m *ShortBook) GetPrice() sdk.Dec { - return m.Price -} - -func (m *ShortBook) GetOrderEntry() *OrderEntry { - return m.Entry -} - -func (m *ShortBook) SetEntry(newEntry *OrderEntry) { - m.Entry = newEntry -} - -func (m *ShortBook) DeepCopy() OrderBookEntry { - allocations := []*Allocation{} - for _, allo := range m.Entry.Allocations { - allocations = append(allocations, &Allocation{ - OrderId: allo.OrderId, - Quantity: allo.Quantity, - Account: allo.Account, - }) - } - newOrderEntry := OrderEntry{ - Price: m.Entry.Price, - Quantity: m.Entry.Quantity, - PriceDenom: m.Entry.PriceDenom, - AssetDenom: m.Entry.AssetDenom, - Allocations: allocations, - } - return &ShortBook{ - Price: m.Price, - Entry: &newOrderEntry, - } -} - -type ToSettle struct { - OrderID uint64 - Amount sdk.Dec - Account string -} - -func AllocationToSettle(a *Allocation) ToSettle { - return ToSettle{ - OrderID: a.OrderId, - Amount: a.Quantity, - Account: a.Account, - } -} diff --git a/x/dex/types/orders_test.go b/x/dex/types/orders_test.go deleted file mode 100644 index 65439dfc4..000000000 --- a/x/dex/types/orders_test.go +++ /dev/null @@ -1,166 +0,0 @@ -package types_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -var TestEntryOne = types.OrderEntry{ - Price: sdk.MustNewDecFromStr("10"), - Quantity: sdk.MustNewDecFromStr("3"), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Allocations: []*types.Allocation{ - { - Quantity: sdk.MustNewDecFromStr("2"), - Account: "abc", - OrderId: 1, - }, { - Quantity: sdk.MustNewDecFromStr("1"), - Account: "def", - OrderId: 2, - }, - }, -} - -var TestEntryTwo = types.OrderEntry{ - Price: sdk.MustNewDecFromStr("11"), - Quantity: sdk.MustNewDecFromStr("2"), - PriceDenom: keepertest.TestPriceDenom, - AssetDenom: keepertest.TestAssetDenom, - Allocations: []*types.Allocation{ - { - Quantity: sdk.MustNewDecFromStr("2"), - Account: "ghi", - OrderId: 3, - }, - }, -} - -func getCachedSortedOrderBookEntries(keeper *keeper.Keeper) *types.CachedSortedOrderBookEntries { - loader := func(lctx sdk.Context, startExclusive sdk.Dec, withLimit bool) []types.OrderBookEntry { - if !withLimit { - return keeper.GetTopNLongBooksForPair(lctx, keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom, 1) - } - return keeper.GetTopNLongBooksForPairStarting(lctx, keepertest.TestContract, keepertest.TestPriceDenom, keepertest.TestAssetDenom, 1, startExclusive) - } - setter := func(lctx sdk.Context, o types.OrderBookEntry) { - keeper.SetLongOrderBookEntry(lctx, keepertest.TestContract, o) - } - deleter := func(lctx sdk.Context, o types.OrderBookEntry) { - keeper.RemoveLongBookByPrice(lctx, keepertest.TestContract, o.GetPrice(), keepertest.TestPriceDenom, keepertest.TestAssetDenom) - } - return types.NewCachedSortedOrderBookEntries(loader, setter, deleter) -} - -func populateEntries(ctx sdk.Context, keeper *keeper.Keeper) { - keeper.SetLongBook(ctx, keepertest.TestContract, types.LongBook{ - Price: TestEntryOne.Price, - Entry: &TestEntryOne, - }) - keeper.SetLongBook(ctx, keepertest.TestContract, types.LongBook{ - Price: TestEntryTwo.Price, - Entry: &TestEntryTwo, - }) -} - -func TestIterateAndMutate(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - populateEntries(ctx, dexkeeper) - cache := getCachedSortedOrderBookEntries(dexkeeper) - // first Next should return entry two since its a higher priced long - entry := cache.Next(ctx) - require.NotNil(t, entry) - require.Equal(t, TestEntryTwo.Price, entry.GetPrice()) - require.Equal(t, TestEntryTwo, *entry.GetOrderEntry()) - res, settled := cache.SettleQuantity(ctx, sdk.OneDec()) - require.Equal(t, []types.ToSettle{{ - Amount: sdk.OneDec(), - Account: "ghi", - OrderID: 3, - }}, res) - require.Equal(t, sdk.OneDec(), settled) - - // second Next should still return entry two with decreased quantity - entry = cache.Next(ctx) - require.NotNil(t, entry) - require.Equal(t, TestEntryTwo.Price, entry.GetPrice()) - require.Equal(t, sdk.OneDec(), entry.GetOrderEntry().Quantity) - require.Equal(t, 1, len(entry.GetOrderEntry().Allocations)) - require.Equal(t, types.Allocation{ - Quantity: sdk.OneDec(), - Account: "ghi", - OrderId: 3, - }, *entry.GetOrderEntry().Allocations[0]) - res, settled = cache.SettleQuantity(ctx, sdk.OneDec()) - require.Equal(t, []types.ToSettle{{ - Amount: sdk.OneDec(), - Account: "ghi", - OrderID: 3, - }}, res) - require.Equal(t, sdk.OneDec(), settled) - - // third Next should return entry one since entry two has fully settled (whether flushed or not) - entry = cache.Next(ctx) - require.NotNil(t, entry) - require.Equal(t, TestEntryOne.Price, entry.GetPrice()) - require.Equal(t, TestEntryOne, *entry.GetOrderEntry()) - res, settled = cache.SettleQuantity(ctx, sdk.NewDec(4)) - require.Equal(t, []types.ToSettle{{ - Amount: sdk.NewDec(2), - Account: "abc", - OrderID: 1, - }, { - Amount: sdk.NewDec(1), - Account: "def", - OrderID: 2, - }}, res) - require.Equal(t, sdk.NewDec(3), settled) - - // fourth Next should return nil - entry = cache.Next(ctx) - require.Nil(t, entry) -} - -func TestRefreshAndFlush(t *testing.T) { - dexkeeper, ctx := keepertest.DexKeeper(t) - populateEntries(ctx, dexkeeper) - cache := getCachedSortedOrderBookEntries(dexkeeper) - _ = cache.Next(ctx) - _, _ = cache.SettleQuantity(ctx, sdk.OneDec()) - // refresh without flushing settle changes should undo the settle - cache.Refresh(ctx) - entry := cache.Next(ctx) - require.NotNil(t, entry) - require.Equal(t, TestEntryTwo.Price, entry.GetPrice()) - require.Equal(t, TestEntryTwo, *entry.GetOrderEntry()) - - _, _ = cache.SettleQuantity(ctx, sdk.OneDec()) - cache.Flush(ctx) - // refresh after flushing should reflect the settle change - cache.Refresh(ctx) - entry = cache.Next(ctx) - require.NotNil(t, entry) - require.Equal(t, TestEntryTwo.Price, entry.GetPrice()) - require.Equal(t, sdk.OneDec(), entry.GetOrderEntry().Quantity) - require.Equal(t, 1, len(entry.GetOrderEntry().Allocations)) - require.Equal(t, types.Allocation{ - Quantity: sdk.OneDec(), - Account: "ghi", - OrderId: 3, - }, *entry.GetOrderEntry().Allocations[0]) - - _, _ = cache.SettleQuantity(ctx, sdk.OneDec()) - cache.Flush(ctx) - // refresh after flushing a deleted entry should result in the next Next being the next entry - cache.Refresh(ctx) - entry = cache.Next(ctx) - require.NotNil(t, entry) - require.Equal(t, TestEntryOne.Price, entry.GetPrice()) - require.Equal(t, TestEntryOne, *entry.GetOrderEntry()) -} diff --git a/x/dex/types/pair.pb.go b/x/dex/types/pair.pb.go deleted file mode 100644 index 55841676d..000000000 --- a/x/dex/types/pair.pb.go +++ /dev/null @@ -1,718 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/pair.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Pair struct { - PriceDenom string `protobuf:"bytes,1,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,2,opt,name=assetDenom,proto3" json:"asset_denom"` - PriceTicksize *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=priceTicksize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price_tick_size"` - QuantityTicksize *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=quantityTicksize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quantity_tick_size"` -} - -func (m *Pair) Reset() { *m = Pair{} } -func (m *Pair) String() string { return proto.CompactTextString(m) } -func (*Pair) ProtoMessage() {} -func (*Pair) Descriptor() ([]byte, []int) { - return fileDescriptor_d4350ebee878f69a, []int{0} -} -func (m *Pair) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pair.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 *Pair) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pair.Merge(m, src) -} -func (m *Pair) XXX_Size() int { - return m.Size() -} -func (m *Pair) XXX_DiscardUnknown() { - xxx_messageInfo_Pair.DiscardUnknown(m) -} - -var xxx_messageInfo_Pair proto.InternalMessageInfo - -func (m *Pair) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *Pair) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -type BatchContractPair struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_addr"` - Pairs []*Pair `protobuf:"bytes,2,rep,name=pairs,proto3" json:"pairs"` -} - -func (m *BatchContractPair) Reset() { *m = BatchContractPair{} } -func (m *BatchContractPair) String() string { return proto.CompactTextString(m) } -func (*BatchContractPair) ProtoMessage() {} -func (*BatchContractPair) Descriptor() ([]byte, []int) { - return fileDescriptor_d4350ebee878f69a, []int{1} -} -func (m *BatchContractPair) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BatchContractPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BatchContractPair.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 *BatchContractPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_BatchContractPair.Merge(m, src) -} -func (m *BatchContractPair) XXX_Size() int { - return m.Size() -} -func (m *BatchContractPair) XXX_DiscardUnknown() { - xxx_messageInfo_BatchContractPair.DiscardUnknown(m) -} - -var xxx_messageInfo_BatchContractPair proto.InternalMessageInfo - -func (m *BatchContractPair) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *BatchContractPair) GetPairs() []*Pair { - if m != nil { - return m.Pairs - } - return nil -} - -func init() { - proto.RegisterType((*Pair)(nil), "seiprotocol.seichain.dex.Pair") - proto.RegisterType((*BatchContractPair)(nil), "seiprotocol.seichain.dex.BatchContractPair") -} - -func init() { proto.RegisterFile("dex/pair.proto", fileDescriptor_d4350ebee878f69a) } - -var fileDescriptor_d4350ebee878f69a = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x3f, 0x4f, 0xf2, 0x40, - 0x18, 0xa7, 0xc0, 0xfb, 0x26, 0x1c, 0x22, 0xd2, 0x38, 0x34, 0x0e, 0x2d, 0x61, 0x30, 0x2c, 0xf4, - 0x12, 0x8d, 0xb3, 0xa1, 0x92, 0xb8, 0x9a, 0xc6, 0xc9, 0x85, 0x1c, 0x77, 0x97, 0x72, 0x41, 0x7a, - 0xf5, 0xee, 0x48, 0xc0, 0xaf, 0xe0, 0xe2, 0x77, 0x72, 0x61, 0x64, 0x34, 0x0e, 0x8d, 0x81, 0xad, - 0x9f, 0xc2, 0xdc, 0x95, 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 0x48, 0xe1, 0xf1, 0x0d, 0x8f, - 0x95, 0x40, 0x58, 0x99, 0x91, 0x5e, 0x81, 0x23, 0xbc, 0xad, 0xfb, 0x84, 0x88, 0xed, 0x50, 0x5b, - 0x59, 0xea, 0x35, 0x0a, 0x7c, 0x88, 0x08, 0x11, 0xe1, 0x01, 0xcd, 0xbe, 0x06, 0xff, 0xf4, 0x42, - 0xa5, 0x53, 0x6e, 0x57, 0xba, 0xf5, 0x0b, 0xd7, 0xff, 0x6d, 0xa5, 0xbe, 0x4e, 0x09, 0x6a, 0x59, - 0xea, 0xe5, 0x82, 0x30, 0x3f, 0x82, 0xdb, 0xe5, 0xda, 0xb5, 0x56, 0x6b, 0xd7, 0xfa, 0x5c, 0xbb, - 0xd6, 0xeb, 0xc6, 0x2d, 0xad, 0x36, 0x6e, 0xe9, 0x7d, 0xe3, 0x96, 0x1e, 0x7a, 0x7b, 0xff, 0x2d, - 0x29, 0xeb, 0x15, 0xb6, 0xa6, 0x30, 0xbe, 0x70, 0x0e, 0xf5, 0x8b, 0x32, 0x23, 0x18, 0xfd, 0x37, - 0xfd, 0xcb, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x03, 0x32, 0x50, 0x65, 0x02, 0x00, 0x00, -} - -func (m *Pair) 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 *Pair) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.QuantityTicksize != nil { - { - size := m.QuantityTicksize.Size() - i -= size - if _, err := m.QuantityTicksize.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPair(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.PriceTicksize != nil { - { - size := m.PriceTicksize.Size() - i -= size - if _, err := m.PriceTicksize.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPair(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintPair(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintPair(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BatchContractPair) 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 *BatchContractPair) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BatchContractPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Pairs) > 0 { - for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPair(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintPair(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintPair(dAtA []byte, offset int, v uint64) int { - offset -= sovPair(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Pair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovPair(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovPair(uint64(l)) - } - if m.PriceTicksize != nil { - l = m.PriceTicksize.Size() - n += 1 + l + sovPair(uint64(l)) - } - if m.QuantityTicksize != nil { - l = m.QuantityTicksize.Size() - n += 1 + l + sovPair(uint64(l)) - } - return n -} - -func (m *BatchContractPair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovPair(uint64(l)) - } - if len(m.Pairs) > 0 { - for _, e := range m.Pairs { - l = e.Size() - n += 1 + l + sovPair(uint64(l)) - } - } - return n -} - -func sovPair(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPair(x uint64) (n int) { - return sovPair(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Pair) 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 ErrIntOverflowPair - } - 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: Pair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceTicksize", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.PriceTicksize = &v - if err := m.PriceTicksize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuantityTicksize", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.QuantityTicksize = &v - if err := m.QuantityTicksize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPair(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPair - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BatchContractPair) 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 ErrIntOverflowPair - } - 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: BatchContractPair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BatchContractPair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPair - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Pairs = append(m.Pairs, &Pair{}) - if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPair(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPair - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPair(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPair - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPair - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPair - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPair - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPair - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPair - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPair = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPair = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPair = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/params.go b/x/dex/types/params.go deleted file mode 100644 index aa0f4cde7..000000000 --- a/x/dex/types/params.go +++ /dev/null @@ -1,143 +0,0 @@ -package types - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" -) - -var ( - KeyPriceSnapshotRetention = []byte("PriceSnapshotRetention") // number of epochs to retain price snapshots for - KeySudoCallGasPrice = []byte("KeySudoCallGasPrice") // gas price for sudo calls from endblock - KeyBeginBlockGasLimit = []byte("KeyBeginBlockGasLimit") - KeyEndBlockGasLimit = []byte("KeyEndBlockGasLimit") - KeyDefaultGasPerOrder = []byte("KeyDefaultGasPerOrder") - KeyDefaultGasPerCancel = []byte("KeyDefaultGasPerCancel") - KeyMinRentDeposit = []byte("KeyMinRentDeposit") - KeyGasAllowancePerSettlement = []byte("KeyGasAllowancePerSettlement") - KeyMinProcessableRent = []byte("KeyMinProcessableRent") - KeyOrderBookEntriesPerLoad = []byte("KeyOrderBookEntriesPerLoad") - KeyContractUnsuspendCost = []byte("KeyContractUnsuspendCost") - KeyMaxOrderPerPrice = []byte("KeyMaxOrderPerPrice") - KeyMaxPairsPerContract = []byte("KeyMaxPairsPerContract") - KeyDefaultGasPerOrderDataByte = []byte("KeyDefaultGasPerOrderDataByte") -) - -const ( - DefaultPriceSnapshotRetention = 24 * 3600 // default to one day - DefaultBeginBlockGasLimit = 200000000 // 200M - DefaultEndBlockGasLimit = 1000000000 // 1B - DefaultDefaultGasPerOrder = 55000 - DefaultDefaultGasPerCancel = 53000 - DefaultMinRentDeposit = 10000000 // 10 sei - DefaultGasAllowancePerSettlement = 10000 - DefaultMinProcessableRent = 100000 - DefaultOrderBookEntriesPerLoad = 10 - DefaultContractUnsuspendCost = 1000000 - DefaultMaxOrderPerPrice = 10000 - DefaultMaxPairsPerContract = 100 - DefaultDefaultGasPerOrderDataByte = 30 -) - -var DefaultSudoCallGasPrice = sdk.NewDecWithPrec(1, 1) // 0.1 - -var _ paramtypes.ParamSet = (*Params)(nil) - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return Params{ - PriceSnapshotRetention: DefaultPriceSnapshotRetention, - SudoCallGasPrice: DefaultSudoCallGasPrice, - BeginBlockGasLimit: DefaultBeginBlockGasLimit, - EndBlockGasLimit: DefaultEndBlockGasLimit, - DefaultGasPerOrder: DefaultDefaultGasPerOrder, - DefaultGasPerCancel: DefaultDefaultGasPerCancel, - MinRentDeposit: DefaultMinRentDeposit, - GasAllowancePerSettlement: DefaultGasAllowancePerSettlement, - MinProcessableRent: DefaultMinProcessableRent, - OrderBookEntriesPerLoad: DefaultOrderBookEntriesPerLoad, - ContractUnsuspendCost: DefaultContractUnsuspendCost, - MaxOrderPerPrice: DefaultMaxOrderPerPrice, - MaxPairsPerContract: DefaultMaxPairsPerContract, - DefaultGasPerOrderDataByte: DefaultDefaultGasPerOrderDataByte, - } -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyPriceSnapshotRetention, &p.PriceSnapshotRetention, validatePriceSnapshotRetention), - paramtypes.NewParamSetPair(KeySudoCallGasPrice, &p.SudoCallGasPrice, validateSudoCallGasPrice), - paramtypes.NewParamSetPair(KeyBeginBlockGasLimit, &p.BeginBlockGasLimit, validateUint64Param), - paramtypes.NewParamSetPair(KeyEndBlockGasLimit, &p.EndBlockGasLimit, validateUint64Param), - paramtypes.NewParamSetPair(KeyDefaultGasPerOrder, &p.DefaultGasPerOrder, validateUint64Param), - paramtypes.NewParamSetPair(KeyDefaultGasPerCancel, &p.DefaultGasPerCancel, validateUint64Param), - paramtypes.NewParamSetPair(KeyMinRentDeposit, &p.MinRentDeposit, validateUint64Param), - paramtypes.NewParamSetPair(KeyGasAllowancePerSettlement, &p.GasAllowancePerSettlement, validateUint64Param), - paramtypes.NewParamSetPair(KeyMinProcessableRent, &p.MinProcessableRent, validateUint64Param), - paramtypes.NewParamSetPair(KeyOrderBookEntriesPerLoad, &p.OrderBookEntriesPerLoad, validateUint64Param), - paramtypes.NewParamSetPair(KeyContractUnsuspendCost, &p.ContractUnsuspendCost, validateUint64Param), - paramtypes.NewParamSetPair(KeyMaxOrderPerPrice, &p.MaxOrderPerPrice, validateUint64Param), - paramtypes.NewParamSetPair(KeyMaxPairsPerContract, &p.MaxPairsPerContract, validateUint64Param), - paramtypes.NewParamSetPair(KeyDefaultGasPerOrderDataByte, &p.DefaultGasPerOrderDataByte, validateUint64Param), - } -} - -// Validate validates the set of params -func (p Params) Validate() error { - if err := validatePriceSnapshotRetention(p.PriceSnapshotRetention); err != nil { - return err - } - if err := validateSudoCallGasPrice(p.SudoCallGasPrice); err != nil { - return err - } - // it's not possible for other params to fail validation if they've already - // made it into Params' fields. - return nil -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} - -func validatePriceSnapshotRetention(i interface{}) error { - v, ok := i.(uint64) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v == 0 { - return fmt.Errorf("price snapshot retention must be a positive integer: %d", v) - } - - return nil -} - -func validateSudoCallGasPrice(i interface{}) error { - price, ok := i.(sdk.Dec) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - if !price.IsPositive() { - return fmt.Errorf("nonpositive sudo call price") - } - return nil -} - -func validateUint64Param(i interface{}) error { - _, ok := i.(uint64) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - return nil -} diff --git a/x/dex/types/params.pb.go b/x/dex/types/params.pb.go deleted file mode 100644 index 7322767bc..000000000 --- a/x/dex/types/params.pb.go +++ /dev/null @@ -1,870 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/params.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Params defines the parameters for the module. -type Params struct { - PriceSnapshotRetention uint64 `protobuf:"varint,1,opt,name=price_snapshot_retention,json=priceSnapshotRetention,proto3" json:"price_snapshot_retention" yaml:"price_snapshot_retention"` - SudoCallGasPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=sudo_call_gas_price,json=sudoCallGasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"sudo_call_gas_price"` - BeginBlockGasLimit uint64 `protobuf:"varint,3,opt,name=begin_block_gas_limit,json=beginBlockGasLimit,proto3" json:"begin_block_gas_limit" yaml:"begin_block_gas_limit"` - EndBlockGasLimit uint64 `protobuf:"varint,4,opt,name=end_block_gas_limit,json=endBlockGasLimit,proto3" json:"end_block_gas_limit" yaml:"end_block_gas_limit"` - DefaultGasPerOrder uint64 `protobuf:"varint,5,opt,name=default_gas_per_order,json=defaultGasPerOrder,proto3" json:"default_gas_per_order" yaml:"default_gas_per_order"` - DefaultGasPerCancel uint64 `protobuf:"varint,6,opt,name=default_gas_per_cancel,json=defaultGasPerCancel,proto3" json:"default_gas_per_cancel" yaml:"default_gas_per_cancel"` - MinRentDeposit uint64 `protobuf:"varint,7,opt,name=min_rent_deposit,json=minRentDeposit,proto3" json:"min_rent_deposit" yaml:"min_rent_deposit"` - GasAllowancePerSettlement uint64 `protobuf:"varint,8,opt,name=gas_allowance_per_settlement,json=gasAllowancePerSettlement,proto3" json:"gas_allowance_per_settlement" yaml:"gas_allowance_per_settlement"` - MinProcessableRent uint64 `protobuf:"varint,9,opt,name=min_processable_rent,json=minProcessableRent,proto3" json:"min_processable_rent" yaml:"min_processable_rent"` - OrderBookEntriesPerLoad uint64 `protobuf:"varint,10,opt,name=order_book_entries_per_load,json=orderBookEntriesPerLoad,proto3" json:"order_book_entries_per_load" yaml:"order_book_entries_per_load"` - ContractUnsuspendCost uint64 `protobuf:"varint,11,opt,name=contract_unsuspend_cost,json=contractUnsuspendCost,proto3" json:"contract_unsuspend_cost" yaml:"contract_unsuspend_cost"` - MaxOrderPerPrice uint64 `protobuf:"varint,12,opt,name=max_order_per_price,json=maxOrderPerPrice,proto3" json:"max_order_per_price" yaml:"max_order_per_price"` - MaxPairsPerContract uint64 `protobuf:"varint,13,opt,name=max_pairs_per_contract,json=maxPairsPerContract,proto3" json:"max_pairs_per_contract" yaml:"max_pairs_per_contract"` - DefaultGasPerOrderDataByte uint64 `protobuf:"varint,14,opt,name=default_gas_per_order_data_byte,json=defaultGasPerOrderDataByte,proto3" json:"default_gas_per_order_data_byte" yaml:"default_gas_per_order_data_byte"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_e49286500ccff43e, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetPriceSnapshotRetention() uint64 { - if m != nil { - return m.PriceSnapshotRetention - } - return 0 -} - -func (m *Params) GetBeginBlockGasLimit() uint64 { - if m != nil { - return m.BeginBlockGasLimit - } - return 0 -} - -func (m *Params) GetEndBlockGasLimit() uint64 { - if m != nil { - return m.EndBlockGasLimit - } - return 0 -} - -func (m *Params) GetDefaultGasPerOrder() uint64 { - if m != nil { - return m.DefaultGasPerOrder - } - return 0 -} - -func (m *Params) GetDefaultGasPerCancel() uint64 { - if m != nil { - return m.DefaultGasPerCancel - } - return 0 -} - -func (m *Params) GetMinRentDeposit() uint64 { - if m != nil { - return m.MinRentDeposit - } - return 0 -} - -func (m *Params) GetGasAllowancePerSettlement() uint64 { - if m != nil { - return m.GasAllowancePerSettlement - } - return 0 -} - -func (m *Params) GetMinProcessableRent() uint64 { - if m != nil { - return m.MinProcessableRent - } - return 0 -} - -func (m *Params) GetOrderBookEntriesPerLoad() uint64 { - if m != nil { - return m.OrderBookEntriesPerLoad - } - return 0 -} - -func (m *Params) GetContractUnsuspendCost() uint64 { - if m != nil { - return m.ContractUnsuspendCost - } - return 0 -} - -func (m *Params) GetMaxOrderPerPrice() uint64 { - if m != nil { - return m.MaxOrderPerPrice - } - return 0 -} - -func (m *Params) GetMaxPairsPerContract() uint64 { - if m != nil { - return m.MaxPairsPerContract - } - return 0 -} - -func (m *Params) GetDefaultGasPerOrderDataByte() uint64 { - if m != nil { - return m.DefaultGasPerOrderDataByte - } - return 0 -} - -func init() { - proto.RegisterType((*Params)(nil), "seiprotocol.seichain.dex.Params") -} - -func init() { proto.RegisterFile("dex/params.proto", fileDescriptor_e49286500ccff43e) } - -var fileDescriptor_e49286500ccff43e = []byte{ - // 787 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x95, 0xc1, 0x6f, 0x1b, 0x45, - 0x14, 0xc6, 0xbd, 0x50, 0x42, 0x3b, 0x94, 0xca, 0xda, 0x34, 0xc9, 0x92, 0x16, 0x4f, 0x35, 0x48, - 0x55, 0x2f, 0xb1, 0x0f, 0x08, 0x21, 0x8a, 0x10, 0xc2, 0x49, 0x94, 0x4b, 0x11, 0xd6, 0x54, 0x1c, - 0xe0, 0xb2, 0x1a, 0xef, 0x3e, 0x9c, 0x51, 0x66, 0x67, 0x56, 0x33, 0x63, 0x61, 0x9f, 0xb9, 0x70, - 0x44, 0x9c, 0x38, 0xf6, 0xcf, 0xe9, 0xb1, 0x47, 0xc4, 0x61, 0x84, 0x92, 0x0b, 0xda, 0xe3, 0xfe, - 0x05, 0x68, 0x66, 0x6d, 0x96, 0x24, 0x6b, 0xf7, 0x94, 0xcd, 0xf7, 0xfb, 0xb4, 0xdf, 0x7b, 0xde, - 0x79, 0x6f, 0x50, 0x3f, 0x87, 0xc5, 0xa8, 0x64, 0x9a, 0x15, 0x66, 0x58, 0x6a, 0x65, 0x55, 0x9c, - 0x18, 0xe0, 0xe1, 0x29, 0x53, 0x62, 0x68, 0x80, 0x67, 0xe7, 0x8c, 0xcb, 0x61, 0x0e, 0x8b, 0xc3, - 0x87, 0x33, 0x35, 0x53, 0x01, 0x8d, 0xfc, 0x53, 0xe3, 0x27, 0xf5, 0x7d, 0xb4, 0x33, 0x09, 0x2f, - 0x88, 0x97, 0x28, 0x29, 0x35, 0xcf, 0x20, 0x35, 0x92, 0x95, 0xe6, 0x5c, 0xd9, 0x54, 0x83, 0x05, - 0x69, 0xb9, 0x92, 0x49, 0xf4, 0x24, 0x7a, 0x76, 0x67, 0xfc, 0x75, 0xe5, 0xf0, 0x46, 0x4f, 0xed, - 0x30, 0x5e, 0xb2, 0x42, 0x3c, 0x27, 0x9b, 0x1c, 0x84, 0xee, 0x07, 0xf4, 0x72, 0x45, 0xe8, 0x1a, - 0xc4, 0x16, 0xed, 0x9a, 0x79, 0xae, 0xd2, 0x8c, 0x09, 0x91, 0xce, 0x98, 0x49, 0x83, 0x2f, 0x79, - 0xe7, 0x49, 0xf4, 0xec, 0xde, 0xf8, 0xf4, 0xb5, 0xc3, 0xbd, 0xbf, 0x1c, 0x7e, 0x3a, 0xe3, 0xf6, - 0x7c, 0x3e, 0x1d, 0x66, 0xaa, 0x18, 0x65, 0xca, 0x14, 0xca, 0xac, 0xfe, 0x1c, 0x99, 0xfc, 0x62, - 0x64, 0x97, 0x25, 0x98, 0xe1, 0x09, 0x64, 0x95, 0xc3, 0x5d, 0x2f, 0xa3, 0x7d, 0x2f, 0x1e, 0x33, - 0x21, 0xce, 0x98, 0x99, 0x78, 0x25, 0x16, 0x68, 0x6f, 0x0a, 0x33, 0x2e, 0xd3, 0xa9, 0x50, 0xd9, - 0x45, 0xb0, 0x0a, 0x5e, 0x70, 0x9b, 0xbc, 0x1b, 0xba, 0xfd, 0xa2, 0x72, 0xb8, 0xdb, 0x50, 0x3b, - 0xfc, 0xb8, 0x69, 0xb5, 0x13, 0x13, 0x1a, 0x07, 0x7d, 0xec, 0xe5, 0x33, 0x66, 0x5e, 0x78, 0x31, - 0xce, 0xd1, 0x2e, 0xc8, 0xfc, 0x56, 0xd6, 0x9d, 0x90, 0xf5, 0x99, 0xaf, 0xba, 0x03, 0xd7, 0x0e, - 0x1f, 0x36, 0x49, 0x1d, 0x90, 0xd0, 0x3e, 0xc8, 0xfc, 0x7a, 0x8a, 0x40, 0x7b, 0x39, 0xfc, 0xc4, - 0xe6, 0xc2, 0x36, 0xad, 0x83, 0x4e, 0x95, 0xce, 0x41, 0x27, 0xef, 0xb5, 0x3d, 0x75, 0x1a, 0xda, - 0x9e, 0x3a, 0x31, 0xa1, 0xf1, 0x4a, 0xf7, 0x3f, 0x1f, 0xe8, 0xef, 0xbc, 0x18, 0x97, 0x68, 0xff, - 0xa6, 0x3b, 0x63, 0x32, 0x03, 0x91, 0xec, 0x84, 0xb8, 0x2f, 0x2b, 0x87, 0x37, 0x38, 0x6a, 0x87, - 0x3f, 0xee, 0xce, 0x6b, 0x38, 0xa1, 0xbb, 0xd7, 0x02, 0x8f, 0x83, 0x1a, 0xff, 0x80, 0xfa, 0x05, - 0x97, 0xa9, 0x06, 0x69, 0xd3, 0x1c, 0x4a, 0x65, 0xb8, 0x4d, 0xde, 0x0f, 0x59, 0xa3, 0xca, 0xe1, - 0x5b, 0xac, 0x76, 0xf8, 0xa0, 0x49, 0xb9, 0x49, 0x08, 0x7d, 0x50, 0x70, 0x49, 0x41, 0xda, 0x93, - 0x46, 0x88, 0x7f, 0x8d, 0xd0, 0x63, 0x5f, 0x03, 0x13, 0x42, 0xfd, 0xec, 0xd3, 0x42, 0x35, 0x06, - 0xac, 0x15, 0x50, 0x80, 0xb4, 0xc9, 0xdd, 0x90, 0x73, 0x56, 0x39, 0xbc, 0xd5, 0x57, 0x3b, 0xfc, - 0x49, 0x93, 0xb9, 0xcd, 0x45, 0xe8, 0x47, 0x33, 0x66, 0xbe, 0x59, 0xd3, 0x09, 0xe8, 0x97, 0xff, - 0xb1, 0x98, 0xa3, 0x87, 0xbe, 0xde,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 0xfb, 0x19, 0x59, 0xa9, 0xf1, - 0xef, 0x11, 0xc2, 0x9d, 0x63, 0x9c, 0xe6, 0xcc, 0xb2, 0x74, 0xba, 0xb4, 0x90, 0x3c, 0x08, 0xd9, - 0xdf, 0x56, 0x0e, 0xbf, 0xcd, 0x5a, 0x3b, 0xfc, 0x74, 0xcb, 0x6a, 0x68, 0x8d, 0x84, 0x1e, 0xde, - 0x5e, 0x12, 0x27, 0xcc, 0xb2, 0xf1, 0xd2, 0xc2, 0xf3, 0xbb, 0x7f, 0xbc, 0xc2, 0xbd, 0x7f, 0x5e, - 0xe1, 0x68, 0x7c, 0xf6, 0xfa, 0x72, 0x10, 0xbd, 0xb9, 0x1c, 0x44, 0x7f, 0x5f, 0x0e, 0xa2, 0xdf, - 0xae, 0x06, 0xbd, 0x37, 0x57, 0x83, 0xde, 0x9f, 0x57, 0x83, 0xde, 0x8f, 0x47, 0xff, 0xdb, 0xf1, - 0x06, 0xf8, 0xd1, 0xfa, 0x2a, 0x0b, 0xff, 0x84, 0xbb, 0x6c, 0xb4, 0x18, 0xf9, 0x4b, 0x2f, 0xac, - 0xfb, 0xe9, 0x4e, 0xe0, 0x9f, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xff, 0x27, 0x82, 0x3c, 0x08, - 0x07, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.PriceSnapshotRetention != that1.PriceSnapshotRetention { - return false - } - if !this.SudoCallGasPrice.Equal(that1.SudoCallGasPrice) { - return false - } - if this.BeginBlockGasLimit != that1.BeginBlockGasLimit { - return false - } - if this.EndBlockGasLimit != that1.EndBlockGasLimit { - return false - } - if this.DefaultGasPerOrder != that1.DefaultGasPerOrder { - return false - } - if this.DefaultGasPerCancel != that1.DefaultGasPerCancel { - return false - } - if this.MinRentDeposit != that1.MinRentDeposit { - return false - } - if this.GasAllowancePerSettlement != that1.GasAllowancePerSettlement { - return false - } - if this.MinProcessableRent != that1.MinProcessableRent { - return false - } - if this.OrderBookEntriesPerLoad != that1.OrderBookEntriesPerLoad { - return false - } - if this.ContractUnsuspendCost != that1.ContractUnsuspendCost { - return false - } - if this.MaxOrderPerPrice != that1.MaxOrderPerPrice { - return false - } - if this.MaxPairsPerContract != that1.MaxPairsPerContract { - return false - } - if this.DefaultGasPerOrderDataByte != that1.DefaultGasPerOrderDataByte { - return false - } - return true -} -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DefaultGasPerOrderDataByte != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.DefaultGasPerOrderDataByte)) - i-- - dAtA[i] = 0x70 - } - if m.MaxPairsPerContract != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxPairsPerContract)) - i-- - dAtA[i] = 0x68 - } - if m.MaxOrderPerPrice != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxOrderPerPrice)) - i-- - dAtA[i] = 0x60 - } - if m.ContractUnsuspendCost != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.ContractUnsuspendCost)) - i-- - dAtA[i] = 0x58 - } - if m.OrderBookEntriesPerLoad != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.OrderBookEntriesPerLoad)) - i-- - dAtA[i] = 0x50 - } - if m.MinProcessableRent != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MinProcessableRent)) - i-- - dAtA[i] = 0x48 - } - if m.GasAllowancePerSettlement != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.GasAllowancePerSettlement)) - i-- - dAtA[i] = 0x40 - } - if m.MinRentDeposit != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MinRentDeposit)) - i-- - dAtA[i] = 0x38 - } - if m.DefaultGasPerCancel != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.DefaultGasPerCancel)) - i-- - dAtA[i] = 0x30 - } - if m.DefaultGasPerOrder != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.DefaultGasPerOrder)) - i-- - dAtA[i] = 0x28 - } - if m.EndBlockGasLimit != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.EndBlockGasLimit)) - i-- - dAtA[i] = 0x20 - } - if m.BeginBlockGasLimit != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.BeginBlockGasLimit)) - i-- - dAtA[i] = 0x18 - } - { - size := m.SudoCallGasPrice.Size() - i -= size - if _, err := m.SudoCallGasPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.PriceSnapshotRetention != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.PriceSnapshotRetention)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PriceSnapshotRetention != 0 { - n += 1 + sovParams(uint64(m.PriceSnapshotRetention)) - } - l = m.SudoCallGasPrice.Size() - n += 1 + l + sovParams(uint64(l)) - if m.BeginBlockGasLimit != 0 { - n += 1 + sovParams(uint64(m.BeginBlockGasLimit)) - } - if m.EndBlockGasLimit != 0 { - n += 1 + sovParams(uint64(m.EndBlockGasLimit)) - } - if m.DefaultGasPerOrder != 0 { - n += 1 + sovParams(uint64(m.DefaultGasPerOrder)) - } - if m.DefaultGasPerCancel != 0 { - n += 1 + sovParams(uint64(m.DefaultGasPerCancel)) - } - if m.MinRentDeposit != 0 { - n += 1 + sovParams(uint64(m.MinRentDeposit)) - } - if m.GasAllowancePerSettlement != 0 { - n += 1 + sovParams(uint64(m.GasAllowancePerSettlement)) - } - if m.MinProcessableRent != 0 { - n += 1 + sovParams(uint64(m.MinProcessableRent)) - } - if m.OrderBookEntriesPerLoad != 0 { - n += 1 + sovParams(uint64(m.OrderBookEntriesPerLoad)) - } - if m.ContractUnsuspendCost != 0 { - n += 1 + sovParams(uint64(m.ContractUnsuspendCost)) - } - if m.MaxOrderPerPrice != 0 { - n += 1 + sovParams(uint64(m.MaxOrderPerPrice)) - } - if m.MaxPairsPerContract != 0 { - n += 1 + sovParams(uint64(m.MaxPairsPerContract)) - } - if m.DefaultGasPerOrderDataByte != 0 { - n += 1 + sovParams(uint64(m.DefaultGasPerOrderDataByte)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceSnapshotRetention", wireType) - } - m.PriceSnapshotRetention = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PriceSnapshotRetention |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SudoCallGasPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SudoCallGasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BeginBlockGasLimit", wireType) - } - m.BeginBlockGasLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BeginBlockGasLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlockGasLimit", wireType) - } - m.EndBlockGasLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndBlockGasLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultGasPerOrder", wireType) - } - m.DefaultGasPerOrder = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DefaultGasPerOrder |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultGasPerCancel", wireType) - } - m.DefaultGasPerCancel = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DefaultGasPerCancel |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinRentDeposit", wireType) - } - m.MinRentDeposit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinRentDeposit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasAllowancePerSettlement", wireType) - } - m.GasAllowancePerSettlement = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasAllowancePerSettlement |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinProcessableRent", wireType) - } - m.MinProcessableRent = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinProcessableRent |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderBookEntriesPerLoad", wireType) - } - m.OrderBookEntriesPerLoad = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OrderBookEntriesPerLoad |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractUnsuspendCost", wireType) - } - m.ContractUnsuspendCost = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ContractUnsuspendCost |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxOrderPerPrice", wireType) - } - m.MaxOrderPerPrice = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxOrderPerPrice |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxPairsPerContract", wireType) - } - m.MaxPairsPerContract = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxPairsPerContract |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultGasPerOrderDataByte", wireType) - } - m.DefaultGasPerOrderDataByte = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DefaultGasPerOrderDataByte |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/params_test.go b/x/dex/types/params_test.go deleted file mode 100644 index efd19a5cf..000000000 --- a/x/dex/types/params_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package types_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestParamsValidate(t *testing.T) { - p := types.Params{PriceSnapshotRetention: 0} - require.Error(t, p.Validate()) - - p = types.Params{SudoCallGasPrice: sdk.ZeroDec()} - require.Error(t, p.Validate()) -} diff --git a/x/dex/types/price.pb.go b/x/dex/types/price.pb.go deleted file mode 100644 index b85e68649..000000000 --- a/x/dex/types/price.pb.go +++ /dev/null @@ -1,881 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/price.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Price struct { - SnapshotTimestampInSeconds uint64 `protobuf:"varint,1,opt,name=snapshotTimestampInSeconds,proto3" json:"snapshot_timestamp_in_seconds"` - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price" yaml:"price"` - Pair *Pair `protobuf:"bytes,3,opt,name=pair,proto3" json:"pair"` -} - -func (m *Price) Reset() { *m = Price{} } -func (m *Price) String() string { return proto.CompactTextString(m) } -func (*Price) ProtoMessage() {} -func (*Price) Descriptor() ([]byte, []int) { - return fileDescriptor_bd5d1c9d490efb8c, []int{0} -} -func (m *Price) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Price) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Price.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 *Price) XXX_Merge(src proto.Message) { - xxx_messageInfo_Price.Merge(m, src) -} -func (m *Price) XXX_Size() int { - return m.Size() -} -func (m *Price) XXX_DiscardUnknown() { - xxx_messageInfo_Price.DiscardUnknown(m) -} - -var xxx_messageInfo_Price proto.InternalMessageInfo - -func (m *Price) GetSnapshotTimestampInSeconds() uint64 { - if m != nil { - return m.SnapshotTimestampInSeconds - } - return 0 -} - -func (m *Price) GetPair() *Pair { - if m != nil { - return m.Pair - } - return nil -} - -type PriceCandlestick struct { - BeginTimestamp uint64 `protobuf:"varint,1,opt,name=beginTimestamp,proto3" json:"begin_timestamp"` - EndTimestamp uint64 `protobuf:"varint,2,opt,name=endTimestamp,proto3" json:"end_timestamp"` - Open *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=open,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"open"` - High *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=high,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"high"` - Low *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=low,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"low"` - Close *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=close,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"close"` - Volume *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=volume,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"volume"` -} - -func (m *PriceCandlestick) Reset() { *m = PriceCandlestick{} } -func (m *PriceCandlestick) String() string { return proto.CompactTextString(m) } -func (*PriceCandlestick) ProtoMessage() {} -func (*PriceCandlestick) Descriptor() ([]byte, []int) { - return fileDescriptor_bd5d1c9d490efb8c, []int{1} -} -func (m *PriceCandlestick) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PriceCandlestick) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PriceCandlestick.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 *PriceCandlestick) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriceCandlestick.Merge(m, src) -} -func (m *PriceCandlestick) XXX_Size() int { - return m.Size() -} -func (m *PriceCandlestick) XXX_DiscardUnknown() { - xxx_messageInfo_PriceCandlestick.DiscardUnknown(m) -} - -var xxx_messageInfo_PriceCandlestick proto.InternalMessageInfo - -func (m *PriceCandlestick) GetBeginTimestamp() uint64 { - if m != nil { - return m.BeginTimestamp - } - return 0 -} - -func (m *PriceCandlestick) GetEndTimestamp() uint64 { - if m != nil { - return m.EndTimestamp - } - return 0 -} - -func init() { - proto.RegisterType((*Price)(nil), "seiprotocol.seichain.dex.Price") - proto.RegisterType((*PriceCandlestick)(nil), "seiprotocol.seichain.dex.PriceCandlestick") -} - -func init() { proto.RegisterFile("dex/price.proto", fileDescriptor_bd5d1c9d490efb8c) } - -var fileDescriptor_bd5d1c9d490efb8c = []byte{ - // 466 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xe3, 0xfc, 0x83, 0x2e, 0xa5, 0x85, 0x85, 0x83,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0xd2, 0xff, 0xa0, 0xd2, 0xf3, 0x0c, 0xec, 0x1b, 0xc8, 0x7a, - 0xd2, 0x88, 0xb5, 0xf6, 0xb2, 0x75, 0x0e, 0x8e, 0x2f, 0x97, 0x8e, 0x75, 0xb5, 0x74, 0xac, 0x6f, - 0x4b, 0xc7, 0xfa, 0xbc, 0x72, 0x5a, 0x57, 0x2b, 0xa7, 0xf5, 0x65, 0xe5, 0xb4, 0xde, 0x4d, 0xb6, - 0x98, 0x1a, 0xc4, 0x64, 0x73, 0x97, 0xb0, 0xc0, 0xcb, 0xe4, 0x2f, 0x7c, 0xf3, 0x3b, 0x21, 0x7e, - 0xd6, 0xc7, 0xfe, 0xe1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xe7, 0x11, 0xeb, 0xa3, 0x03, - 0x00, 0x00, -} - -func (m *Price) 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 *Price) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Price) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pair != nil { - { - size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPrice(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPrice(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.SnapshotTimestampInSeconds != 0 { - i = encodeVarintPrice(dAtA, i, uint64(m.SnapshotTimestampInSeconds)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PriceCandlestick) 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 *PriceCandlestick) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PriceCandlestick) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Volume != nil { - { - size := m.Volume.Size() - i -= size - if _, err := m.Volume.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPrice(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.Close != nil { - { - size := m.Close.Size() - i -= size - if _, err := m.Close.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPrice(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.Low != nil { - { - size := m.Low.Size() - i -= size - if _, err := m.Low.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPrice(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.High != nil { - { - size := m.High.Size() - i -= size - if _, err := m.High.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPrice(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Open != nil { - { - size := m.Open.Size() - i -= size - if _, err := m.Open.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPrice(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.EndTimestamp != 0 { - i = encodeVarintPrice(dAtA, i, uint64(m.EndTimestamp)) - i-- - dAtA[i] = 0x10 - } - if m.BeginTimestamp != 0 { - i = encodeVarintPrice(dAtA, i, uint64(m.BeginTimestamp)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintPrice(dAtA []byte, offset int, v uint64) int { - offset -= sovPrice(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Price) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SnapshotTimestampInSeconds != 0 { - n += 1 + sovPrice(uint64(m.SnapshotTimestampInSeconds)) - } - l = m.Price.Size() - n += 1 + l + sovPrice(uint64(l)) - if m.Pair != nil { - l = m.Pair.Size() - n += 1 + l + sovPrice(uint64(l)) - } - return n -} - -func (m *PriceCandlestick) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BeginTimestamp != 0 { - n += 1 + sovPrice(uint64(m.BeginTimestamp)) - } - if m.EndTimestamp != 0 { - n += 1 + sovPrice(uint64(m.EndTimestamp)) - } - if m.Open != nil { - l = m.Open.Size() - n += 1 + l + sovPrice(uint64(l)) - } - if m.High != nil { - l = m.High.Size() - n += 1 + l + sovPrice(uint64(l)) - } - if m.Low != nil { - l = m.Low.Size() - n += 1 + l + sovPrice(uint64(l)) - } - if m.Close != nil { - l = m.Close.Size() - n += 1 + l + sovPrice(uint64(l)) - } - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovPrice(uint64(l)) - } - return n -} - -func sovPrice(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPrice(x uint64) (n int) { - return sovPrice(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Price) 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 ErrIntOverflowPrice - } - 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: Price: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Price: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SnapshotTimestampInSeconds", wireType) - } - m.SnapshotTimestampInSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SnapshotTimestampInSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - 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 ErrInvalidLengthPrice - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPrice - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPrice - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPrice - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pair == nil { - m.Pair = &Pair{} - } - if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPrice(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPrice - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PriceCandlestick) 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 ErrIntOverflowPrice - } - 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: PriceCandlestick: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PriceCandlestick: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BeginTimestamp", wireType) - } - m.BeginTimestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BeginTimestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTimestamp", wireType) - } - m.EndTimestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndTimestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Open", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - 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 ErrInvalidLengthPrice - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPrice - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.Open = &v - if err := m.Open.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field High", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - 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 ErrInvalidLengthPrice - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPrice - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.High = &v - if err := m.High.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Low", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - 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 ErrInvalidLengthPrice - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPrice - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.Low = &v - if err := m.Low.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Close", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - 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 ErrInvalidLengthPrice - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPrice - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.Close = &v - if err := m.Close.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - 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 ErrInvalidLengthPrice - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPrice - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.Volume = &v - if err := m.Volume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPrice(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPrice - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPrice(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPrice - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPrice - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPrice - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPrice - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPrice - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPrice - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPrice = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPrice = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPrice = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/query.pb.go b/x/dex/types/query.pb.go deleted file mode 100644 index 931520f80..000000000 --- a/x/dex/types/query.pb.go +++ /dev/null @@ -1,10031 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/query.proto - -package types - -import ( - context "context" - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryGetLongBookRequest struct { - Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` - PriceDenom string `protobuf:"bytes,3,opt,name=priceDenom,proto3" json:"priceDenom,omitempty"` - AssetDenom string `protobuf:"bytes,4,opt,name=assetDenom,proto3" json:"assetDenom,omitempty"` -} - -func (m *QueryGetLongBookRequest) Reset() { *m = QueryGetLongBookRequest{} } -func (m *QueryGetLongBookRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetLongBookRequest) ProtoMessage() {} -func (*QueryGetLongBookRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{2} -} -func (m *QueryGetLongBookRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetLongBookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetLongBookRequest.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 *QueryGetLongBookRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetLongBookRequest.Merge(m, src) -} -func (m *QueryGetLongBookRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetLongBookRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetLongBookRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetLongBookRequest proto.InternalMessageInfo - -func (m *QueryGetLongBookRequest) GetPrice() string { - if m != nil { - return m.Price - } - return "" -} - -func (m *QueryGetLongBookRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetLongBookRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetLongBookRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -type QueryGetLongBookResponse struct { - LongBook LongBook `protobuf:"bytes,1,opt,name=LongBook,proto3" json:"LongBook"` -} - -func (m *QueryGetLongBookResponse) Reset() { *m = QueryGetLongBookResponse{} } -func (m *QueryGetLongBookResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetLongBookResponse) ProtoMessage() {} -func (*QueryGetLongBookResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{3} -} -func (m *QueryGetLongBookResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetLongBookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetLongBookResponse.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 *QueryGetLongBookResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetLongBookResponse.Merge(m, src) -} -func (m *QueryGetLongBookResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetLongBookResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetLongBookResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetLongBookResponse proto.InternalMessageInfo - -func (m *QueryGetLongBookResponse) GetLongBook() LongBook { - if m != nil { - return m.LongBook - } - return LongBook{} -} - -type QueryAllLongBookRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` - PriceDenom string `protobuf:"bytes,3,opt,name=priceDenom,proto3" json:"priceDenom,omitempty"` - AssetDenom string `protobuf:"bytes,4,opt,name=assetDenom,proto3" json:"assetDenom,omitempty"` -} - -func (m *QueryAllLongBookRequest) Reset() { *m = QueryAllLongBookRequest{} } -func (m *QueryAllLongBookRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllLongBookRequest) ProtoMessage() {} -func (*QueryAllLongBookRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{4} -} -func (m *QueryAllLongBookRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllLongBookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllLongBookRequest.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 *QueryAllLongBookRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllLongBookRequest.Merge(m, src) -} -func (m *QueryAllLongBookRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllLongBookRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllLongBookRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllLongBookRequest proto.InternalMessageInfo - -func (m *QueryAllLongBookRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -func (m *QueryAllLongBookRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryAllLongBookRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryAllLongBookRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -type QueryAllLongBookResponse struct { - LongBook []LongBook `protobuf:"bytes,1,rep,name=LongBook,proto3" json:"LongBook"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllLongBookResponse) Reset() { *m = QueryAllLongBookResponse{} } -func (m *QueryAllLongBookResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllLongBookResponse) ProtoMessage() {} -func (*QueryAllLongBookResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{5} -} -func (m *QueryAllLongBookResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllLongBookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllLongBookResponse.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 *QueryAllLongBookResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllLongBookResponse.Merge(m, src) -} -func (m *QueryAllLongBookResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllLongBookResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllLongBookResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllLongBookResponse proto.InternalMessageInfo - -func (m *QueryAllLongBookResponse) GetLongBook() []LongBook { - if m != nil { - return m.LongBook - } - return nil -} - -func (m *QueryAllLongBookResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryGetShortBookRequest struct { - Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` - PriceDenom string `protobuf:"bytes,3,opt,name=priceDenom,proto3" json:"priceDenom,omitempty"` - AssetDenom string `protobuf:"bytes,4,opt,name=assetDenom,proto3" json:"assetDenom,omitempty"` -} - -func (m *QueryGetShortBookRequest) Reset() { *m = QueryGetShortBookRequest{} } -func (m *QueryGetShortBookRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetShortBookRequest) ProtoMessage() {} -func (*QueryGetShortBookRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{6} -} -func (m *QueryGetShortBookRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetShortBookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetShortBookRequest.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 *QueryGetShortBookRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetShortBookRequest.Merge(m, src) -} -func (m *QueryGetShortBookRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetShortBookRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetShortBookRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetShortBookRequest proto.InternalMessageInfo - -func (m *QueryGetShortBookRequest) GetPrice() string { - if m != nil { - return m.Price - } - return "" -} - -func (m *QueryGetShortBookRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetShortBookRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetShortBookRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -type QueryGetShortBookResponse struct { - ShortBook ShortBook `protobuf:"bytes,1,opt,name=ShortBook,proto3" json:"ShortBook"` -} - -func (m *QueryGetShortBookResponse) Reset() { *m = QueryGetShortBookResponse{} } -func (m *QueryGetShortBookResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetShortBookResponse) ProtoMessage() {} -func (*QueryGetShortBookResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{7} -} -func (m *QueryGetShortBookResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetShortBookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetShortBookResponse.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 *QueryGetShortBookResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetShortBookResponse.Merge(m, src) -} -func (m *QueryGetShortBookResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetShortBookResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetShortBookResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetShortBookResponse proto.InternalMessageInfo - -func (m *QueryGetShortBookResponse) GetShortBook() ShortBook { - if m != nil { - return m.ShortBook - } - return ShortBook{} -} - -type QueryAllShortBookRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` - PriceDenom string `protobuf:"bytes,3,opt,name=priceDenom,proto3" json:"priceDenom,omitempty"` - AssetDenom string `protobuf:"bytes,4,opt,name=assetDenom,proto3" json:"assetDenom,omitempty"` -} - -func (m *QueryAllShortBookRequest) Reset() { *m = QueryAllShortBookRequest{} } -func (m *QueryAllShortBookRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllShortBookRequest) ProtoMessage() {} -func (*QueryAllShortBookRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{8} -} -func (m *QueryAllShortBookRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllShortBookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllShortBookRequest.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 *QueryAllShortBookRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllShortBookRequest.Merge(m, src) -} -func (m *QueryAllShortBookRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllShortBookRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllShortBookRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllShortBookRequest proto.InternalMessageInfo - -func (m *QueryAllShortBookRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -func (m *QueryAllShortBookRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryAllShortBookRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryAllShortBookRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -type QueryAllShortBookResponse struct { - ShortBook []ShortBook `protobuf:"bytes,1,rep,name=ShortBook,proto3" json:"ShortBook"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllShortBookResponse) Reset() { *m = QueryAllShortBookResponse{} } -func (m *QueryAllShortBookResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllShortBookResponse) ProtoMessage() {} -func (*QueryAllShortBookResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{9} -} -func (m *QueryAllShortBookResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllShortBookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllShortBookResponse.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 *QueryAllShortBookResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllShortBookResponse.Merge(m, src) -} -func (m *QueryAllShortBookResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllShortBookResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllShortBookResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllShortBookResponse proto.InternalMessageInfo - -func (m *QueryAllShortBookResponse) GetShortBook() []ShortBook { - if m != nil { - return m.ShortBook - } - return nil -} - -func (m *QueryAllShortBookResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryGetPricesRequest struct { - PriceDenom string `protobuf:"bytes,1,opt,name=priceDenom,proto3" json:"priceDenom,omitempty"` - AssetDenom string `protobuf:"bytes,2,opt,name=assetDenom,proto3" json:"assetDenom,omitempty"` - ContractAddr string `protobuf:"bytes,3,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` -} - -func (m *QueryGetPricesRequest) Reset() { *m = QueryGetPricesRequest{} } -func (m *QueryGetPricesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetPricesRequest) ProtoMessage() {} -func (*QueryGetPricesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{10} -} -func (m *QueryGetPricesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetPricesRequest.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 *QueryGetPricesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetPricesRequest.Merge(m, src) -} -func (m *QueryGetPricesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetPricesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetPricesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetPricesRequest proto.InternalMessageInfo - -func (m *QueryGetPricesRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetPricesRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *QueryGetPricesRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type QueryGetPricesResponse struct { - Prices []*Price `protobuf:"bytes,1,rep,name=prices,proto3" json:"prices,omitempty"` -} - -func (m *QueryGetPricesResponse) Reset() { *m = QueryGetPricesResponse{} } -func (m *QueryGetPricesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetPricesResponse) ProtoMessage() {} -func (*QueryGetPricesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{11} -} -func (m *QueryGetPricesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetPricesResponse.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 *QueryGetPricesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetPricesResponse.Merge(m, src) -} -func (m *QueryGetPricesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetPricesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetPricesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetPricesResponse proto.InternalMessageInfo - -func (m *QueryGetPricesResponse) GetPrices() []*Price { - if m != nil { - return m.Prices - } - return nil -} - -type QueryGetPriceRequest struct { - PriceDenom string `protobuf:"bytes,1,opt,name=priceDenom,proto3" json:"priceDenom,omitempty"` - AssetDenom string `protobuf:"bytes,2,opt,name=assetDenom,proto3" json:"assetDenom,omitempty"` - ContractAddr string `protobuf:"bytes,3,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` - Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (m *QueryGetPriceRequest) Reset() { *m = QueryGetPriceRequest{} } -func (m *QueryGetPriceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetPriceRequest) ProtoMessage() {} -func (*QueryGetPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{12} -} -func (m *QueryGetPriceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetPriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetPriceRequest.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 *QueryGetPriceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetPriceRequest.Merge(m, src) -} -func (m *QueryGetPriceRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetPriceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetPriceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetPriceRequest proto.InternalMessageInfo - -func (m *QueryGetPriceRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetPriceRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *QueryGetPriceRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetPriceRequest) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -type QueryGetPriceResponse struct { - Price *Price `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` - Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` -} - -func (m *QueryGetPriceResponse) Reset() { *m = QueryGetPriceResponse{} } -func (m *QueryGetPriceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetPriceResponse) ProtoMessage() {} -func (*QueryGetPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{13} -} -func (m *QueryGetPriceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetPriceResponse.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 *QueryGetPriceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetPriceResponse.Merge(m, src) -} -func (m *QueryGetPriceResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetPriceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetPriceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetPriceResponse proto.InternalMessageInfo - -func (m *QueryGetPriceResponse) GetPrice() *Price { - if m != nil { - return m.Price - } - return nil -} - -func (m *QueryGetPriceResponse) GetFound() bool { - if m != nil { - return m.Found - } - return false -} - -type QueryGetLatestPriceRequest struct { - PriceDenom string `protobuf:"bytes,1,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,2,opt,name=assetDenom,proto3" json:"asset_denom"` - ContractAddr string `protobuf:"bytes,3,opt,name=contractAddr,proto3" json:"contract_address"` -} - -func (m *QueryGetLatestPriceRequest) Reset() { *m = QueryGetLatestPriceRequest{} } -func (m *QueryGetLatestPriceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetLatestPriceRequest) ProtoMessage() {} -func (*QueryGetLatestPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{14} -} -func (m *QueryGetLatestPriceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetLatestPriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetLatestPriceRequest.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 *QueryGetLatestPriceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetLatestPriceRequest.Merge(m, src) -} -func (m *QueryGetLatestPriceRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetLatestPriceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetLatestPriceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetLatestPriceRequest proto.InternalMessageInfo - -func (m *QueryGetLatestPriceRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetLatestPriceRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *QueryGetLatestPriceRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type QueryGetLatestPriceResponse struct { - Price *Price `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` -} - -func (m *QueryGetLatestPriceResponse) Reset() { *m = QueryGetLatestPriceResponse{} } -func (m *QueryGetLatestPriceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetLatestPriceResponse) ProtoMessage() {} -func (*QueryGetLatestPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{15} -} -func (m *QueryGetLatestPriceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetLatestPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetLatestPriceResponse.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 *QueryGetLatestPriceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetLatestPriceResponse.Merge(m, src) -} -func (m *QueryGetLatestPriceResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetLatestPriceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetLatestPriceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetLatestPriceResponse proto.InternalMessageInfo - -func (m *QueryGetLatestPriceResponse) GetPrice() *Price { - if m != nil { - return m.Price - } - return nil -} - -type QueryGetTwapsRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` - LookbackSeconds uint64 `protobuf:"varint,2,opt,name=lookbackSeconds,proto3" json:"lookback_seconds"` -} - -func (m *QueryGetTwapsRequest) Reset() { *m = QueryGetTwapsRequest{} } -func (m *QueryGetTwapsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetTwapsRequest) ProtoMessage() {} -func (*QueryGetTwapsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{16} -} -func (m *QueryGetTwapsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTwapsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTwapsRequest.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 *QueryGetTwapsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTwapsRequest.Merge(m, src) -} -func (m *QueryGetTwapsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTwapsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTwapsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTwapsRequest proto.InternalMessageInfo - -func (m *QueryGetTwapsRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetTwapsRequest) GetLookbackSeconds() uint64 { - if m != nil { - return m.LookbackSeconds - } - return 0 -} - -type QueryGetTwapsResponse struct { - Twaps []*Twap `protobuf:"bytes,1,rep,name=twaps,proto3" json:"twaps"` -} - -func (m *QueryGetTwapsResponse) Reset() { *m = QueryGetTwapsResponse{} } -func (m *QueryGetTwapsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetTwapsResponse) ProtoMessage() {} -func (*QueryGetTwapsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{17} -} -func (m *QueryGetTwapsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetTwapsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetTwapsResponse.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 *QueryGetTwapsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetTwapsResponse.Merge(m, src) -} -func (m *QueryGetTwapsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetTwapsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetTwapsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetTwapsResponse proto.InternalMessageInfo - -func (m *QueryGetTwapsResponse) GetTwaps() []*Twap { - if m != nil { - return m.Twaps - } - return nil -} - -type QueryAssetListRequest struct { -} - -func (m *QueryAssetListRequest) Reset() { *m = QueryAssetListRequest{} } -func (m *QueryAssetListRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAssetListRequest) ProtoMessage() {} -func (*QueryAssetListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{18} -} -func (m *QueryAssetListRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetListRequest.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 *QueryAssetListRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetListRequest.Merge(m, src) -} -func (m *QueryAssetListRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetListRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetListRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetListRequest proto.InternalMessageInfo - -type QueryAssetListResponse struct { - AssetList []AssetMetadata `protobuf:"bytes,1,rep,name=assetList,proto3" json:"assetList"` -} - -func (m *QueryAssetListResponse) Reset() { *m = QueryAssetListResponse{} } -func (m *QueryAssetListResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAssetListResponse) ProtoMessage() {} -func (*QueryAssetListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{19} -} -func (m *QueryAssetListResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetListResponse.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 *QueryAssetListResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetListResponse.Merge(m, src) -} -func (m *QueryAssetListResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetListResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetListResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetListResponse proto.InternalMessageInfo - -func (m *QueryAssetListResponse) GetAssetList() []AssetMetadata { - if m != nil { - return m.AssetList - } - return nil -} - -type QueryAssetMetadataRequest struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *QueryAssetMetadataRequest) Reset() { *m = QueryAssetMetadataRequest{} } -func (m *QueryAssetMetadataRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAssetMetadataRequest) ProtoMessage() {} -func (*QueryAssetMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{20} -} -func (m *QueryAssetMetadataRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetMetadataRequest.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 *QueryAssetMetadataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetMetadataRequest.Merge(m, src) -} -func (m *QueryAssetMetadataRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetMetadataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetMetadataRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetMetadataRequest proto.InternalMessageInfo - -func (m *QueryAssetMetadataRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -type QueryAssetMetadataResponse struct { - Metadata *AssetMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (m *QueryAssetMetadataResponse) Reset() { *m = QueryAssetMetadataResponse{} } -func (m *QueryAssetMetadataResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAssetMetadataResponse) ProtoMessage() {} -func (*QueryAssetMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{21} -} -func (m *QueryAssetMetadataResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetMetadataResponse.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 *QueryAssetMetadataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetMetadataResponse.Merge(m, src) -} -func (m *QueryAssetMetadataResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetMetadataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetMetadataResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetMetadataResponse proto.InternalMessageInfo - -func (m *QueryAssetMetadataResponse) GetMetadata() *AssetMetadata { - if m != nil { - return m.Metadata - } - return nil -} - -type QueryRegisteredPairsRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` -} - -func (m *QueryRegisteredPairsRequest) Reset() { *m = QueryRegisteredPairsRequest{} } -func (m *QueryRegisteredPairsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryRegisteredPairsRequest) ProtoMessage() {} -func (*QueryRegisteredPairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{22} -} -func (m *QueryRegisteredPairsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRegisteredPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRegisteredPairsRequest.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 *QueryRegisteredPairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRegisteredPairsRequest.Merge(m, src) -} -func (m *QueryRegisteredPairsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryRegisteredPairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRegisteredPairsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryRegisteredPairsRequest proto.InternalMessageInfo - -func (m *QueryRegisteredPairsRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type QueryRegisteredPairsResponse struct { - Pairs []Pair `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs"` -} - -func (m *QueryRegisteredPairsResponse) Reset() { *m = QueryRegisteredPairsResponse{} } -func (m *QueryRegisteredPairsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryRegisteredPairsResponse) ProtoMessage() {} -func (*QueryRegisteredPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{23} -} -func (m *QueryRegisteredPairsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRegisteredPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRegisteredPairsResponse.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 *QueryRegisteredPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRegisteredPairsResponse.Merge(m, src) -} -func (m *QueryRegisteredPairsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryRegisteredPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRegisteredPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryRegisteredPairsResponse proto.InternalMessageInfo - -func (m *QueryRegisteredPairsResponse) GetPairs() []Pair { - if m != nil { - return m.Pairs - } - return nil -} - -type QueryRegisteredContractRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` -} - -func (m *QueryRegisteredContractRequest) Reset() { *m = QueryRegisteredContractRequest{} } -func (m *QueryRegisteredContractRequest) String() string { return proto.CompactTextString(m) } -func (*QueryRegisteredContractRequest) ProtoMessage() {} -func (*QueryRegisteredContractRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{24} -} -func (m *QueryRegisteredContractRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRegisteredContractRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRegisteredContractRequest.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 *QueryRegisteredContractRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRegisteredContractRequest.Merge(m, src) -} -func (m *QueryRegisteredContractRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryRegisteredContractRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRegisteredContractRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryRegisteredContractRequest proto.InternalMessageInfo - -func (m *QueryRegisteredContractRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type QueryRegisteredContractResponse struct { - ContractInfo *ContractInfoV2 `protobuf:"bytes,1,opt,name=contract_info,json=contractInfo,proto3" json:"contract_info,omitempty"` -} - -func (m *QueryRegisteredContractResponse) Reset() { *m = QueryRegisteredContractResponse{} } -func (m *QueryRegisteredContractResponse) String() string { return proto.CompactTextString(m) } -func (*QueryRegisteredContractResponse) ProtoMessage() {} -func (*QueryRegisteredContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{25} -} -func (m *QueryRegisteredContractResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRegisteredContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRegisteredContractResponse.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 *QueryRegisteredContractResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRegisteredContractResponse.Merge(m, src) -} -func (m *QueryRegisteredContractResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryRegisteredContractResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRegisteredContractResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryRegisteredContractResponse proto.InternalMessageInfo - -func (m *QueryRegisteredContractResponse) GetContractInfo() *ContractInfoV2 { - if m != nil { - return m.ContractInfo - } - return nil -} - -type QueryGetOrdersRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` - Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account"` -} - -func (m *QueryGetOrdersRequest) Reset() { *m = QueryGetOrdersRequest{} } -func (m *QueryGetOrdersRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetOrdersRequest) ProtoMessage() {} -func (*QueryGetOrdersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{26} -} -func (m *QueryGetOrdersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetOrdersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetOrdersRequest.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 *QueryGetOrdersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetOrdersRequest.Merge(m, src) -} -func (m *QueryGetOrdersRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetOrdersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetOrdersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetOrdersRequest proto.InternalMessageInfo - -func (m *QueryGetOrdersRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetOrdersRequest) GetAccount() string { - if m != nil { - return m.Account - } - return "" -} - -type QueryGetOrdersResponse struct { - Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders"` -} - -func (m *QueryGetOrdersResponse) Reset() { *m = QueryGetOrdersResponse{} } -func (m *QueryGetOrdersResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetOrdersResponse) ProtoMessage() {} -func (*QueryGetOrdersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{27} -} -func (m *QueryGetOrdersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetOrdersResponse.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 *QueryGetOrdersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetOrdersResponse.Merge(m, src) -} -func (m *QueryGetOrdersResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetOrdersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetOrdersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetOrdersResponse proto.InternalMessageInfo - -func (m *QueryGetOrdersResponse) GetOrders() []*Order { - if m != nil { - return m.Orders - } - return nil -} - -type QueryGetOrderByIDRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` - PriceDenom string `protobuf:"bytes,2,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,3,opt,name=assetDenom,proto3" json:"asset_denom"` - Id uint64 `protobuf:"varint,4,opt,name=id,proto3" json:"id"` -} - -func (m *QueryGetOrderByIDRequest) Reset() { *m = QueryGetOrderByIDRequest{} } -func (m *QueryGetOrderByIDRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetOrderByIDRequest) ProtoMessage() {} -func (*QueryGetOrderByIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{28} -} -func (m *QueryGetOrderByIDRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetOrderByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetOrderByIDRequest.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 *QueryGetOrderByIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetOrderByIDRequest.Merge(m, src) -} -func (m *QueryGetOrderByIDRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetOrderByIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetOrderByIDRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetOrderByIDRequest proto.InternalMessageInfo - -func (m *QueryGetOrderByIDRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetOrderByIDRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetOrderByIDRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *QueryGetOrderByIDRequest) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -type QueryGetOrderByIDResponse struct { - Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order"` -} - -func (m *QueryGetOrderByIDResponse) Reset() { *m = QueryGetOrderByIDResponse{} } -func (m *QueryGetOrderByIDResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetOrderByIDResponse) ProtoMessage() {} -func (*QueryGetOrderByIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{29} -} -func (m *QueryGetOrderByIDResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetOrderByIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetOrderByIDResponse.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 *QueryGetOrderByIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetOrderByIDResponse.Merge(m, src) -} -func (m *QueryGetOrderByIDResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetOrderByIDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetOrderByIDResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetOrderByIDResponse proto.InternalMessageInfo - -func (m *QueryGetOrderByIDResponse) GetOrder() *Order { - if m != nil { - return m.Order - } - return nil -} - -type QueryGetHistoricalPricesRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` - PriceDenom string `protobuf:"bytes,2,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,3,opt,name=assetDenom,proto3" json:"asset_denom"` - PeriodLengthInSeconds uint64 `protobuf:"varint,4,opt,name=periodLengthInSeconds,proto3" json:"period_length_in_seconds"` - NumOfPeriods uint64 `protobuf:"varint,5,opt,name=numOfPeriods,proto3" json:"number_of_periods"` -} - -func (m *QueryGetHistoricalPricesRequest) Reset() { *m = QueryGetHistoricalPricesRequest{} } -func (m *QueryGetHistoricalPricesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetHistoricalPricesRequest) ProtoMessage() {} -func (*QueryGetHistoricalPricesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{30} -} -func (m *QueryGetHistoricalPricesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetHistoricalPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetHistoricalPricesRequest.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 *QueryGetHistoricalPricesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetHistoricalPricesRequest.Merge(m, src) -} -func (m *QueryGetHistoricalPricesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetHistoricalPricesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetHistoricalPricesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetHistoricalPricesRequest proto.InternalMessageInfo - -func (m *QueryGetHistoricalPricesRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetHistoricalPricesRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetHistoricalPricesRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *QueryGetHistoricalPricesRequest) GetPeriodLengthInSeconds() uint64 { - if m != nil { - return m.PeriodLengthInSeconds - } - return 0 -} - -func (m *QueryGetHistoricalPricesRequest) GetNumOfPeriods() uint64 { - if m != nil { - return m.NumOfPeriods - } - return 0 -} - -type QueryGetHistoricalPricesResponse struct { - Prices []*PriceCandlestick `protobuf:"bytes,1,rep,name=prices,proto3" json:"prices"` -} - -func (m *QueryGetHistoricalPricesResponse) Reset() { *m = QueryGetHistoricalPricesResponse{} } -func (m *QueryGetHistoricalPricesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetHistoricalPricesResponse) ProtoMessage() {} -func (*QueryGetHistoricalPricesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{31} -} -func (m *QueryGetHistoricalPricesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetHistoricalPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetHistoricalPricesResponse.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 *QueryGetHistoricalPricesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetHistoricalPricesResponse.Merge(m, src) -} -func (m *QueryGetHistoricalPricesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetHistoricalPricesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetHistoricalPricesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetHistoricalPricesResponse proto.InternalMessageInfo - -func (m *QueryGetHistoricalPricesResponse) GetPrices() []*PriceCandlestick { - if m != nil { - return m.Prices - } - return nil -} - -type QueryGetMarketSummaryRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` - PriceDenom string `protobuf:"bytes,2,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,3,opt,name=assetDenom,proto3" json:"asset_denom"` - LookbackInSeconds uint64 `protobuf:"varint,4,opt,name=lookbackInSeconds,proto3" json:"lookback_in_seconds"` -} - -func (m *QueryGetMarketSummaryRequest) Reset() { *m = QueryGetMarketSummaryRequest{} } -func (m *QueryGetMarketSummaryRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetMarketSummaryRequest) ProtoMessage() {} -func (*QueryGetMarketSummaryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{32} -} -func (m *QueryGetMarketSummaryRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetMarketSummaryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetMarketSummaryRequest.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 *QueryGetMarketSummaryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetMarketSummaryRequest.Merge(m, src) -} -func (m *QueryGetMarketSummaryRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetMarketSummaryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetMarketSummaryRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetMarketSummaryRequest proto.InternalMessageInfo - -func (m *QueryGetMarketSummaryRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetMarketSummaryRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetMarketSummaryRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *QueryGetMarketSummaryRequest) GetLookbackInSeconds() uint64 { - if m != nil { - return m.LookbackInSeconds - } - return 0 -} - -type QueryGetMarketSummaryResponse struct { - TotalVolume *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=totalVolume,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"total_volume"` - TotalVolumeNotional *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=totalVolumeNotional,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"total_volume_notional"` - HighPrice *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=highPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"high_price"` - LowPrice *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=lowPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"low_price"` - LastPrice *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=lastPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"last_price"` -} - -func (m *QueryGetMarketSummaryResponse) Reset() { *m = QueryGetMarketSummaryResponse{} } -func (m *QueryGetMarketSummaryResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetMarketSummaryResponse) ProtoMessage() {} -func (*QueryGetMarketSummaryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{33} -} -func (m *QueryGetMarketSummaryResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetMarketSummaryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetMarketSummaryResponse.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 *QueryGetMarketSummaryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetMarketSummaryResponse.Merge(m, src) -} -func (m *QueryGetMarketSummaryResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetMarketSummaryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetMarketSummaryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetMarketSummaryResponse proto.InternalMessageInfo - -type QueryOrderSimulationRequest struct { - Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contract_address"` -} - -func (m *QueryOrderSimulationRequest) Reset() { *m = QueryOrderSimulationRequest{} } -func (m *QueryOrderSimulationRequest) String() string { return proto.CompactTextString(m) } -func (*QueryOrderSimulationRequest) ProtoMessage() {} -func (*QueryOrderSimulationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{34} -} -func (m *QueryOrderSimulationRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryOrderSimulationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryOrderSimulationRequest.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 *QueryOrderSimulationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryOrderSimulationRequest.Merge(m, src) -} -func (m *QueryOrderSimulationRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryOrderSimulationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryOrderSimulationRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryOrderSimulationRequest proto.InternalMessageInfo - -func (m *QueryOrderSimulationRequest) GetOrder() *Order { - if m != nil { - return m.Order - } - return nil -} - -func (m *QueryOrderSimulationRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type QueryOrderSimulationResponse struct { - ExecutedQuantity *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=ExecutedQuantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"executed_quantity"` -} - -func (m *QueryOrderSimulationResponse) Reset() { *m = QueryOrderSimulationResponse{} } -func (m *QueryOrderSimulationResponse) String() string { return proto.CompactTextString(m) } -func (*QueryOrderSimulationResponse) ProtoMessage() {} -func (*QueryOrderSimulationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{35} -} -func (m *QueryOrderSimulationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryOrderSimulationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryOrderSimulationResponse.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 *QueryOrderSimulationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryOrderSimulationResponse.Merge(m, src) -} -func (m *QueryOrderSimulationResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryOrderSimulationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryOrderSimulationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryOrderSimulationResponse proto.InternalMessageInfo - -type QueryGetMatchResultRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` -} - -func (m *QueryGetMatchResultRequest) Reset() { *m = QueryGetMatchResultRequest{} } -func (m *QueryGetMatchResultRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetMatchResultRequest) ProtoMessage() {} -func (*QueryGetMatchResultRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{36} -} -func (m *QueryGetMatchResultRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetMatchResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetMatchResultRequest.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 *QueryGetMatchResultRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetMatchResultRequest.Merge(m, src) -} -func (m *QueryGetMatchResultRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetMatchResultRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetMatchResultRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetMatchResultRequest proto.InternalMessageInfo - -func (m *QueryGetMatchResultRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type QueryGetMatchResultResponse struct { - Result *MatchResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result"` -} - -func (m *QueryGetMatchResultResponse) Reset() { *m = QueryGetMatchResultResponse{} } -func (m *QueryGetMatchResultResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetMatchResultResponse) ProtoMessage() {} -func (*QueryGetMatchResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{37} -} -func (m *QueryGetMatchResultResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetMatchResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetMatchResultResponse.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 *QueryGetMatchResultResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetMatchResultResponse.Merge(m, src) -} -func (m *QueryGetMatchResultResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetMatchResultResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetMatchResultResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetMatchResultResponse proto.InternalMessageInfo - -func (m *QueryGetMatchResultResponse) GetResult() *MatchResult { - if m != nil { - return m.Result - } - return nil -} - -type QueryGetOrderCountRequest struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` - PriceDenom string `protobuf:"bytes,2,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,3,opt,name=assetDenom,proto3" json:"asset_denom"` - Price *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` - PositionDirection PositionDirection `protobuf:"varint,5,opt,name=positionDirection,proto3,enum=seiprotocol.seichain.dex.PositionDirection" json:"position_direction"` -} - -func (m *QueryGetOrderCountRequest) Reset() { *m = QueryGetOrderCountRequest{} } -func (m *QueryGetOrderCountRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetOrderCountRequest) ProtoMessage() {} -func (*QueryGetOrderCountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{38} -} -func (m *QueryGetOrderCountRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetOrderCountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetOrderCountRequest.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 *QueryGetOrderCountRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetOrderCountRequest.Merge(m, src) -} -func (m *QueryGetOrderCountRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetOrderCountRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetOrderCountRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetOrderCountRequest proto.InternalMessageInfo - -func (m *QueryGetOrderCountRequest) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *QueryGetOrderCountRequest) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *QueryGetOrderCountRequest) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *QueryGetOrderCountRequest) GetPositionDirection() PositionDirection { - if m != nil { - return m.PositionDirection - } - return PositionDirection_LONG -} - -type QueryGetOrderCountResponse struct { - Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count"` -} - -func (m *QueryGetOrderCountResponse) Reset() { *m = QueryGetOrderCountResponse{} } -func (m *QueryGetOrderCountResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetOrderCountResponse) ProtoMessage() {} -func (*QueryGetOrderCountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d8e98105e6e08a59, []int{39} -} -func (m *QueryGetOrderCountResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetOrderCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetOrderCountResponse.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 *QueryGetOrderCountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetOrderCountResponse.Merge(m, src) -} -func (m *QueryGetOrderCountResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetOrderCountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetOrderCountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetOrderCountResponse proto.InternalMessageInfo - -func (m *QueryGetOrderCountResponse) GetCount() uint64 { - if m != nil { - return m.Count - } - return 0 -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "seiprotocol.seichain.dex.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "seiprotocol.seichain.dex.QueryParamsResponse") - proto.RegisterType((*QueryGetLongBookRequest)(nil), "seiprotocol.seichain.dex.QueryGetLongBookRequest") - proto.RegisterType((*QueryGetLongBookResponse)(nil), "seiprotocol.seichain.dex.QueryGetLongBookResponse") - proto.RegisterType((*QueryAllLongBookRequest)(nil), "seiprotocol.seichain.dex.QueryAllLongBookRequest") - proto.RegisterType((*QueryAllLongBookResponse)(nil), "seiprotocol.seichain.dex.QueryAllLongBookResponse") - proto.RegisterType((*QueryGetShortBookRequest)(nil), "seiprotocol.seichain.dex.QueryGetShortBookRequest") - proto.RegisterType((*QueryGetShortBookResponse)(nil), "seiprotocol.seichain.dex.QueryGetShortBookResponse") - proto.RegisterType((*QueryAllShortBookRequest)(nil), "seiprotocol.seichain.dex.QueryAllShortBookRequest") - proto.RegisterType((*QueryAllShortBookResponse)(nil), "seiprotocol.seichain.dex.QueryAllShortBookResponse") - proto.RegisterType((*QueryGetPricesRequest)(nil), "seiprotocol.seichain.dex.QueryGetPricesRequest") - proto.RegisterType((*QueryGetPricesResponse)(nil), "seiprotocol.seichain.dex.QueryGetPricesResponse") - proto.RegisterType((*QueryGetPriceRequest)(nil), "seiprotocol.seichain.dex.QueryGetPriceRequest") - proto.RegisterType((*QueryGetPriceResponse)(nil), "seiprotocol.seichain.dex.QueryGetPriceResponse") - proto.RegisterType((*QueryGetLatestPriceRequest)(nil), "seiprotocol.seichain.dex.QueryGetLatestPriceRequest") - proto.RegisterType((*QueryGetLatestPriceResponse)(nil), "seiprotocol.seichain.dex.QueryGetLatestPriceResponse") - proto.RegisterType((*QueryGetTwapsRequest)(nil), "seiprotocol.seichain.dex.QueryGetTwapsRequest") - proto.RegisterType((*QueryGetTwapsResponse)(nil), "seiprotocol.seichain.dex.QueryGetTwapsResponse") - proto.RegisterType((*QueryAssetListRequest)(nil), "seiprotocol.seichain.dex.QueryAssetListRequest") - proto.RegisterType((*QueryAssetListResponse)(nil), "seiprotocol.seichain.dex.QueryAssetListResponse") - proto.RegisterType((*QueryAssetMetadataRequest)(nil), "seiprotocol.seichain.dex.QueryAssetMetadataRequest") - proto.RegisterType((*QueryAssetMetadataResponse)(nil), "seiprotocol.seichain.dex.QueryAssetMetadataResponse") - proto.RegisterType((*QueryRegisteredPairsRequest)(nil), "seiprotocol.seichain.dex.QueryRegisteredPairsRequest") - proto.RegisterType((*QueryRegisteredPairsResponse)(nil), "seiprotocol.seichain.dex.QueryRegisteredPairsResponse") - proto.RegisterType((*QueryRegisteredContractRequest)(nil), "seiprotocol.seichain.dex.QueryRegisteredContractRequest") - proto.RegisterType((*QueryRegisteredContractResponse)(nil), "seiprotocol.seichain.dex.QueryRegisteredContractResponse") - proto.RegisterType((*QueryGetOrdersRequest)(nil), "seiprotocol.seichain.dex.QueryGetOrdersRequest") - proto.RegisterType((*QueryGetOrdersResponse)(nil), "seiprotocol.seichain.dex.QueryGetOrdersResponse") - proto.RegisterType((*QueryGetOrderByIDRequest)(nil), "seiprotocol.seichain.dex.QueryGetOrderByIDRequest") - proto.RegisterType((*QueryGetOrderByIDResponse)(nil), "seiprotocol.seichain.dex.QueryGetOrderByIDResponse") - proto.RegisterType((*QueryGetHistoricalPricesRequest)(nil), "seiprotocol.seichain.dex.QueryGetHistoricalPricesRequest") - proto.RegisterType((*QueryGetHistoricalPricesResponse)(nil), "seiprotocol.seichain.dex.QueryGetHistoricalPricesResponse") - proto.RegisterType((*QueryGetMarketSummaryRequest)(nil), "seiprotocol.seichain.dex.QueryGetMarketSummaryRequest") - proto.RegisterType((*QueryGetMarketSummaryResponse)(nil), "seiprotocol.seichain.dex.QueryGetMarketSummaryResponse") - proto.RegisterType((*QueryOrderSimulationRequest)(nil), "seiprotocol.seichain.dex.QueryOrderSimulationRequest") - proto.RegisterType((*QueryOrderSimulationResponse)(nil), "seiprotocol.seichain.dex.QueryOrderSimulationResponse") - proto.RegisterType((*QueryGetMatchResultRequest)(nil), "seiprotocol.seichain.dex.QueryGetMatchResultRequest") - proto.RegisterType((*QueryGetMatchResultResponse)(nil), "seiprotocol.seichain.dex.QueryGetMatchResultResponse") - proto.RegisterType((*QueryGetOrderCountRequest)(nil), "seiprotocol.seichain.dex.QueryGetOrderCountRequest") - proto.RegisterType((*QueryGetOrderCountResponse)(nil), "seiprotocol.seichain.dex.QueryGetOrderCountResponse") -} - -func init() { proto.RegisterFile("dex/query.proto", fileDescriptor_d8e98105e6e08a59) } - -var fileDescriptor_d8e98105e6e08a59 = []byte{ - // 2281 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59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 0xb9, 0x76, 0xf5, 0x31, 0x2c, 0xd0, 0x10, 0xfc, 0x01, 0x38, 0x10, 0xf9, 0xd4, 0x85, - 0x59, 0x97, 0x71, 0xd8, 0x8f, 0x28, 0x9e, 0xcd, 0x07, 0xf2, 0x46, 0xaf, 0x2e, 0x7e, 0xfc, 0xa4, - 0x24, 0x3d, 0x7e, 0x52, 0x92, 0xfe, 0xfd, 0xa4, 0x24, 0x3d, 0x7a, 0x5a, 0x1a, 0x7a, 0xfc, 0xb4, - 0x34, 0xf4, 0x8f, 0xa7, 0xa5, 0xa1, 0x7b, 0xb3, 0x21, 0xcb, 0x20, 0x5e, 0x16, 0xb3, 0xbc, 0x2e, - 0xb6, 0x58, 0x65, 0x30, 0xf7, 0x60, 0x7d, 0x94, 0xbd, 0x3f, 0xf3, 0x59, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xf0, 0x0a, 0x3f, 0x2b, 0x03, 0x27, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a LongBook by id. - LongBook(ctx context.Context, in *QueryGetLongBookRequest, opts ...grpc.CallOption) (*QueryGetLongBookResponse, error) - // Queries a list of LongBook items. - LongBookAll(ctx context.Context, in *QueryAllLongBookRequest, opts ...grpc.CallOption) (*QueryAllLongBookResponse, error) - // Queries a ShortBook by id. - ShortBook(ctx context.Context, in *QueryGetShortBookRequest, opts ...grpc.CallOption) (*QueryGetShortBookResponse, error) - // Queries a list of ShortBook items. - ShortBookAll(ctx context.Context, in *QueryAllShortBookRequest, opts ...grpc.CallOption) (*QueryAllShortBookResponse, error) - GetPrice(ctx context.Context, in *QueryGetPriceRequest, opts ...grpc.CallOption) (*QueryGetPriceResponse, error) - GetLatestPrice(ctx context.Context, in *QueryGetLatestPriceRequest, opts ...grpc.CallOption) (*QueryGetLatestPriceResponse, error) - GetPrices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) - GetTwaps(ctx context.Context, in *QueryGetTwapsRequest, opts ...grpc.CallOption) (*QueryGetTwapsResponse, error) - // Returns the metadata for a specified denom / display type - AssetMetadata(ctx context.Context, in *QueryAssetMetadataRequest, opts ...grpc.CallOption) (*QueryAssetMetadataResponse, error) - // Returns metadata for all the assets - AssetList(ctx context.Context, in *QueryAssetListRequest, opts ...grpc.CallOption) (*QueryAssetListResponse, error) - // Returns all registered pairs for specified contract address - GetRegisteredPairs(ctx context.Context, in *QueryRegisteredPairsRequest, opts ...grpc.CallOption) (*QueryRegisteredPairsResponse, error) - // Returns registered contract information - GetRegisteredContract(ctx context.Context, in *QueryRegisteredContractRequest, opts ...grpc.CallOption) (*QueryRegisteredContractResponse, error) - GetOrders(ctx context.Context, in *QueryGetOrdersRequest, opts ...grpc.CallOption) (*QueryGetOrdersResponse, error) - GetOrder(ctx context.Context, in *QueryGetOrderByIDRequest, opts ...grpc.CallOption) (*QueryGetOrderByIDResponse, error) - GetHistoricalPrices(ctx context.Context, in *QueryGetHistoricalPricesRequest, opts ...grpc.CallOption) (*QueryGetHistoricalPricesResponse, error) - GetMarketSummary(ctx context.Context, in *QueryGetMarketSummaryRequest, opts ...grpc.CallOption) (*QueryGetMarketSummaryResponse, error) - GetOrderSimulation(ctx context.Context, in *QueryOrderSimulationRequest, opts ...grpc.CallOption) (*QueryOrderSimulationResponse, error) - GetMatchResult(ctx context.Context, in *QueryGetMatchResultRequest, opts ...grpc.CallOption) (*QueryGetMatchResultResponse, error) - GetOrderCount(ctx context.Context, in *QueryGetOrderCountRequest, opts ...grpc.CallOption) (*QueryGetOrderCountResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) 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, "/seiprotocol.seichain.dex.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) LongBook(ctx context.Context, in *QueryGetLongBookRequest, opts ...grpc.CallOption) (*QueryGetLongBookResponse, error) { - out := new(QueryGetLongBookResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/LongBook", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) LongBookAll(ctx context.Context, in *QueryAllLongBookRequest, opts ...grpc.CallOption) (*QueryAllLongBookResponse, error) { - out := new(QueryAllLongBookResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/LongBookAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ShortBook(ctx context.Context, in *QueryGetShortBookRequest, opts ...grpc.CallOption) (*QueryGetShortBookResponse, error) { - out := new(QueryGetShortBookResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/ShortBook", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ShortBookAll(ctx context.Context, in *QueryAllShortBookRequest, opts ...grpc.CallOption) (*QueryAllShortBookResponse, error) { - out := new(QueryAllShortBookResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/ShortBookAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetPrice(ctx context.Context, in *QueryGetPriceRequest, opts ...grpc.CallOption) (*QueryGetPriceResponse, error) { - out := new(QueryGetPriceResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetPrice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetLatestPrice(ctx context.Context, in *QueryGetLatestPriceRequest, opts ...grpc.CallOption) (*QueryGetLatestPriceResponse, error) { - out := new(QueryGetLatestPriceResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetLatestPrice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetPrices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) { - out := new(QueryGetPricesResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetPrices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetTwaps(ctx context.Context, in *QueryGetTwapsRequest, opts ...grpc.CallOption) (*QueryGetTwapsResponse, error) { - out := new(QueryGetTwapsResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetTwaps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AssetMetadata(ctx context.Context, in *QueryAssetMetadataRequest, opts ...grpc.CallOption) (*QueryAssetMetadataResponse, error) { - out := new(QueryAssetMetadataResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/AssetMetadata", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AssetList(ctx context.Context, in *QueryAssetListRequest, opts ...grpc.CallOption) (*QueryAssetListResponse, error) { - out := new(QueryAssetListResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/AssetList", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetRegisteredPairs(ctx context.Context, in *QueryRegisteredPairsRequest, opts ...grpc.CallOption) (*QueryRegisteredPairsResponse, error) { - out := new(QueryRegisteredPairsResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetRegisteredPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetRegisteredContract(ctx context.Context, in *QueryRegisteredContractRequest, opts ...grpc.CallOption) (*QueryRegisteredContractResponse, error) { - out := new(QueryRegisteredContractResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetRegisteredContract", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetOrders(ctx context.Context, in *QueryGetOrdersRequest, opts ...grpc.CallOption) (*QueryGetOrdersResponse, error) { - out := new(QueryGetOrdersResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetOrders", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetOrder(ctx context.Context, in *QueryGetOrderByIDRequest, opts ...grpc.CallOption) (*QueryGetOrderByIDResponse, error) { - out := new(QueryGetOrderByIDResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetOrder", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetHistoricalPrices(ctx context.Context, in *QueryGetHistoricalPricesRequest, opts ...grpc.CallOption) (*QueryGetHistoricalPricesResponse, error) { - out := new(QueryGetHistoricalPricesResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetHistoricalPrices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetMarketSummary(ctx context.Context, in *QueryGetMarketSummaryRequest, opts ...grpc.CallOption) (*QueryGetMarketSummaryResponse, error) { - out := new(QueryGetMarketSummaryResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetMarketSummary", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetOrderSimulation(ctx context.Context, in *QueryOrderSimulationRequest, opts ...grpc.CallOption) (*QueryOrderSimulationResponse, error) { - out := new(QueryOrderSimulationResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetOrderSimulation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetMatchResult(ctx context.Context, in *QueryGetMatchResultRequest, opts ...grpc.CallOption) (*QueryGetMatchResultResponse, error) { - out := new(QueryGetMatchResultResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetMatchResult", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetOrderCount(ctx context.Context, in *QueryGetOrderCountRequest, opts ...grpc.CallOption) (*QueryGetOrderCountResponse, error) { - out := new(QueryGetOrderCountResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Query/GetOrderCount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a LongBook by id. - LongBook(context.Context, *QueryGetLongBookRequest) (*QueryGetLongBookResponse, error) - // Queries a list of LongBook items. - LongBookAll(context.Context, *QueryAllLongBookRequest) (*QueryAllLongBookResponse, error) - // Queries a ShortBook by id. - ShortBook(context.Context, *QueryGetShortBookRequest) (*QueryGetShortBookResponse, error) - // Queries a list of ShortBook items. - ShortBookAll(context.Context, *QueryAllShortBookRequest) (*QueryAllShortBookResponse, error) - GetPrice(context.Context, *QueryGetPriceRequest) (*QueryGetPriceResponse, error) - GetLatestPrice(context.Context, *QueryGetLatestPriceRequest) (*QueryGetLatestPriceResponse, error) - GetPrices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) - GetTwaps(context.Context, *QueryGetTwapsRequest) (*QueryGetTwapsResponse, error) - // Returns the metadata for a specified denom / display type - AssetMetadata(context.Context, *QueryAssetMetadataRequest) (*QueryAssetMetadataResponse, error) - // Returns metadata for all the assets - AssetList(context.Context, *QueryAssetListRequest) (*QueryAssetListResponse, error) - // Returns all registered pairs for specified contract address - GetRegisteredPairs(context.Context, *QueryRegisteredPairsRequest) (*QueryRegisteredPairsResponse, error) - // Returns registered contract information - GetRegisteredContract(context.Context, *QueryRegisteredContractRequest) (*QueryRegisteredContractResponse, error) - GetOrders(context.Context, *QueryGetOrdersRequest) (*QueryGetOrdersResponse, error) - GetOrder(context.Context, *QueryGetOrderByIDRequest) (*QueryGetOrderByIDResponse, error) - GetHistoricalPrices(context.Context, *QueryGetHistoricalPricesRequest) (*QueryGetHistoricalPricesResponse, error) - GetMarketSummary(context.Context, *QueryGetMarketSummaryRequest) (*QueryGetMarketSummaryResponse, error) - GetOrderSimulation(context.Context, *QueryOrderSimulationRequest) (*QueryOrderSimulationResponse, error) - GetMatchResult(context.Context, *QueryGetMatchResultRequest) (*QueryGetMatchResultResponse, error) - GetOrderCount(context.Context, *QueryGetOrderCountRequest) (*QueryGetOrderCountResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) LongBook(ctx context.Context, req *QueryGetLongBookRequest) (*QueryGetLongBookResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LongBook not implemented") -} -func (*UnimplementedQueryServer) LongBookAll(ctx context.Context, req *QueryAllLongBookRequest) (*QueryAllLongBookResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LongBookAll not implemented") -} -func (*UnimplementedQueryServer) ShortBook(ctx context.Context, req *QueryGetShortBookRequest) (*QueryGetShortBookResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ShortBook not implemented") -} -func (*UnimplementedQueryServer) ShortBookAll(ctx context.Context, req *QueryAllShortBookRequest) (*QueryAllShortBookResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ShortBookAll not implemented") -} -func (*UnimplementedQueryServer) GetPrice(ctx context.Context, req *QueryGetPriceRequest) (*QueryGetPriceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPrice not implemented") -} -func (*UnimplementedQueryServer) GetLatestPrice(ctx context.Context, req *QueryGetLatestPriceRequest) (*QueryGetLatestPriceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLatestPrice not implemented") -} -func (*UnimplementedQueryServer) GetPrices(ctx context.Context, req *QueryGetPricesRequest) (*QueryGetPricesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPrices not implemented") -} -func (*UnimplementedQueryServer) GetTwaps(ctx context.Context, req *QueryGetTwapsRequest) (*QueryGetTwapsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTwaps not implemented") -} -func (*UnimplementedQueryServer) AssetMetadata(ctx context.Context, req *QueryAssetMetadataRequest) (*QueryAssetMetadataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AssetMetadata not implemented") -} -func (*UnimplementedQueryServer) AssetList(ctx context.Context, req *QueryAssetListRequest) (*QueryAssetListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AssetList not implemented") -} -func (*UnimplementedQueryServer) GetRegisteredPairs(ctx context.Context, req *QueryRegisteredPairsRequest) (*QueryRegisteredPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRegisteredPairs not implemented") -} -func (*UnimplementedQueryServer) GetRegisteredContract(ctx context.Context, req *QueryRegisteredContractRequest) (*QueryRegisteredContractResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRegisteredContract not implemented") -} -func (*UnimplementedQueryServer) GetOrders(ctx context.Context, req *QueryGetOrdersRequest) (*QueryGetOrdersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOrders not implemented") -} -func (*UnimplementedQueryServer) GetOrder(ctx context.Context, req *QueryGetOrderByIDRequest) (*QueryGetOrderByIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOrder not implemented") -} -func (*UnimplementedQueryServer) GetHistoricalPrices(ctx context.Context, req *QueryGetHistoricalPricesRequest) (*QueryGetHistoricalPricesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHistoricalPrices not implemented") -} -func (*UnimplementedQueryServer) GetMarketSummary(ctx context.Context, req *QueryGetMarketSummaryRequest) (*QueryGetMarketSummaryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMarketSummary not implemented") -} -func (*UnimplementedQueryServer) GetOrderSimulation(ctx context.Context, req *QueryOrderSimulationRequest) (*QueryOrderSimulationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOrderSimulation not implemented") -} -func (*UnimplementedQueryServer) GetMatchResult(ctx context.Context, req *QueryGetMatchResultRequest) (*QueryGetMatchResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMatchResult not implemented") -} -func (*UnimplementedQueryServer) GetOrderCount(ctx context.Context, req *QueryGetOrderCountRequest) (*QueryGetOrderCountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOrderCount not implemented") -} - -func RegisterQueryServer(s grpc1.Server, 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: "/seiprotocol.seichain.dex.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_LongBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetLongBookRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LongBook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/LongBook", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LongBook(ctx, req.(*QueryGetLongBookRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_LongBookAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllLongBookRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LongBookAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/LongBookAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LongBookAll(ctx, req.(*QueryAllLongBookRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ShortBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetShortBookRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ShortBook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/ShortBook", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ShortBook(ctx, req.(*QueryGetShortBookRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ShortBookAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllShortBookRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ShortBookAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/ShortBookAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ShortBookAll(ctx, req.(*QueryAllShortBookRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetPriceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetPrice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetPrice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetPrice(ctx, req.(*QueryGetPriceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetLatestPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetLatestPriceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetLatestPrice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetLatestPrice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetLatestPrice(ctx, req.(*QueryGetLatestPriceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetPrices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetPricesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetPrices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetPrices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetPrices(ctx, req.(*QueryGetPricesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetTwaps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetTwapsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetTwaps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetTwaps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTwaps(ctx, req.(*QueryGetTwapsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AssetMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAssetMetadataRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AssetMetadata(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/AssetMetadata", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AssetMetadata(ctx, req.(*QueryAssetMetadataRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AssetList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAssetListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AssetList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/AssetList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AssetList(ctx, req.(*QueryAssetListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetRegisteredPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRegisteredPairsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetRegisteredPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetRegisteredPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetRegisteredPairs(ctx, req.(*QueryRegisteredPairsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetRegisteredContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRegisteredContractRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetRegisteredContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetRegisteredContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetRegisteredContract(ctx, req.(*QueryRegisteredContractRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetOrdersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetOrders(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetOrders", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetOrders(ctx, req.(*QueryGetOrdersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetOrderByIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetOrder(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetOrder", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetOrder(ctx, req.(*QueryGetOrderByIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetHistoricalPrices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetHistoricalPricesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetHistoricalPrices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetHistoricalPrices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetHistoricalPrices(ctx, req.(*QueryGetHistoricalPricesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetMarketSummary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetMarketSummaryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetMarketSummary(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetMarketSummary", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetMarketSummary(ctx, req.(*QueryGetMarketSummaryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetOrderSimulation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryOrderSimulationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetOrderSimulation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetOrderSimulation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetOrderSimulation(ctx, req.(*QueryOrderSimulationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetMatchResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetMatchResultRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetMatchResult(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetMatchResult", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetMatchResult(ctx, req.(*QueryGetMatchResultRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetOrderCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetOrderCountRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetOrderCount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Query/GetOrderCount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetOrderCount(ctx, req.(*QueryGetOrderCountRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "seiprotocol.seichain.dex.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "LongBook", - Handler: _Query_LongBook_Handler, - }, - { - MethodName: "LongBookAll", - Handler: _Query_LongBookAll_Handler, - }, - { - MethodName: "ShortBook", - Handler: _Query_ShortBook_Handler, - }, - { - MethodName: "ShortBookAll", - Handler: _Query_ShortBookAll_Handler, - }, - { - MethodName: "GetPrice", - Handler: _Query_GetPrice_Handler, - }, - { - MethodName: "GetLatestPrice", - Handler: _Query_GetLatestPrice_Handler, - }, - { - MethodName: "GetPrices", - Handler: _Query_GetPrices_Handler, - }, - { - MethodName: "GetTwaps", - Handler: _Query_GetTwaps_Handler, - }, - { - MethodName: "AssetMetadata", - Handler: _Query_AssetMetadata_Handler, - }, - { - MethodName: "AssetList", - Handler: _Query_AssetList_Handler, - }, - { - MethodName: "GetRegisteredPairs", - Handler: _Query_GetRegisteredPairs_Handler, - }, - { - MethodName: "GetRegisteredContract", - Handler: _Query_GetRegisteredContract_Handler, - }, - { - MethodName: "GetOrders", - Handler: _Query_GetOrders_Handler, - }, - { - MethodName: "GetOrder", - Handler: _Query_GetOrder_Handler, - }, - { - MethodName: "GetHistoricalPrices", - Handler: _Query_GetHistoricalPrices_Handler, - }, - { - MethodName: "GetMarketSummary", - Handler: _Query_GetMarketSummary_Handler, - }, - { - MethodName: "GetOrderSimulation", - Handler: _Query_GetOrderSimulation_Handler, - }, - { - MethodName: "GetMatchResult", - Handler: _Query_GetMatchResult_Handler, - }, - { - MethodName: "GetOrderCount", - Handler: _Query_GetOrderCount_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "dex/query.proto", -} - -func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryGetLongBookRequest) 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 *QueryGetLongBookRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetLongBookRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x22 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if len(m.Price) > 0 { - i -= len(m.Price) - copy(dAtA[i:], m.Price) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Price))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetLongBookResponse) 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 *QueryGetLongBookResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetLongBookResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.LongBook.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAllLongBookRequest) 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 *QueryAllLongBookRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllLongBookRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x22 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllLongBookResponse) 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 *QueryAllLongBookResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllLongBookResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.LongBook) > 0 { - for iNdEx := len(m.LongBook) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LongBook[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetShortBookRequest) 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 *QueryGetShortBookRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetShortBookRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x22 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if len(m.Price) > 0 { - i -= len(m.Price) - copy(dAtA[i:], m.Price) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Price))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetShortBookResponse) 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 *QueryGetShortBookResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetShortBookResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ShortBook.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAllShortBookRequest) 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 *QueryAllShortBookRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllShortBookRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x22 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllShortBookResponse) 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 *QueryAllShortBookResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllShortBookResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ShortBook) > 0 { - for iNdEx := len(m.ShortBook) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ShortBook[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetPricesRequest) 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 *QueryGetPricesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetPricesResponse) 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 *QueryGetPricesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Prices) > 0 { - for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetPriceRequest) 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 *QueryGetPriceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetPriceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x20 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetPriceResponse) 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 *QueryGetPriceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Found { - i-- - if m.Found { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Price != nil { - { - size, err := m.Price.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetLatestPriceRequest) 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 *QueryGetLatestPriceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetLatestPriceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetLatestPriceResponse) 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 *QueryGetLatestPriceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetLatestPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Price != nil { - { - size, err := m.Price.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetTwapsRequest) 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 *QueryGetTwapsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetTwapsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LookbackSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.LookbackSeconds)) - i-- - dAtA[i] = 0x10 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetTwapsResponse) 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 *QueryGetTwapsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetTwapsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Twaps) > 0 { - for iNdEx := len(m.Twaps) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Twaps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetListRequest) 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 *QueryAssetListRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryAssetListResponse) 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 *QueryAssetListResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetList) > 0 { - for iNdEx := len(m.AssetList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AssetList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetMetadataRequest) 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 *QueryAssetMetadataRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetMetadataResponse) 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 *QueryAssetMetadataResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryRegisteredPairsRequest) 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 *QueryRegisteredPairsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRegisteredPairsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryRegisteredPairsResponse) 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 *QueryRegisteredPairsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRegisteredPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Pairs) > 0 { - for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryRegisteredContractRequest) 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 *QueryRegisteredContractRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRegisteredContractRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryRegisteredContractResponse) 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 *QueryRegisteredContractResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRegisteredContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ContractInfo != nil { - { - size, err := m.ContractInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetOrdersRequest) 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 *QueryGetOrdersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetOrdersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Account) > 0 { - i -= len(m.Account) - copy(dAtA[i:], m.Account) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Account))) - i-- - dAtA[i] = 0x12 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetOrdersResponse) 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 *QueryGetOrdersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Orders) > 0 { - for iNdEx := len(m.Orders) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Orders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetOrderByIDRequest) 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 *QueryGetOrderByIDRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetOrderByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x20 - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetOrderByIDResponse) 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 *QueryGetOrderByIDResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetOrderByIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Order != nil { - { - size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetHistoricalPricesRequest) 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 *QueryGetHistoricalPricesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetHistoricalPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumOfPeriods != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.NumOfPeriods)) - i-- - dAtA[i] = 0x28 - } - if m.PeriodLengthInSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PeriodLengthInSeconds)) - i-- - dAtA[i] = 0x20 - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetHistoricalPricesResponse) 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 *QueryGetHistoricalPricesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetHistoricalPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Prices) > 0 { - for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetMarketSummaryRequest) 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 *QueryGetMarketSummaryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetMarketSummaryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LookbackInSeconds != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.LookbackInSeconds)) - i-- - dAtA[i] = 0x20 - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetMarketSummaryResponse) 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 *QueryGetMarketSummaryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetMarketSummaryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastPrice != nil { - { - size := m.LastPrice.Size() - i -= size - if _, err := m.LastPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.LowPrice != nil { - { - size := m.LowPrice.Size() - i -= size - if _, err := m.LowPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.HighPrice != nil { - { - size := m.HighPrice.Size() - i -= size - if _, err := m.HighPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.TotalVolumeNotional != nil { - { - size := m.TotalVolumeNotional.Size() - i -= size - if _, err := m.TotalVolumeNotional.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.TotalVolume != nil { - { - size := m.TotalVolume.Size() - i -= size - if _, err := m.TotalVolume.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryOrderSimulationRequest) 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 *QueryOrderSimulationRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryOrderSimulationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if m.Order != nil { - { - size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryOrderSimulationResponse) 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 *QueryOrderSimulationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryOrderSimulationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ExecutedQuantity != nil { - { - size := m.ExecutedQuantity.Size() - i -= size - if _, err := m.ExecutedQuantity.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetMatchResultRequest) 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 *QueryGetMatchResultRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetMatchResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetMatchResultResponse) 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 *QueryGetMatchResultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetMatchResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetOrderCountRequest) 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 *QueryGetOrderCountRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetOrderCountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PositionDirection != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PositionDirection)) - i-- - dAtA[i] = 0x28 - } - if m.Price != nil { - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetOrderCountResponse) 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 *QueryGetOrderCountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetOrderCountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Count != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Count)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryGetLongBookRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Price) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetLongBookResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.LongBook.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllLongBookRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllLongBookResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.LongBook) > 0 { - for _, e := range m.LongBook { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetShortBookRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Price) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetShortBookResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ShortBook.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllShortBookRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllShortBookResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ShortBook) > 0 { - for _, e := range m.ShortBook { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetPricesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetPricesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Prices) > 0 { - for _, e := range m.Prices { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryGetPriceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Timestamp != 0 { - n += 1 + sovQuery(uint64(m.Timestamp)) - } - return n -} - -func (m *QueryGetPriceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Price != nil { - l = m.Price.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Found { - n += 2 - } - return n -} - -func (m *QueryGetLatestPriceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetLatestPriceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Price != nil { - l = m.Price.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetTwapsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.LookbackSeconds != 0 { - n += 1 + sovQuery(uint64(m.LookbackSeconds)) - } - return n -} - -func (m *QueryGetTwapsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Twaps) > 0 { - for _, e := range m.Twaps { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryAssetListRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryAssetListResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.AssetList) > 0 { - for _, e := range m.AssetList { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryAssetMetadataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAssetMetadataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryRegisteredPairsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryRegisteredPairsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Pairs) > 0 { - for _, e := range m.Pairs { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryRegisteredContractRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryRegisteredContractResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ContractInfo != nil { - l = m.ContractInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetOrdersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Account) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetOrdersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Orders) > 0 { - for _, e := range m.Orders { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryGetOrderByIDRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - return n -} - -func (m *QueryGetOrderByIDResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Order != nil { - l = m.Order.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetHistoricalPricesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.PeriodLengthInSeconds != 0 { - n += 1 + sovQuery(uint64(m.PeriodLengthInSeconds)) - } - if m.NumOfPeriods != 0 { - n += 1 + sovQuery(uint64(m.NumOfPeriods)) - } - return n -} - -func (m *QueryGetHistoricalPricesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Prices) > 0 { - for _, e := range m.Prices { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryGetMarketSummaryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.LookbackInSeconds != 0 { - n += 1 + sovQuery(uint64(m.LookbackInSeconds)) - } - return n -} - -func (m *QueryGetMarketSummaryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TotalVolume != nil { - l = m.TotalVolume.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.TotalVolumeNotional != nil { - l = m.TotalVolumeNotional.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.HighPrice != nil { - l = m.HighPrice.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.LowPrice != nil { - l = m.LowPrice.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.LastPrice != nil { - l = m.LastPrice.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryOrderSimulationRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Order != nil { - l = m.Order.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryOrderSimulationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ExecutedQuantity != nil { - l = m.ExecutedQuantity.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetMatchResultRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetMatchResultResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - l = m.Result.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetOrderCountRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Price != nil { - l = m.Price.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.PositionDirection != 0 { - n += 1 + sovQuery(uint64(m.PositionDirection)) - } - return n -} - -func (m *QueryGetOrderCountResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Count != 0 { - n += 1 + sovQuery(uint64(m.Count)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) 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 ErrIntOverflowQuery - } - 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsResponse) 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 ErrIntOverflowQuery - } - 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: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetLongBookRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetLongBookRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetLongBookRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Price = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetLongBookResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetLongBookResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetLongBookResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LongBook", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LongBook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllLongBookRequest) 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 ErrIntOverflowQuery - } - 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: QueryAllLongBookRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLongBookRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllLongBookResponse) 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 ErrIntOverflowQuery - } - 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: QueryAllLongBookResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLongBookResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LongBook", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LongBook = append(m.LongBook, LongBook{}) - if err := m.LongBook[len(m.LongBook)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetShortBookRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetShortBookRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetShortBookRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Price = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetShortBookResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetShortBookResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetShortBookResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShortBook", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShortBook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllShortBookRequest) 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 ErrIntOverflowQuery - } - 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: QueryAllShortBookRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllShortBookRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllShortBookResponse) 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 ErrIntOverflowQuery - } - 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: QueryAllShortBookResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllShortBookResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShortBook", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShortBook = append(m.ShortBook, ShortBook{}) - if err := m.ShortBook[len(m.ShortBook)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetPricesRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetPricesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetPricesResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetPricesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Prices = append(m.Prices, &Price{}) - if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetPriceRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetPriceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPriceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetPriceResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetPriceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Price == nil { - m.Price = &Price{} - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Found", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Found = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetLatestPriceRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetLatestPriceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetLatestPriceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetLatestPriceResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetLatestPriceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetLatestPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Price == nil { - m.Price = &Price{} - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetTwapsRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetTwapsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTwapsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LookbackSeconds", wireType) - } - m.LookbackSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LookbackSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetTwapsResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetTwapsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetTwapsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Twaps", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Twaps = append(m.Twaps, &Twap{}) - if err := m.Twaps[len(m.Twaps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetListRequest) 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 ErrIntOverflowQuery - } - 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: QueryAssetListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetListResponse) 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 ErrIntOverflowQuery - } - 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: QueryAssetListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetList = append(m.AssetList, AssetMetadata{}) - if err := m.AssetList[len(m.AssetList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetMetadataRequest) 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 ErrIntOverflowQuery - } - 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: QueryAssetMetadataRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetMetadataResponse) 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 ErrIntOverflowQuery - } - 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: QueryAssetMetadataResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &AssetMetadata{} - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryRegisteredPairsRequest) 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 ErrIntOverflowQuery - } - 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: QueryRegisteredPairsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRegisteredPairsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryRegisteredPairsResponse) 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 ErrIntOverflowQuery - } - 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: QueryRegisteredPairsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRegisteredPairsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Pairs = append(m.Pairs, Pair{}) - if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryRegisteredContractRequest) 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 ErrIntOverflowQuery - } - 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: QueryRegisteredContractRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRegisteredContractRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryRegisteredContractResponse) 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 ErrIntOverflowQuery - } - 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: QueryRegisteredContractResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRegisteredContractResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ContractInfo == nil { - m.ContractInfo = &ContractInfoV2{} - } - if err := m.ContractInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetOrdersRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetOrdersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetOrdersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Account = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetOrdersResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetOrdersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetOrdersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Orders", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Orders = append(m.Orders, &Order{}) - if err := m.Orders[len(m.Orders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetOrderByIDRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetOrderByIDRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetOrderByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetOrderByIDResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetOrderByIDResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetOrderByIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Order == nil { - m.Order = &Order{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetHistoricalPricesRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetHistoricalPricesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetHistoricalPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PeriodLengthInSeconds", wireType) - } - m.PeriodLengthInSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PeriodLengthInSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumOfPeriods", wireType) - } - m.NumOfPeriods = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumOfPeriods |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetHistoricalPricesResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetHistoricalPricesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetHistoricalPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Prices = append(m.Prices, &PriceCandlestick{}) - if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetMarketSummaryRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetMarketSummaryRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetMarketSummaryRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LookbackInSeconds", wireType) - } - m.LookbackInSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LookbackInSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetMarketSummaryResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetMarketSummaryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetMarketSummaryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalVolume", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.TotalVolume = &v - if err := m.TotalVolume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalVolumeNotional", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.TotalVolumeNotional = &v - if err := m.TotalVolumeNotional.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HighPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.HighPrice = &v - if err := m.HighPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LowPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.LowPrice = &v - if err := m.LowPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.LastPrice = &v - if err := m.LastPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryOrderSimulationRequest) 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 ErrIntOverflowQuery - } - 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: QueryOrderSimulationRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOrderSimulationRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Order == nil { - m.Order = &Order{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryOrderSimulationResponse) 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 ErrIntOverflowQuery - } - 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: QueryOrderSimulationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOrderSimulationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedQuantity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.ExecutedQuantity = &v - if err := m.ExecutedQuantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetMatchResultRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetMatchResultRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetMatchResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetMatchResultResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetMatchResultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetMatchResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Result == nil { - m.Result = &MatchResult{} - } - if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetOrderCountRequest) 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 ErrIntOverflowQuery - } - 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: QueryGetOrderCountRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetOrderCountRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.Price = &v - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PositionDirection", wireType) - } - m.PositionDirection = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PositionDirection |= PositionDirection(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetOrderCountResponse) 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 ErrIntOverflowQuery - } - 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: QueryGetOrderCountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetOrderCountResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/query.pb.gw.go b/x/dex/types/query.pb.gw.go deleted file mode 100644 index d7d13cf88..000000000 --- a/x/dex/types/query.pb.gw.go +++ /dev/null @@ -1,2389 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: dex/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_LongBook_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetLongBookRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["price"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "price") - } - - protoReq.Price, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "price", err) - } - - msg, err := client.LongBook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_LongBook_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetLongBookRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["price"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "price") - } - - protoReq.Price, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "price", err) - } - - msg, err := server.LongBook(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_LongBookAll_0 = &utilities.DoubleArray{Encoding: map[string]int{"contractAddr": 0, "priceDenom": 1, "assetDenom": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} -) - -func request_Query_LongBookAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllLongBookRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LongBookAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.LongBookAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_LongBookAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllLongBookRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LongBookAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.LongBookAll(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ShortBook_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetShortBookRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["price"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "price") - } - - protoReq.Price, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "price", err) - } - - msg, err := client.ShortBook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ShortBook_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetShortBookRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["price"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "price") - } - - protoReq.Price, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "price", err) - } - - msg, err := server.ShortBook(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_ShortBookAll_0 = &utilities.DoubleArray{Encoding: map[string]int{"contractAddr": 0, "priceDenom": 1, "assetDenom": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} -) - -func request_Query_ShortBookAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllShortBookRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ShortBookAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ShortBookAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ShortBookAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllShortBookRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ShortBookAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ShortBookAll(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetPrice_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetPriceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["timestamp"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "timestamp") - } - - protoReq.Timestamp, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "timestamp", err) - } - - msg, err := client.GetPrice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetPrice_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetPriceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["timestamp"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "timestamp") - } - - protoReq.Timestamp, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "timestamp", err) - } - - msg, err := server.GetPrice(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetLatestPrice_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetLatestPriceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - msg, err := client.GetLatestPrice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetLatestPrice_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetLatestPriceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - msg, err := server.GetLatestPrice(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetPrices_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetPricesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - msg, err := client.GetPrices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetPrices_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetPricesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - msg, err := server.GetPrices(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetTwaps_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTwapsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["lookbackSeconds"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lookbackSeconds") - } - - protoReq.LookbackSeconds, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lookbackSeconds", err) - } - - msg, err := client.GetTwaps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetTwaps_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetTwapsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["lookbackSeconds"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lookbackSeconds") - } - - protoReq.LookbackSeconds, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lookbackSeconds", err) - } - - msg, err := server.GetTwaps(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_AssetMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetMetadataRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - msg, err := client.AssetMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AssetMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetMetadataRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - msg, err := server.AssetMetadata(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_AssetList_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetListRequest - var metadata runtime.ServerMetadata - - msg, err := client.AssetList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AssetList_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetListRequest - var metadata runtime.ServerMetadata - - msg, err := server.AssetList(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_GetRegisteredPairs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_GetRegisteredPairs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRegisteredPairsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetRegisteredPairs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetRegisteredPairs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetRegisteredPairs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRegisteredPairsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetRegisteredPairs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetRegisteredPairs(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetRegisteredContract_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRegisteredContractRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - msg, err := client.GetRegisteredContract(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetRegisteredContract_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRegisteredContractRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - msg, err := server.GetRegisteredContract(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetOrders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetOrdersRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["account"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account") - } - - protoReq.Account, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account", err) - } - - msg, err := client.GetOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetOrders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetOrdersRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["account"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account") - } - - protoReq.Account, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account", err) - } - - msg, err := server.GetOrders(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetOrder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetOrderByIDRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.GetOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetOrder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetOrderByIDRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.GetOrder(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetHistoricalPrices_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetHistoricalPricesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["periodLengthInSeconds"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "periodLengthInSeconds") - } - - protoReq.PeriodLengthInSeconds, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "periodLengthInSeconds", err) - } - - val, ok = pathParams["numOfPeriods"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "numOfPeriods") - } - - protoReq.NumOfPeriods, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "numOfPeriods", err) - } - - msg, err := client.GetHistoricalPrices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetHistoricalPrices_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetHistoricalPricesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["periodLengthInSeconds"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "periodLengthInSeconds") - } - - protoReq.PeriodLengthInSeconds, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "periodLengthInSeconds", err) - } - - val, ok = pathParams["numOfPeriods"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "numOfPeriods") - } - - protoReq.NumOfPeriods, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "numOfPeriods", err) - } - - msg, err := server.GetHistoricalPrices(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetMarketSummary_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetMarketSummaryRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["lookbackInSeconds"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lookbackInSeconds") - } - - protoReq.LookbackInSeconds, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lookbackInSeconds", err) - } - - msg, err := client.GetMarketSummary(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetMarketSummary_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetMarketSummaryRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["contractAddr"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contractAddr") - } - - protoReq.ContractAddr, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contractAddr", err) - } - - val, ok = pathParams["priceDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "priceDenom") - } - - protoReq.PriceDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "priceDenom", err) - } - - val, ok = pathParams["assetDenom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "assetDenom") - } - - protoReq.AssetDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "assetDenom", err) - } - - val, ok = pathParams["lookbackInSeconds"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lookbackInSeconds") - } - - protoReq.LookbackInSeconds, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lookbackInSeconds", err) - } - - msg, err := server.GetMarketSummary(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_LongBook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_LongBook_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_LongBook_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_LongBookAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_LongBookAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_LongBookAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ShortBook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ShortBook_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ShortBook_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ShortBookAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ShortBookAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ShortBookAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetPrice_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetLatestPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetLatestPrice_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetLatestPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetPrices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetPrices_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetPrices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetTwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetTwaps_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetTwaps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AssetMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AssetMetadata_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AssetMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AssetList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AssetList_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AssetList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetRegisteredPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetRegisteredPairs_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetRegisteredPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetRegisteredContract_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetRegisteredContract_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetRegisteredContract_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetOrders_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetOrder_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetHistoricalPrices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetHistoricalPrices_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetHistoricalPrices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetMarketSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetMarketSummary_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetMarketSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_LongBook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_LongBook_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_LongBook_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_LongBookAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_LongBookAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_LongBookAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ShortBook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ShortBook_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ShortBook_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ShortBookAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ShortBookAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ShortBookAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetPrice_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetLatestPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetLatestPrice_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetLatestPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetPrices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetPrices_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetPrices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetTwaps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetTwaps_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetTwaps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AssetMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AssetMetadata_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AssetMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AssetList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AssetList_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AssetList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetRegisteredPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetRegisteredPairs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetRegisteredPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetRegisteredContract_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetRegisteredContract_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetRegisteredContract_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetOrders_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetOrder_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetHistoricalPrices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetHistoricalPrices_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetHistoricalPrices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetMarketSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetMarketSummary_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetMarketSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sei-protocol", "seichain", "dex", "params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_LongBook_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, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"sei-protocol", "seichain", "dex", "long_book", "contractAddr", "priceDenom", "assetDenom", "price"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_LongBookAll_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, 1, 0, 4, 1, 5, 6}, []string{"sei-protocol", "seichain", "dex", "long_book", "contractAddr", "priceDenom", "assetDenom"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_ShortBook_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, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"sei-protocol", "seichain", "dex", "short_book", "contractAddr", "priceDenom", "assetDenom", "price"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_ShortBookAll_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, 1, 0, 4, 1, 5, 6}, []string{"sei-protocol", "seichain", "dex", "short_book", "contractAddr", "priceDenom", "assetDenom"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetPrice_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, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"sei-protocol", "seichain", "dex", "get_price", "contractAddr", "priceDenom", "assetDenom", "timestamp"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetLatestPrice_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, 1, 0, 4, 1, 5, 6}, []string{"sei-protocol", "seichain", "dex", "get_latest_price", "contractAddr", "priceDenom", "assetDenom"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetPrices_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, 1, 0, 4, 1, 5, 6}, []string{"sei-protocol", "seichain", "dex", "get_prices", "contractAddr", "priceDenom", "assetDenom"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetTwaps_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{"sei-protocol", "seichain", "dex", "get_twaps", "contractAddr", "lookbackSeconds"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_AssetMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sei-protocol", "seichain", "dex", "asset_list", "denom"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_AssetList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sei-protocol", "seichain", "dex", "asset_list"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetRegisteredPairs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sei-protocol", "seichain", "dex", "registered_pairs"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetRegisteredContract_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sei-protocol", "seichain", "dex", "registered_contract", "contractAddr"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetOrders_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{"sei-protocol", "seichain", "dex", "get_orders", "contractAddr", "account"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetOrder_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, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"sei-protocol", "seichain", "dex", "get_order_by_id", "contractAddr", "priceDenom", "assetDenom", "id"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetHistoricalPrices_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, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7, 1, 0, 4, 1, 5, 8}, []string{"sei-protocol", "seichain", "dex", "get_historical_prices", "contractAddr", "priceDenom", "assetDenom", "periodLengthInSeconds", "numOfPeriods"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_GetMarketSummary_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, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"sei-protocol", "seichain", "dex", "get_market_summary", "contractAddr", "priceDenom", "assetDenom", "lookbackInSeconds"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_LongBook_0 = runtime.ForwardResponseMessage - - forward_Query_LongBookAll_0 = runtime.ForwardResponseMessage - - forward_Query_ShortBook_0 = runtime.ForwardResponseMessage - - forward_Query_ShortBookAll_0 = runtime.ForwardResponseMessage - - forward_Query_GetPrice_0 = runtime.ForwardResponseMessage - - forward_Query_GetLatestPrice_0 = runtime.ForwardResponseMessage - - forward_Query_GetPrices_0 = runtime.ForwardResponseMessage - - forward_Query_GetTwaps_0 = runtime.ForwardResponseMessage - - forward_Query_AssetMetadata_0 = runtime.ForwardResponseMessage - - forward_Query_AssetList_0 = runtime.ForwardResponseMessage - - forward_Query_GetRegisteredPairs_0 = runtime.ForwardResponseMessage - - forward_Query_GetRegisteredContract_0 = runtime.ForwardResponseMessage - - forward_Query_GetOrders_0 = runtime.ForwardResponseMessage - - forward_Query_GetOrder_0 = runtime.ForwardResponseMessage - - forward_Query_GetHistoricalPrices_0 = runtime.ForwardResponseMessage - - forward_Query_GetMarketSummary_0 = runtime.ForwardResponseMessage -) diff --git a/x/dex/types/settlement.go b/x/dex/types/settlement.go deleted file mode 100644 index ee3d3378e..000000000 --- a/x/dex/types/settlement.go +++ /dev/null @@ -1,36 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -type SudoSettlementMsg struct { - Settlement Settlements `json:"settlement"` -} - -func NewSettlementEntry( - ctx sdk.Context, - orderID uint64, - account string, - direction PositionDirection, - priceDenom string, - assetDenom string, - quantity sdk.Dec, - executionCostOrProceed sdk.Dec, - expectedCostOrProceed sdk.Dec, - orderType OrderType, -) *SettlementEntry { - return &SettlementEntry{ - OrderId: orderID, - PositionDirection: GetContractPositionDirection(direction), - PriceDenom: priceDenom, - AssetDenom: assetDenom, - Quantity: quantity, - ExecutionCostOrProceed: executionCostOrProceed, - ExpectedCostOrProceed: expectedCostOrProceed, - Account: account, - OrderType: GetContractOrderType(orderType), - Timestamp: uint64(ctx.BlockTime().Unix()), - Height: uint64(ctx.BlockHeight()), - } -} diff --git a/x/dex/types/settlement.pb.go b/x/dex/types/settlement.pb.go deleted file mode 100644 index 0df73a0cc..000000000 --- a/x/dex/types/settlement.pb.go +++ /dev/null @@ -1,1044 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/settlement.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type SettlementEntry struct { - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` - PriceDenom string `protobuf:"bytes,2,opt,name=priceDenom,proto3" json:"price_denom"` - AssetDenom string `protobuf:"bytes,3,opt,name=assetDenom,proto3" json:"asset_denom"` - Quantity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=quantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quantity" yaml:"quantity"` - ExecutionCostOrProceed github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=executionCostOrProceed,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"execution_cost_or_proceed" yaml:"execution_cost_or_proceed"` - ExpectedCostOrProceed github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=expectedCostOrProceed,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"expected_cost_or_proceed" yaml:"expected_cost_or_proceed"` - PositionDirection string `protobuf:"bytes,7,opt,name=positionDirection,proto3" json:"position_direction"` - OrderType string `protobuf:"bytes,8,opt,name=orderType,proto3" json:"order_type"` - OrderId uint64 `protobuf:"varint,9,opt,name=orderId,proto3" json:"order_id"` - Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp"` - Height uint64 `protobuf:"varint,11,opt,name=height,proto3" json:"height"` - SettlementId uint64 `protobuf:"varint,12,opt,name=settlementId,proto3" json:"settlement_id"` -} - -func (m *SettlementEntry) Reset() { *m = SettlementEntry{} } -func (m *SettlementEntry) String() string { return proto.CompactTextString(m) } -func (*SettlementEntry) ProtoMessage() {} -func (*SettlementEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_c24d83c09612bb1c, []int{0} -} -func (m *SettlementEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SettlementEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SettlementEntry.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 *SettlementEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_SettlementEntry.Merge(m, src) -} -func (m *SettlementEntry) XXX_Size() int { - return m.Size() -} -func (m *SettlementEntry) XXX_DiscardUnknown() { - xxx_messageInfo_SettlementEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_SettlementEntry proto.InternalMessageInfo - -func (m *SettlementEntry) GetAccount() string { - if m != nil { - return m.Account - } - return "" -} - -func (m *SettlementEntry) GetPriceDenom() string { - if m != nil { - return m.PriceDenom - } - return "" -} - -func (m *SettlementEntry) GetAssetDenom() string { - if m != nil { - return m.AssetDenom - } - return "" -} - -func (m *SettlementEntry) GetPositionDirection() string { - if m != nil { - return m.PositionDirection - } - return "" -} - -func (m *SettlementEntry) GetOrderType() string { - if m != nil { - return m.OrderType - } - return "" -} - -func (m *SettlementEntry) GetOrderId() uint64 { - if m != nil { - return m.OrderId - } - return 0 -} - -func (m *SettlementEntry) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *SettlementEntry) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *SettlementEntry) GetSettlementId() uint64 { - if m != nil { - return m.SettlementId - } - return 0 -} - -type Settlements struct { - Epoch int64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch"` - Entries []*SettlementEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries"` -} - -func (m *Settlements) Reset() { *m = Settlements{} } -func (m *Settlements) String() string { return proto.CompactTextString(m) } -func (*Settlements) ProtoMessage() {} -func (*Settlements) Descriptor() ([]byte, []int) { - return fileDescriptor_c24d83c09612bb1c, []int{1} -} -func (m *Settlements) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Settlements) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Settlements.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 *Settlements) XXX_Merge(src proto.Message) { - xxx_messageInfo_Settlements.Merge(m, src) -} -func (m *Settlements) XXX_Size() int { - return m.Size() -} -func (m *Settlements) XXX_DiscardUnknown() { - xxx_messageInfo_Settlements.DiscardUnknown(m) -} - -var xxx_messageInfo_Settlements proto.InternalMessageInfo - -func (m *Settlements) GetEpoch() int64 { - if m != nil { - return m.Epoch - } - return 0 -} - -func (m *Settlements) GetEntries() []*SettlementEntry { - if m != nil { - return m.Entries - } - return nil -} - -func init() { - proto.RegisterType((*SettlementEntry)(nil), "seiprotocol.seichain.dex.SettlementEntry") - proto.RegisterType((*Settlements)(nil), "seiprotocol.seichain.dex.Settlements") -} - -func init() { proto.RegisterFile("dex/settlement.proto", fileDescriptor_c24d83c09612bb1c) } - -var fileDescriptor_c24d83c09612bb1c = []byte{ - // 584 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x3f, 0x6f, 0xdb, 0x3c, - 0x10, 0xc6, 0xad, 0xfc, 0xb1, 0x63, 0x3a, 0x79, 0x83, 0x10, 0x79, 0x03, 0xb6, 0x83, 0x68, 0x08, -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 0x96, 0x04, 0x00, 0x00, -} - -func (m *SettlementEntry) 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 *SettlementEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SettlementEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SettlementId != 0 { - i = encodeVarintSettlement(dAtA, i, uint64(m.SettlementId)) - i-- - dAtA[i] = 0x60 - } - if m.Height != 0 { - i = encodeVarintSettlement(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x58 - } - if m.Timestamp != 0 { - i = encodeVarintSettlement(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x50 - } - if m.OrderId != 0 { - i = encodeVarintSettlement(dAtA, i, uint64(m.OrderId)) - i-- - dAtA[i] = 0x48 - } - if len(m.OrderType) > 0 { - i -= len(m.OrderType) - copy(dAtA[i:], m.OrderType) - i = encodeVarintSettlement(dAtA, i, uint64(len(m.OrderType))) - i-- - dAtA[i] = 0x42 - } - if len(m.PositionDirection) > 0 { - i -= len(m.PositionDirection) - copy(dAtA[i:], m.PositionDirection) - i = encodeVarintSettlement(dAtA, i, uint64(len(m.PositionDirection))) - i-- - dAtA[i] = 0x3a - } - { - size := m.ExpectedCostOrProceed.Size() - i -= size - if _, err := m.ExpectedCostOrProceed.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintSettlement(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.ExecutionCostOrProceed.Size() - i -= size - if _, err := m.ExecutionCostOrProceed.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintSettlement(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.Quantity.Size() - i -= size - if _, err := m.Quantity.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintSettlement(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.AssetDenom) > 0 { - i -= len(m.AssetDenom) - copy(dAtA[i:], m.AssetDenom) - i = encodeVarintSettlement(dAtA, i, uint64(len(m.AssetDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.PriceDenom) > 0 { - i -= len(m.PriceDenom) - copy(dAtA[i:], m.PriceDenom) - i = encodeVarintSettlement(dAtA, i, uint64(len(m.PriceDenom))) - i-- - dAtA[i] = 0x12 - } - if len(m.Account) > 0 { - i -= len(m.Account) - copy(dAtA[i:], m.Account) - i = encodeVarintSettlement(dAtA, i, uint64(len(m.Account))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Settlements) 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 *Settlements) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Settlements) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Entries) > 0 { - for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSettlement(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Epoch != 0 { - i = encodeVarintSettlement(dAtA, i, uint64(m.Epoch)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintSettlement(dAtA []byte, offset int, v uint64) int { - offset -= sovSettlement(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SettlementEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Account) - if l > 0 { - n += 1 + l + sovSettlement(uint64(l)) - } - l = len(m.PriceDenom) - if l > 0 { - n += 1 + l + sovSettlement(uint64(l)) - } - l = len(m.AssetDenom) - if l > 0 { - n += 1 + l + sovSettlement(uint64(l)) - } - l = m.Quantity.Size() - n += 1 + l + sovSettlement(uint64(l)) - l = m.ExecutionCostOrProceed.Size() - n += 1 + l + sovSettlement(uint64(l)) - l = m.ExpectedCostOrProceed.Size() - n += 1 + l + sovSettlement(uint64(l)) - l = len(m.PositionDirection) - if l > 0 { - n += 1 + l + sovSettlement(uint64(l)) - } - l = len(m.OrderType) - if l > 0 { - n += 1 + l + sovSettlement(uint64(l)) - } - if m.OrderId != 0 { - n += 1 + sovSettlement(uint64(m.OrderId)) - } - if m.Timestamp != 0 { - n += 1 + sovSettlement(uint64(m.Timestamp)) - } - if m.Height != 0 { - n += 1 + sovSettlement(uint64(m.Height)) - } - if m.SettlementId != 0 { - n += 1 + sovSettlement(uint64(m.SettlementId)) - } - return n -} - -func (m *Settlements) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Epoch != 0 { - n += 1 + sovSettlement(uint64(m.Epoch)) - } - if len(m.Entries) > 0 { - for _, e := range m.Entries { - l = e.Size() - n += 1 + l + sovSettlement(uint64(l)) - } - } - return n -} - -func sovSettlement(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSettlement(x uint64) (n int) { - return sovSettlement(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SettlementEntry) 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 ErrIntOverflowSettlement - } - 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: SettlementEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SettlementEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - 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 ErrInvalidLengthSettlement - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Account = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - 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 ErrInvalidLengthSettlement - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - 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 ErrInvalidLengthSettlement - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - 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 ErrInvalidLengthSettlement - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutionCostOrProceed", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - 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 ErrInvalidLengthSettlement - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExecutionCostOrProceed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpectedCostOrProceed", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - 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 ErrInvalidLengthSettlement - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExpectedCostOrProceed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PositionDirection", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - 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 ErrInvalidLengthSettlement - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PositionDirection = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - 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 ErrInvalidLengthSettlement - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OrderType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderId", wireType) - } - m.OrderId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OrderId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SettlementId", wireType) - } - m.SettlementId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SettlementId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSettlement(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSettlement - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Settlements) 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 ErrIntOverflowSettlement - } - 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: Settlements: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Settlements: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) - } - m.Epoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Epoch |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSettlement - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSettlement - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSettlement - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Entries = append(m.Entries, &SettlementEntry{}) - if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSettlement(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSettlement - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSettlement(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSettlement - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSettlement - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSettlement - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSettlement - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSettlement - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSettlement - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSettlement = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSettlement = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSettlement = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/settlement_test.go b/x/dex/types/settlement_test.go deleted file mode 100644 index 245e33d05..000000000 --- a/x/dex/types/settlement_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package types_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - "github.com/sei-protocol/sei-chain/x/dex/types" - "github.com/stretchr/testify/require" -) - -func TestNewSettlementEntry(t *testing.T) { - _, ctx := keepertest.DexKeeper(t) - ctx = ctx.WithBlockHeight(100) - sudoFinalizeBlockMsg := types.NewSettlementEntry( - ctx, - 1, - "TEST_ACCOUNT", - types.PositionDirection_LONG, - "USDC", - "ATOM", - sdk.MustNewDecFromStr("1"), - sdk.MustNewDecFromStr("2"), - sdk.MustNewDecFromStr("3"), - types.OrderType_MARKET, - ) - - require.Equal(t, "Long", sudoFinalizeBlockMsg.PositionDirection) - require.Equal(t, "Market", sudoFinalizeBlockMsg.OrderType) - require.Equal(t, uint64(100), sudoFinalizeBlockMsg.Height) -} diff --git a/x/dex/types/short_book.pb.go b/x/dex/types/short_book.pb.go deleted file mode 100644 index 83c969121..000000000 --- a/x/dex/types/short_book.pb.go +++ /dev/null @@ -1,380 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/short_book.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ShortBook struct { - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price" yaml:"price"` - Entry *OrderEntry `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry"` -} - -func (m *ShortBook) Reset() { *m = ShortBook{} } -func (m *ShortBook) String() string { return proto.CompactTextString(m) } -func (*ShortBook) ProtoMessage() {} -func (*ShortBook) Descriptor() ([]byte, []int) { - return fileDescriptor_2554593a991dd89d, []int{0} -} -func (m *ShortBook) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ShortBook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ShortBook.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 *ShortBook) XXX_Merge(src proto.Message) { - xxx_messageInfo_ShortBook.Merge(m, src) -} -func (m *ShortBook) XXX_Size() int { - return m.Size() -} -func (m *ShortBook) XXX_DiscardUnknown() { - xxx_messageInfo_ShortBook.DiscardUnknown(m) -} - -var xxx_messageInfo_ShortBook proto.InternalMessageInfo - -func (m *ShortBook) GetEntry() *OrderEntry { - if m != nil { - return m.Entry - } - return nil -} - -func init() { - proto.RegisterType((*ShortBook)(nil), "seiprotocol.seichain.dex.ShortBook") -} - -func init() { proto.RegisterFile("dex/short_book.proto", fileDescriptor_2554593a991dd89d) } - -var fileDescriptor_2554593a991dd89d = []byte{ - // 278 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0x49, 0xad, 0xd0, - 0x2f, 0xce, 0xc8, 0x2f, 0x2a, 0x89, 0x4f, 0xca, 0xcf, 0xcf, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, - 0x17, 0x92, 0x28, 0x4e, 0xcd, 0x04, 0xb3, 0x92, 0xf3, 0x73, 0xf4, 0x8a, 0x53, 0x33, 0x93, 0x33, - 0x12, 0x33, 0xf3, 0xf4, 0x52, 0x52, 0x2b, 0xa4, 0x44, 0x41, 0xea, 0xf3, 0x8b, 0x52, 0x52, 0x8b, - 0xe2, 0x53, 0xf3, 0x4a, 0x8a, 0x2a, 0x21, 0x1a, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, - 0x7d, 0x10, 0x0b, 0x22, 0xaa, 0xb4, 0x91, 0x91, 0x8b, 0x33, 0x18, 0x64, 0xb6, 0x53, 0x7e, 0x7e, - 0xb6, 0x50, 0x2c, 0x17, 0x6b, 0x41, 0x51, 0x66, 0x72, 0xaa, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, - 0x93, 0xfb, 0x89, 0x7b, 0xf2, 0x0c, 0xb7, 0xee, 0xc9, 0xab, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0x43, 0x29, 0xdd, 0xe2, 0x94, - 0x6c, 0xfd, 0x92, 0xca, 0x82, 0xd4, 0x62, 0x3d, 0x97, 0xd4, 0xe4, 0x57, 0xf7, 0xe4, 0x21, 0xda, - 0x3f, 0xdd, 0x93, 0xe7, 0xa9, 0x4c, 0xcc, 0xcd, 0xb1, 0x52, 0x02, 0x73, 0x95, 0x82, 0x20, 0xc2, - 0x42, 0xae, 0x5c, 0xac, 0x60, 0x17, 0x49, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0xa9, 0xe8, 0xe1, - 0xf2, 0x83, 0x9e, 0x3f, 0xc8, 0xf9, 0xae, 0x20, 0xb5, 0x4e, 0x9c, 0x20, 0x63, 0xc1, 0xda, 0x82, - 0x20, 0x94, 0x93, 0xfb, 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, 0xe9, 0x22, - 0x39, 0xb4, 0x38, 0x35, 0x53, 0x17, 0x66, 0x38, 0x98, 0x03, 0x36, 0x5d, 0xbf, 0x42, 0x1f, 0x14, - 0x3c, 0x60, 0x37, 0x27, 0xb1, 0x81, 0xe5, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x12, - 0x40, 0x1c, 0x62, 0x01, 0x00, 0x00, -} - -func (m *ShortBook) 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 *ShortBook) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ShortBook) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Entry != nil { - { - size, err := m.Entry.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintShortBook(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintShortBook(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintShortBook(dAtA []byte, offset int, v uint64) int { - offset -= sovShortBook(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ShortBook) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Price.Size() - n += 1 + l + sovShortBook(uint64(l)) - if m.Entry != nil { - l = m.Entry.Size() - n += 1 + l + sovShortBook(uint64(l)) - } - return n -} - -func sovShortBook(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozShortBook(x uint64) (n int) { - return sovShortBook(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ShortBook) 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 ErrIntOverflowShortBook - } - 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: ShortBook: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ShortBook: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShortBook - } - 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 ErrInvalidLengthShortBook - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthShortBook - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShortBook - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthShortBook - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthShortBook - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Entry == nil { - m.Entry = &OrderEntry{} - } - if err := m.Entry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipShortBook(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthShortBook - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipShortBook(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowShortBook - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowShortBook - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowShortBook - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthShortBook - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupShortBook - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthShortBook - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthShortBook = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowShortBook = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupShortBook = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/tick_size.pb.go b/x/dex/types/tick_size.pb.go deleted file mode 100644 index c6f6a6f1e..000000000 --- a/x/dex/types/tick_size.pb.go +++ /dev/null @@ -1,433 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/tick_size.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type TickSize struct { - Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair"` - Ticksize github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=ticksize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"tick_size" yaml:"tick_size"` - ContractAddr string `protobuf:"bytes,3,opt,name=contractAddr,proto3" json:"contract_addr" yaml:"tick_size"` -} - -func (m *TickSize) Reset() { *m = TickSize{} } -func (m *TickSize) String() string { return proto.CompactTextString(m) } -func (*TickSize) ProtoMessage() {} -func (*TickSize) Descriptor() ([]byte, []int) { - return fileDescriptor_17c2b52038d2f694, []int{0} -} -func (m *TickSize) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TickSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TickSize.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 *TickSize) XXX_Merge(src proto.Message) { - xxx_messageInfo_TickSize.Merge(m, src) -} -func (m *TickSize) XXX_Size() int { - return m.Size() -} -func (m *TickSize) XXX_DiscardUnknown() { - xxx_messageInfo_TickSize.DiscardUnknown(m) -} - -var xxx_messageInfo_TickSize proto.InternalMessageInfo - -func (m *TickSize) GetPair() *Pair { - if m != nil { - return m.Pair - } - return nil -} - -func (m *TickSize) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func init() { - proto.RegisterType((*TickSize)(nil), "seiprotocol.seichain.dex.TickSize") -} - -func init() { proto.RegisterFile("dex/tick_size.proto", fileDescriptor_17c2b52038d2f694) } - -var fileDescriptor_17c2b52038d2f694 = []byte{ - // 307 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x49, 0xad, 0xd0, - 0x2f, 0xc9, 0x4c, 0xce, 0x8e, 0x2f, 0xce, 0xac, 0x4a, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x92, 0x28, 0x4e, 0xcd, 0x04, 0xb3, 0x92, 0xf3, 0x73, 0xf4, 0x8a, 0x53, 0x33, 0x93, 0x33, 0x12, - 0x33, 0xf3, 0xf4, 0x52, 0x52, 0x2b, 0xa4, 0xf8, 0x40, 0xca, 0x0b, 0x12, 0x33, 0x8b, 0x20, 0x2a, - 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x22, 0xaa, 0xd4, 0xc0, 0xc4, - 0xc5, 0x11, 0x92, 0x99, 0x9c, 0x1d, 0x9c, 0x59, 0x95, 0x2a, 0x64, 0xc3, 0xc5, 0x02, 0xd2, 0x20, - 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa7, 0x87, 0xcb, 0x6c, 0xbd, 0x80, 0xc4, 0xcc, 0x22, - 0x27, 0x8e, 0x57, 0xf7, 0xe4, 0xc1, 0xea, 0x83, 0xc0, 0xa4, 0x50, 0x36, 0x17, 0x07, 0xc8, 0x75, - 0x20, 0xc7, 0x49, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x3a, 0xf9, 0x9f, 0xb8, 0x27, 0xcf, 0x70, 0xeb, - 0x9e, 0xbc, 0x5a, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x72, 0x7e, - 0x71, 0x6e, 0x7e, 0x31, 0x94, 0xd2, 0x2d, 0x4e, 0xc9, 0xd6, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, - 0x73, 0x49, 0x4d, 0x7e, 0x75, 0x4f, 0x9e, 0x13, 0xee, 0xbf, 0x4f, 0xf7, 0xe4, 0x05, 0x2a, 0x13, - 0x73, 0x73, 0xac, 0x94, 0xe0, 0x42, 0x4a, 0x41, 0x70, 0x0b, 0x84, 0x3c, 0xb9, 0x78, 0x92, 0xf3, - 0xf3, 0x4a, 0x8a, 0x12, 0x93, 0x4b, 0x1c, 0x53, 0x52, 0x8a, 0x24, 0x98, 0xc1, 0x16, 0xaa, 0xbe, - 0xba, 0x27, 0xcf, 0x0b, 0x13, 0x8f, 0x4f, 0x4c, 0x49, 0x29, 0xc2, 0x6a, 0x0c, 0x8a, 0x56, 0x27, - 0xf7, 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, 0xd2, 0x45, 0x72, 0x77, 0x71, - 0x6a, 0xa6, 0x2e, 0x2c, 0x30, 0xc0, 0x1c, 0x70, 0x68, 0xe8, 0x57, 0xe8, 0x83, 0x63, 0x05, 0xe4, - 0x85, 0x24, 0x36, 0xb0, 0xbc, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x04, 0x0d, 0x45, 0x14, 0xa9, - 0x01, 0x00, 0x00, -} - -func (m *TickSize) 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 *TickSize) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TickSize) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintTickSize(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x1a - } - { - size := m.Ticksize.Size() - i -= size - if _, err := m.Ticksize.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTickSize(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Pair != nil { - { - size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTickSize(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTickSize(dAtA []byte, offset int, v uint64) int { - offset -= sovTickSize(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TickSize) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pair != nil { - l = m.Pair.Size() - n += 1 + l + sovTickSize(uint64(l)) - } - l = m.Ticksize.Size() - n += 1 + l + sovTickSize(uint64(l)) - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovTickSize(uint64(l)) - } - return n -} - -func sovTickSize(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTickSize(x uint64) (n int) { - return sovTickSize(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TickSize) 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 ErrIntOverflowTickSize - } - 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: TickSize: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TickSize: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTickSize - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTickSize - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTickSize - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pair == nil { - m.Pair = &Pair{} - } - if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ticksize", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTickSize - } - 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 ErrInvalidLengthTickSize - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTickSize - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Ticksize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTickSize - } - 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 ErrInvalidLengthTickSize - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTickSize - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTickSize(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTickSize - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTickSize(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTickSize - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTickSize - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTickSize - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTickSize - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTickSize - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTickSize - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTickSize = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTickSize = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTickSize = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/twap.pb.go b/x/dex/types/twap.pb.go deleted file mode 100644 index c1976c198..000000000 --- a/x/dex/types/twap.pb.go +++ /dev/null @@ -1,416 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/twap.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Twap struct { - Pair *Pair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair"` - Twap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=twap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"twap" yaml:"twap"` - LookbackSeconds uint64 `protobuf:"varint,3,opt,name=lookbackSeconds,proto3" json:"lookback_seconds"` -} - -func (m *Twap) Reset() { *m = Twap{} } -func (m *Twap) String() string { return proto.CompactTextString(m) } -func (*Twap) ProtoMessage() {} -func (*Twap) Descriptor() ([]byte, []int) { - return fileDescriptor_10aa4b136085207a, []int{0} -} -func (m *Twap) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Twap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Twap.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 *Twap) XXX_Merge(src proto.Message) { - xxx_messageInfo_Twap.Merge(m, src) -} -func (m *Twap) XXX_Size() int { - return m.Size() -} -func (m *Twap) XXX_DiscardUnknown() { - xxx_messageInfo_Twap.DiscardUnknown(m) -} - -var xxx_messageInfo_Twap proto.InternalMessageInfo - -func (m *Twap) GetPair() *Pair { - if m != nil { - return m.Pair - } - return nil -} - -func (m *Twap) GetLookbackSeconds() uint64 { - if m != nil { - return m.LookbackSeconds - } - return 0 -} - -func init() { - proto.RegisterType((*Twap)(nil), "seiprotocol.seichain.dex.Twap") -} - -func init() { proto.RegisterFile("dex/twap.proto", fileDescriptor_10aa4b136085207a) } - -var fileDescriptor_10aa4b136085207a = []byte{ - // 296 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0x49, 0xad, 0xd0, - 0x2f, 0x29, 0x4f, 0x2c, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x28, 0x4e, 0xcd, 0x04, - 0xb3, 0x92, 0xf3, 0x73, 0xf4, 0x8a, 0x53, 0x33, 0x93, 0x33, 0x12, 0x33, 0xf3, 0xf4, 0x52, 0x52, - 0x2b, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0xbd, 0x14, 0x58, - 0x7f, 0x41, 0x62, 0x66, 0x11, 0x84, 0xaf, 0x74, 0x9f, 0x91, 0x8b, 0x25, 0xa4, 0x3c, 0xb1, 0x40, - 0xc8, 0x86, 0x8b, 0x05, 0x24, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa7, 0x87, 0xcb, - 0x5c, 0xbd, 0x80, 0xc4, 0xcc, 0x22, 0x27, 0x8e, 0x57, 0xf7, 0xe4, 0xc1, 0xea, 0x83, 0xc0, 0xa4, - 0x50, 0x24, 0x17, 0x0b, 0xc8, 0x51, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, 0xae, 0x27, 0xee, - 0xc9, 0x33, 0xdc, 0xba, 0x27, 0xaf, 0x96, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, - 0xab, 0x9f, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0x0c, 0xa5, 0x74, 0x8b, 0x53, 0xb2, 0xf5, 0x4b, 0x2a, - 0x0b, 0x52, 0x8b, 0xf5, 0x5c, 0x52, 0x93, 0x41, 0x66, 0x81, 0x74, 0x7f, 0xba, 0x27, 0xcf, 0x5d, - 0x99, 0x98, 0x9b, 0x63, 0xa5, 0x04, 0xe2, 0x29, 0x05, 0x81, 0x05, 0x85, 0xec, 0xb8, 0xf8, 0x73, - 0xf2, 0xf3, 0xb3, 0x93, 0x12, 0x93, 0xb3, 0x83, 0x53, 0x93, 0xf3, 0xf3, 0x52, 0x8a, 0x25, 0x98, - 0x15, 0x18, 0x35, 0x58, 0x9c, 0x44, 0x5e, 0xdd, 0x93, 0x17, 0x80, 0x49, 0xc5, 0x17, 0x43, 0xe4, - 0x82, 0xd0, 0x15, 0x3b, 0xb9, 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, - 0x2e, 0x92, 0xf3, 0x8a, 0x53, 0x33, 0x75, 0x61, 0xfe, 0x05, 0x73, 0xc0, 0x1e, 0xd6, 0xaf, 0xd0, - 0x07, 0x87, 0x37, 0xc8, 0xa5, 0x49, 0x6c, 0x60, 0x79, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x6e, 0x96, 0x9d, 0x05, 0x83, 0x01, 0x00, 0x00, -} - -func (m *Twap) 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 *Twap) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Twap) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LookbackSeconds != 0 { - i = encodeVarintTwap(dAtA, i, uint64(m.LookbackSeconds)) - i-- - dAtA[i] = 0x18 - } - { - size := m.Twap.Size() - i -= size - if _, err := m.Twap.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTwap(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Pair != nil { - { - size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTwap(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTwap(dAtA []byte, offset int, v uint64) int { - offset -= sovTwap(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Twap) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pair != nil { - l = m.Pair.Size() - n += 1 + l + sovTwap(uint64(l)) - } - l = m.Twap.Size() - n += 1 + l + sovTwap(uint64(l)) - if m.LookbackSeconds != 0 { - n += 1 + sovTwap(uint64(m.LookbackSeconds)) - } - return n -} - -func sovTwap(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTwap(x uint64) (n int) { - return sovTwap(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Twap) 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 ErrIntOverflowTwap - } - 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: Twap: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Twap: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTwap - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTwap - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTwap - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pair == nil { - m.Pair = &Pair{} - } - if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Twap", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTwap - } - 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 ErrInvalidLengthTwap - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTwap - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Twap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LookbackSeconds", wireType) - } - m.LookbackSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTwap - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LookbackSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTwap(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTwap - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTwap(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTwap - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTwap - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTwap - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTwap - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTwap - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTwap - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTwap = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTwap = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTwap = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/tx.pb.go b/x/dex/types/tx.pb.go deleted file mode 100644 index 88c844095..000000000 --- a/x/dex/types/tx.pb.go +++ /dev/null @@ -1,3884 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dex/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MsgPlaceOrders struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator"` - Orders []*Order `protobuf:"bytes,2,rep,name=orders,proto3" json:"orders"` - ContractAddr string `protobuf:"bytes,3,opt,name=contractAddr,proto3" json:"contract_address"` - Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` -} - -func (m *MsgPlaceOrders) Reset() { *m = MsgPlaceOrders{} } -func (m *MsgPlaceOrders) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceOrders) ProtoMessage() {} -func (*MsgPlaceOrders) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{0} -} -func (m *MsgPlaceOrders) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceOrders) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceOrders.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 *MsgPlaceOrders) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceOrders.Merge(m, src) -} -func (m *MsgPlaceOrders) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceOrders) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceOrders.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceOrders proto.InternalMessageInfo - -func (m *MsgPlaceOrders) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgPlaceOrders) GetOrders() []*Order { - if m != nil { - return m.Orders - } - return nil -} - -func (m *MsgPlaceOrders) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *MsgPlaceOrders) GetFunds() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Funds - } - return nil -} - -type MsgPlaceOrdersResponse struct { - OrderIds []uint64 `protobuf:"varint,1,rep,packed,name=orderIds,proto3" json:"order_ids" yaml:"order_ids"` -} - -func (m *MsgPlaceOrdersResponse) Reset() { *m = MsgPlaceOrdersResponse{} } -func (m *MsgPlaceOrdersResponse) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceOrdersResponse) ProtoMessage() {} -func (*MsgPlaceOrdersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{1} -} -func (m *MsgPlaceOrdersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceOrdersResponse.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 *MsgPlaceOrdersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceOrdersResponse.Merge(m, src) -} -func (m *MsgPlaceOrdersResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceOrdersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceOrdersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceOrdersResponse proto.InternalMessageInfo - -func (m *MsgPlaceOrdersResponse) GetOrderIds() []uint64 { - if m != nil { - return m.OrderIds - } - return nil -} - -type MsgCancelOrders struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator"` - Cancellations []*Cancellation `protobuf:"bytes,2,rep,name=cancellations,proto3" json:"cancellations"` - ContractAddr string `protobuf:"bytes,3,opt,name=contractAddr,proto3" json:"contract_address"` -} - -func (m *MsgCancelOrders) Reset() { *m = MsgCancelOrders{} } -func (m *MsgCancelOrders) String() string { return proto.CompactTextString(m) } -func (*MsgCancelOrders) ProtoMessage() {} -func (*MsgCancelOrders) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{2} -} -func (m *MsgCancelOrders) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCancelOrders) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCancelOrders.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 *MsgCancelOrders) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCancelOrders.Merge(m, src) -} -func (m *MsgCancelOrders) XXX_Size() int { - return m.Size() -} -func (m *MsgCancelOrders) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCancelOrders.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCancelOrders proto.InternalMessageInfo - -func (m *MsgCancelOrders) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgCancelOrders) GetCancellations() []*Cancellation { - if m != nil { - return m.Cancellations - } - return nil -} - -func (m *MsgCancelOrders) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type MsgCancelOrdersResponse struct { -} - -func (m *MsgCancelOrdersResponse) Reset() { *m = MsgCancelOrdersResponse{} } -func (m *MsgCancelOrdersResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCancelOrdersResponse) ProtoMessage() {} -func (*MsgCancelOrdersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{3} -} -func (m *MsgCancelOrdersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCancelOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCancelOrdersResponse.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 *MsgCancelOrdersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCancelOrdersResponse.Merge(m, src) -} -func (m *MsgCancelOrdersResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCancelOrdersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCancelOrdersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCancelOrdersResponse proto.InternalMessageInfo - -type MsgRegisterContract struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Contract *ContractInfoV2 `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"` -} - -func (m *MsgRegisterContract) Reset() { *m = MsgRegisterContract{} } -func (m *MsgRegisterContract) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterContract) ProtoMessage() {} -func (*MsgRegisterContract) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{4} -} -func (m *MsgRegisterContract) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterContract.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 *MsgRegisterContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterContract.Merge(m, src) -} -func (m *MsgRegisterContract) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterContract) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterContract.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterContract proto.InternalMessageInfo - -func (m *MsgRegisterContract) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgRegisterContract) GetContract() *ContractInfoV2 { - if m != nil { - return m.Contract - } - return nil -} - -type MsgRegisterContractResponse struct { -} - -func (m *MsgRegisterContractResponse) Reset() { *m = MsgRegisterContractResponse{} } -func (m *MsgRegisterContractResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterContractResponse) ProtoMessage() {} -func (*MsgRegisterContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{5} -} -func (m *MsgRegisterContractResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterContractResponse.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 *MsgRegisterContractResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterContractResponse.Merge(m, src) -} -func (m *MsgRegisterContractResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterContractResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterContractResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterContractResponse proto.InternalMessageInfo - -type MsgContractDepositRent struct { - ContractAddr string `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contract_address"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount"` - Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender"` -} - -func (m *MsgContractDepositRent) Reset() { *m = MsgContractDepositRent{} } -func (m *MsgContractDepositRent) String() string { return proto.CompactTextString(m) } -func (*MsgContractDepositRent) ProtoMessage() {} -func (*MsgContractDepositRent) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{6} -} -func (m *MsgContractDepositRent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgContractDepositRent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgContractDepositRent.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 *MsgContractDepositRent) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgContractDepositRent.Merge(m, src) -} -func (m *MsgContractDepositRent) XXX_Size() int { - return m.Size() -} -func (m *MsgContractDepositRent) XXX_DiscardUnknown() { - xxx_messageInfo_MsgContractDepositRent.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgContractDepositRent proto.InternalMessageInfo - -func (m *MsgContractDepositRent) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -func (m *MsgContractDepositRent) GetAmount() uint64 { - if m != nil { - return m.Amount - } - return 0 -} - -func (m *MsgContractDepositRent) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -type MsgContractDepositRentResponse struct { -} - -func (m *MsgContractDepositRentResponse) Reset() { *m = MsgContractDepositRentResponse{} } -func (m *MsgContractDepositRentResponse) String() string { return proto.CompactTextString(m) } -func (*MsgContractDepositRentResponse) ProtoMessage() {} -func (*MsgContractDepositRentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{7} -} -func (m *MsgContractDepositRentResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgContractDepositRentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgContractDepositRentResponse.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 *MsgContractDepositRentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgContractDepositRentResponse.Merge(m, src) -} -func (m *MsgContractDepositRentResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgContractDepositRentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgContractDepositRentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgContractDepositRentResponse proto.InternalMessageInfo - -type MsgUnregisterContract struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contract_address"` -} - -func (m *MsgUnregisterContract) Reset() { *m = MsgUnregisterContract{} } -func (m *MsgUnregisterContract) String() string { return proto.CompactTextString(m) } -func (*MsgUnregisterContract) ProtoMessage() {} -func (*MsgUnregisterContract) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{8} -} -func (m *MsgUnregisterContract) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnregisterContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUnregisterContract.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 *MsgUnregisterContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnregisterContract.Merge(m, src) -} -func (m *MsgUnregisterContract) XXX_Size() int { - return m.Size() -} -func (m *MsgUnregisterContract) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnregisterContract.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnregisterContract proto.InternalMessageInfo - -func (m *MsgUnregisterContract) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgUnregisterContract) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type MsgUnregisterContractResponse struct { -} - -func (m *MsgUnregisterContractResponse) Reset() { *m = MsgUnregisterContractResponse{} } -func (m *MsgUnregisterContractResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUnregisterContractResponse) ProtoMessage() {} -func (*MsgUnregisterContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{9} -} -func (m *MsgUnregisterContractResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnregisterContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUnregisterContractResponse.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 *MsgUnregisterContractResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnregisterContractResponse.Merge(m, src) -} -func (m *MsgUnregisterContractResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUnregisterContractResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnregisterContractResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnregisterContractResponse proto.InternalMessageInfo - -type MsgRegisterPairs struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Batchcontractpair []BatchContractPair `protobuf:"bytes,3,rep,name=batchcontractpair,proto3" json:"batch_contract_pair" yaml:"batch_contract_pair"` -} - -func (m *MsgRegisterPairs) Reset() { *m = MsgRegisterPairs{} } -func (m *MsgRegisterPairs) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterPairs) ProtoMessage() {} -func (*MsgRegisterPairs) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{10} -} -func (m *MsgRegisterPairs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterPairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterPairs.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 *MsgRegisterPairs) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterPairs.Merge(m, src) -} -func (m *MsgRegisterPairs) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterPairs) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterPairs.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterPairs proto.InternalMessageInfo - -func (m *MsgRegisterPairs) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgRegisterPairs) GetBatchcontractpair() []BatchContractPair { - if m != nil { - return m.Batchcontractpair - } - return nil -} - -type MsgRegisterPairsResponse struct { -} - -func (m *MsgRegisterPairsResponse) Reset() { *m = MsgRegisterPairsResponse{} } -func (m *MsgRegisterPairsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterPairsResponse) ProtoMessage() {} -func (*MsgRegisterPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{11} -} -func (m *MsgRegisterPairsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterPairsResponse.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 *MsgRegisterPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterPairsResponse.Merge(m, src) -} -func (m *MsgRegisterPairsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterPairsResponse proto.InternalMessageInfo - -type MsgUpdatePriceTickSize struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator"` - TickSizeList []TickSize `protobuf:"bytes,2,rep,name=tickSizeList,proto3" json:"tick_size_list" yaml:"tick_size_list"` -} - -func (m *MsgUpdatePriceTickSize) Reset() { *m = MsgUpdatePriceTickSize{} } -func (m *MsgUpdatePriceTickSize) String() string { return proto.CompactTextString(m) } -func (*MsgUpdatePriceTickSize) ProtoMessage() {} -func (*MsgUpdatePriceTickSize) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{12} -} -func (m *MsgUpdatePriceTickSize) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdatePriceTickSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdatePriceTickSize.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 *MsgUpdatePriceTickSize) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdatePriceTickSize.Merge(m, src) -} -func (m *MsgUpdatePriceTickSize) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdatePriceTickSize) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdatePriceTickSize.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdatePriceTickSize proto.InternalMessageInfo - -func (m *MsgUpdatePriceTickSize) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgUpdatePriceTickSize) GetTickSizeList() []TickSize { - if m != nil { - return m.TickSizeList - } - return nil -} - -type MsgUpdateQuantityTickSize struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator"` - TickSizeList []TickSize `protobuf:"bytes,2,rep,name=tickSizeList,proto3" json:"tick_size_list" yaml:"tick_size_list"` -} - -func (m *MsgUpdateQuantityTickSize) Reset() { *m = MsgUpdateQuantityTickSize{} } -func (m *MsgUpdateQuantityTickSize) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateQuantityTickSize) ProtoMessage() {} -func (*MsgUpdateQuantityTickSize) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{13} -} -func (m *MsgUpdateQuantityTickSize) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateQuantityTickSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateQuantityTickSize.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 *MsgUpdateQuantityTickSize) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateQuantityTickSize.Merge(m, src) -} -func (m *MsgUpdateQuantityTickSize) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateQuantityTickSize) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateQuantityTickSize.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateQuantityTickSize proto.InternalMessageInfo - -func (m *MsgUpdateQuantityTickSize) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgUpdateQuantityTickSize) GetTickSizeList() []TickSize { - if m != nil { - return m.TickSizeList - } - return nil -} - -type MsgUpdateTickSizeResponse struct { -} - -func (m *MsgUpdateTickSizeResponse) Reset() { *m = MsgUpdateTickSizeResponse{} } -func (m *MsgUpdateTickSizeResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateTickSizeResponse) ProtoMessage() {} -func (*MsgUpdateTickSizeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{14} -} -func (m *MsgUpdateTickSizeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateTickSizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateTickSizeResponse.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 *MsgUpdateTickSizeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateTickSizeResponse.Merge(m, src) -} -func (m *MsgUpdateTickSizeResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateTickSizeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateTickSizeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateTickSizeResponse proto.InternalMessageInfo - -type MsgUnsuspendContract struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator"` - ContractAddr string `protobuf:"bytes,2,opt,name=contractAddr,proto3" json:"contract_address"` -} - -func (m *MsgUnsuspendContract) Reset() { *m = MsgUnsuspendContract{} } -func (m *MsgUnsuspendContract) String() string { return proto.CompactTextString(m) } -func (*MsgUnsuspendContract) ProtoMessage() {} -func (*MsgUnsuspendContract) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{15} -} -func (m *MsgUnsuspendContract) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnsuspendContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUnsuspendContract.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 *MsgUnsuspendContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnsuspendContract.Merge(m, src) -} -func (m *MsgUnsuspendContract) XXX_Size() int { - return m.Size() -} -func (m *MsgUnsuspendContract) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnsuspendContract.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnsuspendContract proto.InternalMessageInfo - -func (m *MsgUnsuspendContract) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgUnsuspendContract) GetContractAddr() string { - if m != nil { - return m.ContractAddr - } - return "" -} - -type MsgUnsuspendContractResponse struct { -} - -func (m *MsgUnsuspendContractResponse) Reset() { *m = MsgUnsuspendContractResponse{} } -func (m *MsgUnsuspendContractResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUnsuspendContractResponse) ProtoMessage() {} -func (*MsgUnsuspendContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_463701e671e5a5e0, []int{16} -} -func (m *MsgUnsuspendContractResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUnsuspendContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUnsuspendContractResponse.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 *MsgUnsuspendContractResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUnsuspendContractResponse.Merge(m, src) -} -func (m *MsgUnsuspendContractResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUnsuspendContractResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUnsuspendContractResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUnsuspendContractResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgPlaceOrders)(nil), "seiprotocol.seichain.dex.MsgPlaceOrders") - proto.RegisterType((*MsgPlaceOrdersResponse)(nil), "seiprotocol.seichain.dex.MsgPlaceOrdersResponse") - proto.RegisterType((*MsgCancelOrders)(nil), "seiprotocol.seichain.dex.MsgCancelOrders") - proto.RegisterType((*MsgCancelOrdersResponse)(nil), "seiprotocol.seichain.dex.MsgCancelOrdersResponse") - proto.RegisterType((*MsgRegisterContract)(nil), "seiprotocol.seichain.dex.MsgRegisterContract") - proto.RegisterType((*MsgRegisterContractResponse)(nil), "seiprotocol.seichain.dex.MsgRegisterContractResponse") - proto.RegisterType((*MsgContractDepositRent)(nil), "seiprotocol.seichain.dex.MsgContractDepositRent") - proto.RegisterType((*MsgContractDepositRentResponse)(nil), "seiprotocol.seichain.dex.MsgContractDepositRentResponse") - proto.RegisterType((*MsgUnregisterContract)(nil), "seiprotocol.seichain.dex.MsgUnregisterContract") - proto.RegisterType((*MsgUnregisterContractResponse)(nil), "seiprotocol.seichain.dex.MsgUnregisterContractResponse") - proto.RegisterType((*MsgRegisterPairs)(nil), "seiprotocol.seichain.dex.MsgRegisterPairs") - proto.RegisterType((*MsgRegisterPairsResponse)(nil), "seiprotocol.seichain.dex.MsgRegisterPairsResponse") - proto.RegisterType((*MsgUpdatePriceTickSize)(nil), "seiprotocol.seichain.dex.MsgUpdatePriceTickSize") - proto.RegisterType((*MsgUpdateQuantityTickSize)(nil), "seiprotocol.seichain.dex.MsgUpdateQuantityTickSize") - proto.RegisterType((*MsgUpdateTickSizeResponse)(nil), "seiprotocol.seichain.dex.MsgUpdateTickSizeResponse") - proto.RegisterType((*MsgUnsuspendContract)(nil), "seiprotocol.seichain.dex.MsgUnsuspendContract") - proto.RegisterType((*MsgUnsuspendContractResponse)(nil), "seiprotocol.seichain.dex.MsgUnsuspendContractResponse") -} - -func init() { proto.RegisterFile("dex/tx.proto", fileDescriptor_463701e671e5a5e0) } - -var fileDescriptor_463701e671e5a5e0 = []byte{ - // 962 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0xae, 0x9b, 0x52, 0xba, 0xaf, 0xdd, 0x6e, 0xeb, 0x74, 0x17, 0xd7, 0xcb, 0xda, 0xc1, 0x12, - 0x28, 0x80, 0x6a, 0xd3, 0xac, 0x80, 0x05, 0x89, 0x03, 0xc9, 0x4a, 0x68, 0x25, 0x22, 0x8a, 0x61, - 0x41, 0xe2, 0x12, 0x39, 0xf6, 0xac, 0x3b, 0x34, 0xf5, 0x44, 0x9e, 0x09, 0x9b, 0x2e, 0x08, 0x09, - 0x7e, 0x01, 0x07, 0x4e, 0x1c, 0x39, 0xf2, 0x0b, 0x90, 0x38, 0x72, 0xd9, 0x0b, 0xd2, 0x4a, 0x5c, - 0x38, 0x19, 0xd4, 0xde, 0x72, 0xec, 0x2f, 0x40, 0x1e, 0xdb, 0x43, 0xec, 0x38, 0xc1, 0xd9, 0x03, - 0x12, 0x27, 0x8f, 0x5f, 0xde, 0xf7, 0xbe, 0xf7, 0xbe, 0x37, 0xf3, 0xc6, 0x81, 0x2d, 0x0f, 0x8d, - 0x2d, 0x36,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, 0xe4, 0xbe, 0x6a, 0xab, 0xba, - 0xaf, 0x20, 0xfc, 0x0a, 0xea, 0x65, 0xa3, 0x6f, 0xb1, 0xe6, 0x25, 0x08, 0xf5, 0x76, 0x05, 0x44, - 0xf1, 0x98, 0xcb, 0xdf, 0x4a, 0x70, 0x63, 0xce, 0xf8, 0xaa, 0x12, 0xaf, 0x08, 0x7a, 0xba, 0x24, - 0xbe, 0x84, 0xdd, 0xd9, 0x41, 0x63, 0xfe, 0x4b, 0x07, 0x0b, 0xfe, 0xea, 0x1b, 0xcb, 0xf9, 0x67, - 0xe4, 0xed, 0xf7, 0x1e, 0x9f, 0x6b, 0xd2, 0x93, 0x73, 0x4d, 0xfa, 0xeb, 0x5c, 0x93, 0xbe, 0xbb, - 0xd0, 0x56, 0x9e, 0x5c, 0x68, 0x2b, 0x7f, 0x5c, 0x68, 0x2b, 0x9f, 0x1d, 0x4c, 0x7d, 0xe5, 0x52, - 0x84, 0x0f, 0xb2, 0xe0, 0xfc, 0x85, 0x47, 0xb7, 0xc6, 0x16, 0xff, 0x4b, 0x10, 0x7f, 0xf0, 0xf6, - 0xd7, 0xf9, 0xef, 0xb7, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x87, 0xb0, 0xd3, 0x48, 0xb9, 0x0c, - 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - PlaceOrders(ctx context.Context, in *MsgPlaceOrders, opts ...grpc.CallOption) (*MsgPlaceOrdersResponse, error) - CancelOrders(ctx context.Context, in *MsgCancelOrders, opts ...grpc.CallOption) (*MsgCancelOrdersResponse, error) - RegisterContract(ctx context.Context, in *MsgRegisterContract, opts ...grpc.CallOption) (*MsgRegisterContractResponse, error) - ContractDepositRent(ctx context.Context, in *MsgContractDepositRent, opts ...grpc.CallOption) (*MsgContractDepositRentResponse, error) - UnregisterContract(ctx context.Context, in *MsgUnregisterContract, opts ...grpc.CallOption) (*MsgUnregisterContractResponse, error) - RegisterPairs(ctx context.Context, in *MsgRegisterPairs, opts ...grpc.CallOption) (*MsgRegisterPairsResponse, error) - UpdatePriceTickSize(ctx context.Context, in *MsgUpdatePriceTickSize, opts ...grpc.CallOption) (*MsgUpdateTickSizeResponse, error) - UpdateQuantityTickSize(ctx context.Context, in *MsgUpdateQuantityTickSize, opts ...grpc.CallOption) (*MsgUpdateTickSizeResponse, error) - UnsuspendContract(ctx context.Context, in *MsgUnsuspendContract, opts ...grpc.CallOption) (*MsgUnsuspendContractResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) PlaceOrders(ctx context.Context, in *MsgPlaceOrders, opts ...grpc.CallOption) (*MsgPlaceOrdersResponse, error) { - out := new(MsgPlaceOrdersResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/PlaceOrders", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) CancelOrders(ctx context.Context, in *MsgCancelOrders, opts ...grpc.CallOption) (*MsgCancelOrdersResponse, error) { - out := new(MsgCancelOrdersResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/CancelOrders", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RegisterContract(ctx context.Context, in *MsgRegisterContract, opts ...grpc.CallOption) (*MsgRegisterContractResponse, error) { - out := new(MsgRegisterContractResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/RegisterContract", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ContractDepositRent(ctx context.Context, in *MsgContractDepositRent, opts ...grpc.CallOption) (*MsgContractDepositRentResponse, error) { - out := new(MsgContractDepositRentResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/ContractDepositRent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UnregisterContract(ctx context.Context, in *MsgUnregisterContract, opts ...grpc.CallOption) (*MsgUnregisterContractResponse, error) { - out := new(MsgUnregisterContractResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/UnregisterContract", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RegisterPairs(ctx context.Context, in *MsgRegisterPairs, opts ...grpc.CallOption) (*MsgRegisterPairsResponse, error) { - out := new(MsgRegisterPairsResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/RegisterPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdatePriceTickSize(ctx context.Context, in *MsgUpdatePriceTickSize, opts ...grpc.CallOption) (*MsgUpdateTickSizeResponse, error) { - out := new(MsgUpdateTickSizeResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/UpdatePriceTickSize", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateQuantityTickSize(ctx context.Context, in *MsgUpdateQuantityTickSize, opts ...grpc.CallOption) (*MsgUpdateTickSizeResponse, error) { - out := new(MsgUpdateTickSizeResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/UpdateQuantityTickSize", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UnsuspendContract(ctx context.Context, in *MsgUnsuspendContract, opts ...grpc.CallOption) (*MsgUnsuspendContractResponse, error) { - out := new(MsgUnsuspendContractResponse) - err := c.cc.Invoke(ctx, "/seiprotocol.seichain.dex.Msg/UnsuspendContract", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - PlaceOrders(context.Context, *MsgPlaceOrders) (*MsgPlaceOrdersResponse, error) - CancelOrders(context.Context, *MsgCancelOrders) (*MsgCancelOrdersResponse, error) - RegisterContract(context.Context, *MsgRegisterContract) (*MsgRegisterContractResponse, error) - ContractDepositRent(context.Context, *MsgContractDepositRent) (*MsgContractDepositRentResponse, error) - UnregisterContract(context.Context, *MsgUnregisterContract) (*MsgUnregisterContractResponse, error) - RegisterPairs(context.Context, *MsgRegisterPairs) (*MsgRegisterPairsResponse, error) - UpdatePriceTickSize(context.Context, *MsgUpdatePriceTickSize) (*MsgUpdateTickSizeResponse, error) - UpdateQuantityTickSize(context.Context, *MsgUpdateQuantityTickSize) (*MsgUpdateTickSizeResponse, error) - UnsuspendContract(context.Context, *MsgUnsuspendContract) (*MsgUnsuspendContractResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) PlaceOrders(ctx context.Context, req *MsgPlaceOrders) (*MsgPlaceOrdersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PlaceOrders not implemented") -} -func (*UnimplementedMsgServer) CancelOrders(ctx context.Context, req *MsgCancelOrders) (*MsgCancelOrdersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CancelOrders not implemented") -} -func (*UnimplementedMsgServer) RegisterContract(ctx context.Context, req *MsgRegisterContract) (*MsgRegisterContractResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterContract not implemented") -} -func (*UnimplementedMsgServer) ContractDepositRent(ctx context.Context, req *MsgContractDepositRent) (*MsgContractDepositRentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ContractDepositRent not implemented") -} -func (*UnimplementedMsgServer) UnregisterContract(ctx context.Context, req *MsgUnregisterContract) (*MsgUnregisterContractResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnregisterContract not implemented") -} -func (*UnimplementedMsgServer) RegisterPairs(ctx context.Context, req *MsgRegisterPairs) (*MsgRegisterPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterPairs not implemented") -} -func (*UnimplementedMsgServer) UpdatePriceTickSize(ctx context.Context, req *MsgUpdatePriceTickSize) (*MsgUpdateTickSizeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdatePriceTickSize not implemented") -} -func (*UnimplementedMsgServer) UpdateQuantityTickSize(ctx context.Context, req *MsgUpdateQuantityTickSize) (*MsgUpdateTickSizeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateQuantityTickSize not implemented") -} -func (*UnimplementedMsgServer) UnsuspendContract(ctx context.Context, req *MsgUnsuspendContract) (*MsgUnsuspendContractResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnsuspendContract not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_PlaceOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgPlaceOrders) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).PlaceOrders(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/PlaceOrders", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).PlaceOrders(ctx, req.(*MsgPlaceOrders)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_CancelOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCancelOrders) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CancelOrders(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/CancelOrders", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CancelOrders(ctx, req.(*MsgCancelOrders)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RegisterContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterContract) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/RegisterContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterContract(ctx, req.(*MsgRegisterContract)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ContractDepositRent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgContractDepositRent) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ContractDepositRent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/ContractDepositRent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ContractDepositRent(ctx, req.(*MsgContractDepositRent)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UnregisterContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnregisterContract) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UnregisterContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/UnregisterContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnregisterContract(ctx, req.(*MsgUnregisterContract)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RegisterPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterPairs) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/RegisterPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterPairs(ctx, req.(*MsgRegisterPairs)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdatePriceTickSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdatePriceTickSize) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdatePriceTickSize(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/UpdatePriceTickSize", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdatePriceTickSize(ctx, req.(*MsgUpdatePriceTickSize)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateQuantityTickSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateQuantityTickSize) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateQuantityTickSize(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/UpdateQuantityTickSize", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateQuantityTickSize(ctx, req.(*MsgUpdateQuantityTickSize)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UnsuspendContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnsuspendContract) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UnsuspendContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/seiprotocol.seichain.dex.Msg/UnsuspendContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnsuspendContract(ctx, req.(*MsgUnsuspendContract)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "seiprotocol.seichain.dex.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "PlaceOrders", - Handler: _Msg_PlaceOrders_Handler, - }, - { - MethodName: "CancelOrders", - Handler: _Msg_CancelOrders_Handler, - }, - { - MethodName: "RegisterContract", - Handler: _Msg_RegisterContract_Handler, - }, - { - MethodName: "ContractDepositRent", - Handler: _Msg_ContractDepositRent_Handler, - }, - { - MethodName: "UnregisterContract", - Handler: _Msg_UnregisterContract_Handler, - }, - { - MethodName: "RegisterPairs", - Handler: _Msg_RegisterPairs_Handler, - }, - { - MethodName: "UpdatePriceTickSize", - Handler: _Msg_UpdatePriceTickSize_Handler, - }, - { - MethodName: "UpdateQuantityTickSize", - Handler: _Msg_UpdateQuantityTickSize_Handler, - }, - { - MethodName: "UnsuspendContract", - Handler: _Msg_UnsuspendContract_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "dex/tx.proto", -} - -func (m *MsgPlaceOrders) 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 *MsgPlaceOrders) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceOrders) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Funds) > 0 { - for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.Orders) > 0 { - for iNdEx := len(m.Orders) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Orders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgPlaceOrdersResponse) 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 *MsgPlaceOrdersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OrderIds) > 0 { - dAtA2 := make([]byte, len(m.OrderIds)*10) - var j1 int - for _, num := range m.OrderIds { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintTx(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCancelOrders) 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 *MsgCancelOrders) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCancelOrders) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.Cancellations) > 0 { - for iNdEx := len(m.Cancellations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Cancellations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCancelOrdersResponse) 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 *MsgCancelOrdersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCancelOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgRegisterContract) 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 *MsgRegisterContract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Contract != nil { - { - size, err := m.Contract.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRegisterContractResponse) 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 *MsgRegisterContractResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgContractDepositRent) 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 *MsgContractDepositRent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgContractDepositRent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0x1a - } - if m.Amount != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Amount)) - i-- - dAtA[i] = 0x10 - } - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgContractDepositRentResponse) 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 *MsgContractDepositRentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgContractDepositRentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUnregisterContract) 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 *MsgUnregisterContract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnregisterContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUnregisterContractResponse) 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 *MsgUnregisterContractResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnregisterContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgRegisterPairs) 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 *MsgRegisterPairs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterPairs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Batchcontractpair) > 0 { - for iNdEx := len(m.Batchcontractpair) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Batchcontractpair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRegisterPairsResponse) 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 *MsgRegisterPairsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpdatePriceTickSize) 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 *MsgUpdatePriceTickSize) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdatePriceTickSize) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TickSizeList) > 0 { - for iNdEx := len(m.TickSizeList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TickSizeList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateQuantityTickSize) 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 *MsgUpdateQuantityTickSize) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateQuantityTickSize) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TickSizeList) > 0 { - for iNdEx := len(m.TickSizeList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TickSizeList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateTickSizeResponse) 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 *MsgUpdateTickSizeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateTickSizeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUnsuspendContract) 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 *MsgUnsuspendContract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnsuspendContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractAddr) > 0 { - i -= len(m.ContractAddr) - copy(dAtA[i:], m.ContractAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ContractAddr))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUnsuspendContractResponse) 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 *MsgUnsuspendContractResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnsuspendContractResponse) 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 - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgPlaceOrders) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Orders) > 0 { - for _, e := range m.Orders { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Funds) > 0 { - for _, e := range m.Funds { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgPlaceOrdersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.OrderIds) > 0 { - l = 0 - for _, e := range m.OrderIds { - l += sovTx(uint64(e)) - } - n += 1 + sovTx(uint64(l)) + l - } - return n -} - -func (m *MsgCancelOrders) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Cancellations) > 0 { - for _, e := range m.Cancellations { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgCancelOrdersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgRegisterContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Contract != nil { - l = m.Contract.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRegisterContractResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgContractDepositRent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Amount != 0 { - n += 1 + sovTx(uint64(m.Amount)) - } - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgContractDepositRentResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUnregisterContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUnregisterContractResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgRegisterPairs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Batchcontractpair) > 0 { - for _, e := range m.Batchcontractpair { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgRegisterPairsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdatePriceTickSize) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.TickSizeList) > 0 { - for _, e := range m.TickSizeList { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgUpdateQuantityTickSize) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.TickSizeList) > 0 { - for _, e := range m.TickSizeList { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgUpdateTickSizeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUnsuspendContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ContractAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUnsuspendContractResponse) 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 *MsgPlaceOrders) 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: MsgPlaceOrders: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceOrders: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Orders", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Orders = append(m.Orders, &Order{}) - if err := m.Orders[len(m.Orders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", 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.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Funds = append(m.Funds, types.Coin{}) - if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 *MsgPlaceOrdersResponse) 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: MsgPlaceOrdersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceOrdersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.OrderIds = append(m.OrderIds, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.OrderIds) == 0 { - m.OrderIds = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.OrderIds = append(m.OrderIds, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field OrderIds", wireType) - } - 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 *MsgCancelOrders) 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: MsgCancelOrders: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCancelOrders: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cancellations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cancellations = append(m.Cancellations, &Cancellation{}) - if err := m.Cancellations[len(m.Cancellations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", 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.ContractAddr = 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 *MsgCancelOrdersResponse) 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: MsgCancelOrdersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCancelOrdersResponse: 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 *MsgRegisterContract) 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: MsgRegisterContract: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterContract: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Contract == nil { - m.Contract = &ContractInfoV2{} - } - if err := m.Contract.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 *MsgRegisterContractResponse) 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: MsgRegisterContractResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterContractResponse: 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 *MsgContractDepositRent) 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: MsgContractDepositRent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgContractDepositRent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", 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.ContractAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - m.Amount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Amount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - 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 *MsgContractDepositRentResponse) 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: MsgContractDepositRentResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgContractDepositRentResponse: 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 *MsgUnregisterContract) 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: MsgUnregisterContract: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnregisterContract: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", 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.ContractAddr = 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 *MsgUnregisterContractResponse) 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: MsgUnregisterContractResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnregisterContractResponse: 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 *MsgRegisterPairs) 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: MsgRegisterPairs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterPairs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Batchcontractpair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Batchcontractpair = append(m.Batchcontractpair, BatchContractPair{}) - if err := m.Batchcontractpair[len(m.Batchcontractpair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 *MsgRegisterPairsResponse) 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: MsgRegisterPairsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterPairsResponse: 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 *MsgUpdatePriceTickSize) 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: MsgUpdatePriceTickSize: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdatePriceTickSize: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TickSizeList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TickSizeList = append(m.TickSizeList, TickSize{}) - if err := m.TickSizeList[len(m.TickSizeList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 *MsgUpdateQuantityTickSize) 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: MsgUpdateQuantityTickSize: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateQuantityTickSize: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TickSizeList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TickSizeList = append(m.TickSizeList, TickSize{}) - if err := m.TickSizeList[len(m.TickSizeList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 *MsgUpdateTickSizeResponse) 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: MsgUpdateTickSizeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateTickSizeResponse: 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 *MsgUnsuspendContract) 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: MsgUnsuspendContract: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnsuspendContract: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddr", 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.ContractAddr = 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 *MsgUnsuspendContractResponse) 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: MsgUnsuspendContractResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUnsuspendContractResponse: 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 skipTx(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dex/types/types.go b/x/dex/types/types.go deleted file mode 100644 index 7cc81e44f..000000000 --- a/x/dex/types/types.go +++ /dev/null @@ -1,6 +0,0 @@ -package types - -var OppositePositionDirection = map[PositionDirection]PositionDirection{ - PositionDirection_LONG: PositionDirection_SHORT, - PositionDirection_SHORT: PositionDirection_LONG, -} diff --git a/x/dex/types/utils.go b/x/dex/types/utils.go deleted file mode 100644 index 2d5587813..000000000 --- a/x/dex/types/utils.go +++ /dev/null @@ -1,14 +0,0 @@ -package types - -import ( - "golang.org/x/text/cases" - "golang.org/x/text/language" -) - -func GetContractPositionDirection(direction PositionDirection) string { - return cases.Title(language.English).String(cases.Lower(language.English).String(PositionDirection_name[int32(direction)])) -} - -func GetContractOrderType(orderType OrderType) string { - return cases.Title(language.English).String(cases.Lower(language.English).String(OrderType_name[int32(orderType)])) -} diff --git a/x/dex/utils/context.go b/x/dex/utils/context.go deleted file mode 100644 index 7c7ca2740..000000000 --- a/x/dex/utils/context.go +++ /dev/null @@ -1,18 +0,0 @@ -package utils - -import ( - "context" - - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" -) - -type MemStateKeyType string - -const DexMemStateContextKey MemStateKeyType = MemStateKeyType("dex-memstate") - -func GetMemState(ctx context.Context) *dexcache.MemState { - if val := ctx.Value(DexMemStateContextKey); val != nil { - return val.(*dexcache.MemState) - } - return nil -} diff --git a/x/dex/utils/dec.go b/x/dex/utils/dec.go deleted file mode 100644 index b43b70898..000000000 --- a/x/dex/utils/dec.go +++ /dev/null @@ -1,71 +0,0 @@ -package utils - -import ( - "encoding/binary" - "math/big" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func DecToBigEndian(d sdk.Dec) (res []byte) { - i := d.BigInt() - words := i.Bits() - // words are little-endian but we want big-endian so we start from the back - for idx := len(words) - 1; idx >= 0; idx-- { - bz := make([]byte, 8) - word := uint64(words[idx]) - if d.IsNegative() { - word = ^word - } - binary.BigEndian.PutUint64(bz, word) - res = append(res, bz...) - } - lastZeroByteIdx := -1 - for i := 0; i < len(res); i++ { - if res[i] != 0 { - break - } - lastZeroByteIdx = i - } - numNonZeroBytes := uint32(len(res) - lastZeroByteIdx - 1) - if d.IsNegative() { - numNonZeroBytes = ^numNonZeroBytes - } - lengthHeaderBz := make([]byte, 4) - binary.BigEndian.PutUint32(lengthHeaderBz, numNonZeroBytes) - res = append(lengthHeaderBz, res[lastZeroByteIdx+1:]...) - if d.IsNegative() { - res = append([]byte{0}, res...) - } else { - res = append([]byte{1}, res...) - } - return res -} - -func BytesToDec(bz []byte) sdk.Dec { - neg := bz[0] == 0 - length := binary.BigEndian.Uint32(bz[1:5]) - if neg { - length = ^length - } - paddingLength := 0 - if length%8 != 0 { - paddingLength = 8 - int(length)%8 - } - padding := make([]byte, paddingLength) - bz = append(padding, bz[5:]...) - words := []big.Word{} - for i := 0; i < len(bz); i += 8 { - word := binary.BigEndian.Uint64(bz[i : i+8]) - if neg { - word = ^word - } - words = append([]big.Word{big.Word(word)}, words...) - } - bi := &big.Int{} - bi.SetBits(words) - if neg { - bi.Neg(bi) - } - return sdk.NewDecFromBigIntWithPrec(bi, sdk.Precision) -} diff --git a/x/dex/utils/dec_test.go b/x/dex/utils/dec_test.go deleted file mode 100644 index 7d170cc42..000000000 --- a/x/dex/utils/dec_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package utils - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) - -var DECS = []sdk.Dec{ - sdk.MustNewDecFromStr("90.0"), - sdk.MustNewDecFromStr("10.01"), - sdk.MustNewDecFromStr("10"), - sdk.MustNewDecFromStr("9.99"), - sdk.MustNewDecFromStr("9.9"), - sdk.MustNewDecFromStr("9.0"), - sdk.MustNewDecFromStr("1"), - sdk.MustNewDecFromStr("0.001"), - sdk.MustNewDecFromStr("0"), - sdk.MustNewDecFromStr("-0.001"), - sdk.MustNewDecFromStr("-1"), - sdk.MustNewDecFromStr("-9.0"), - sdk.MustNewDecFromStr("-9.9"), - sdk.MustNewDecFromStr("-9.99"), - sdk.MustNewDecFromStr("-10"), - sdk.MustNewDecFromStr("-10.01"), - sdk.MustNewDecFromStr("-90.0"), -} - -func TestDecToBigEndian(t *testing.T) { - for i := 1; i < len(DECS); i++ { - require.True(t, compBz(DecToBigEndian(DECS[i-1]), DecToBigEndian(DECS[i]))) - } -} - -func TestBytesToDec(t *testing.T) { - for _, dec := range DECS { - require.Equal(t, dec, BytesToDec(DecToBigEndian(dec))) - } -} - -func compBz(b1 []byte, b2 []byte) bool { - ptr := 0 - for ; ptr < len(b1) && ptr < len(b2); ptr++ { - if b1[ptr] < b2[ptr] { - return false - } - if b1[ptr] > b2[ptr] { - return true - } - } - - return ptr >= len(b2) -} diff --git a/x/dex/utils/errors.go b/x/dex/utils/errors.go deleted file mode 100644 index 6139efd4f..000000000 --- a/x/dex/utils/errors.go +++ /dev/null @@ -1,11 +0,0 @@ -package utils - -const ErrorByteLimit = 50 - -func GetTruncatedErrors(err error) string { - errStr := err.Error() - if len(errStr) <= ErrorByteLimit { - return errStr - } - return errStr[:ErrorByteLimit] -} diff --git a/x/evm/keeper/msg_server_test.go b/x/evm/keeper/msg_server_test.go index 7a96a68f5..20482b1c7 100644 --- a/x/evm/keeper/msg_server_test.go +++ b/x/evm/keeper/msg_server_test.go @@ -2,7 +2,6 @@ package keeper_test import ( "bytes" - "context" "crypto/sha256" "encoding/hex" "math/big" @@ -20,8 +19,6 @@ import ( "github.com/sei-protocol/sei-chain/example/contracts/sendall" "github.com/sei-protocol/sei-chain/example/contracts/simplestorage" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" "github.com/sei-protocol/sei-chain/x/evm/ante" "github.com/sei-protocol/sei-chain/x/evm/artifacts/erc20" "github.com/sei-protocol/sei-chain/x/evm/artifacts/erc721" @@ -725,9 +722,6 @@ func TestAssociateContractAddress(t *testing.T) { func TestAssociate(t *testing.T) { ctx := testkeeper.EVMTestApp.GetContextForDeliverTx([]byte{}).WithChainID("sei-test").WithBlockHeight(1) - ctx = ctx.WithContext( - context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, &dexcache.MemState{}), - ) privKey := testkeeper.MockPrivateKey() seiAddr, evmAddr := testkeeper.PrivateKeyToAddresses(privKey) acc := testkeeper.EVMTestApp.AccountKeeper.NewAccountWithAddress(ctx, seiAddr) diff --git a/x/mint/keeper/hooks_test.go b/x/mint/keeper/hooks_test.go index 760eea3dd..787bfe504 100644 --- a/x/mint/keeper/hooks_test.go +++ b/x/mint/keeper/hooks_test.go @@ -1,14 +1,10 @@ package keeper_test import ( - "context" "testing" "time" keepertest "github.com/sei-protocol/sei-chain/testutil/keeper" - dexcache "github.com/sei-protocol/sei-chain/x/dex/cache" - dextypes "github.com/sei-protocol/sei-chain/x/dex/types" - dexutils "github.com/sei-protocol/sei-chain/x/dex/utils" "github.com/sei-protocol/sei-chain/x/epoch/types" minttypes "github.com/sei-protocol/sei-chain/x/mint/types" "github.com/stretchr/testify/require" @@ -38,7 +34,6 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("Initial should be zero", func(t *testing.T) { seiApp := keepertest.TestApp() ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(seiApp.GetMemKey(dextypes.MemStoreKey)))) header := tmproto.Header{ Height: seiApp.LastBlockHeight() + 1, @@ -51,7 +46,6 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("even full release", func(t *testing.T) { seiApp := keepertest.TestApp() ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(seiApp.GetMemKey(dextypes.MemStoreKey)))) header := tmproto.Header{ Height: seiApp.LastBlockHeight() + 1, @@ -97,7 +91,6 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("uneven full release", func(t *testing.T) { seiApp := keepertest.TestApp() ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(seiApp.GetMemKey(dextypes.MemStoreKey)))) header := tmproto.Header{ Height: seiApp.LastBlockHeight() + 1, @@ -144,7 +137,6 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("multiple full releases", func(t *testing.T) { seiApp := keepertest.TestApp() ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(seiApp.GetMemKey(dextypes.MemStoreKey)))) header := tmproto.Header{ Height: seiApp.LastBlockHeight() + 1, @@ -203,7 +195,6 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { t.Run("outage during release", func(t *testing.T) { seiApp := keepertest.TestApp() ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(seiApp.GetMemKey(dextypes.MemStoreKey)))) header := tmproto.Header{ Height: seiApp.LastBlockHeight() + 1, @@ -278,7 +269,6 @@ func TestEndOfEpochMintedCoinDistribution(t *testing.T) { func TestNoEpochPassedNoDistribution(t *testing.T) { seiApp := keepertest.TestApp() ctx := seiApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) - ctx = ctx.WithContext(context.WithValue(ctx.Context(), dexutils.DexMemStateContextKey, dexcache.NewMemState(seiApp.GetMemKey(dextypes.MemStoreKey)))) header := tmproto.Header{Height: seiApp.LastBlockHeight() + 1} seiApp.BeginBlock(ctx, abci.RequestBeginBlock{Header: header}) diff --git a/x/mint/types/gov.pb.go b/x/mint/types/gov.pb.go index 4ebcd8a7e..32a3d8c9a 100644 --- a/x/mint/types/gov.pb.go +++ b/x/mint/types/gov.pb.go @@ -23,8 +23,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// AddAssetMetadataProposal is a gov Content type for adding a new asset -// to the dex module's asset list. type UpdateMinterProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"`

      +i64Y9Hhv? zx@zE@|F-JRf(NQDt&t*&F|rTf(OtS+ZKq9_`nlUca4oG@b8s8JhJep2x8NWlMJ@T5 zDz2rtnM9tvf~&Px(9(WzfqSA9rhf$#wI?|;d&TZSsrVH^L;Lr3X|H{R6((V8@^tIC zZ#96T_A`&Sc6=+Hsla}?19L{b7^yg}pDtTR>0_r21^GG$FKZP%obzKup^eciN432h zbJbU`&$*zgyEV#ymse&CtcJL4!89}s>8%FU=g>v1sLre1+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6GG)4XGH%FO`UW*F1;Md*3M$VIy<^eW_P7%sGXhT+v; zW4Gzpm=zXsE2jTe|2vmvqLo&$Y3biU{+e+^PSCng4;Pf6m3}jb96kCRbE-@C&ed~` zkPkCVuQS<^ZvBvMdPj&})%B5jzQ=U^*vp2DVvpiGF_v!pJL=_zInG$`rOyub1w!K{ zKBx=qLE|lab&Ll607|oT+h6P!U&(El<>+iM9T9u&NK^#5T;N6l=x>ZP7Nw&dSj#kh zo^>|u<;Exw%8*C$dJWG+>pD}5Se0HqUmxkx3y@Qh$i;;btIx4CPrFB}Po0qbLDFQT U?G!|?&mIeS6MO!r0NBU=50r}adH?_b diff --git a/x/dex/testdata/mars.wasm b/x/dex/testdata/mars.wasm deleted file mode 100644 index 8addcee304dbfe95128720b948d636864291403a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 191011 zcmeFa542}jRp)vC{QkY)pZ9+CFZEuk67KIuN?%Ep7LHOy$kKPKsU(O>Ovlw}o0(Kd ziXpE;NGb)5JsGM3X^0RoD6K(J3r(8{gpM}dlh%w@FhI0v32PWTJ&m)03L3Q^9$DqLsoL8PcdUxlN|M9vaF-lzojCC}{J#yoBe)o63^yO3UY>kDlyZ-nMZ{tc9fT&G}Noch> z*G}7c+HN+}@CKE51*npCXgW=s&D(>;xbo4$Ip{}@_ELyaV* zayQ?!Sv|M1R%1)DHLZ_Ipad?f0hL)*Fw!@lD5mG)sCn-E#Z!>u))JlSt>=8n?gs#y2H5_KzL8 z?aenGJ97JVw;#DFd1L4Ln{R&84XW^=w0q-`>h9;#O;trG_t^Ev-*hZ_7D7@ z(|?-2GksTjclu-LyVLii_oVMl7jC%W244HM^uy`DO#j#0jvc>c;UB-{tq-UF%c=BN z(|^K~hiLZ1!d>b6(jQOnRe!&n{#^F9g*&+V&Yw=-ys-b{>Az6%!q2C_kbW+G{laI{ zf0r(N=Wl1P|9utz`*cB7o=X2O9{tDki#+I{eRPE(mzlC zYx-=u@RQk3Wbe=ZJ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