From 2641ffc740ee3f26812306b696919300735c7626 Mon Sep 17 00:00:00 2001 From: Chris Czub Date: Fri, 15 Mar 2024 16:11:49 -0400 Subject: [PATCH] Merge Astria support into Penumbra branch (#16) * update rustfmt * implement `AstriaEndpoint` (#1) * begin AstriaEndpoint impl; update rustfmt * impl send_messages and verify_header * check_misbehaviour and bootstrap * bump deps and work on query methods * implement rest of queries, lint * getting stuff running! hermes working but issue on astria * increase default rpc timeout to 60s * add proof specs for astria * handle nonce in astria endpoint * use no_prehash for proof spec for now * update localnet config for osmosis * cleanup * fix astria address creation and cleanup * implement ICS20Withdrawal on astria for transfer command * merge w upstream (#2) * merge with upstream * add celestia config * remove unused config * bump astria, penumbra, and ibc-proto deps * Resolve penumbra dependencies across astria/penumbra * Use ibc-types v0.12.0 * Fix compilation with a bunch of todos * cargo fmt * Fix some test imports * Test fixes for Penumbra/Astria * Fix compilation and move penumbra/astria dependencies to recent versions --------- Co-authored-by: elizabeth Co-authored-by: noot <36753753+noot@users.noreply.github.com> --- .rustfmt.toml | 3 + Cargo.lock | 1228 ++++++++------ config-astria-celestia.toml | 67 + config-astria-osmosis.toml | 66 + crates/chain-registry/src/asset_list.rs | 3 +- crates/chain-registry/src/chain.rs | 12 +- crates/chain-registry/src/error.rs | 6 +- crates/chain-registry/src/fetchable.rs | 10 +- crates/chain-registry/src/formatter.rs | 19 +- crates/chain-registry/src/paths.rs | 16 +- crates/chain-registry/src/querier.rs | 15 +- crates/relayer-cli/build.rs | 6 +- crates/relayer-cli/src/application.rs | 3 +- crates/relayer-cli/src/bin/hermes/main.rs | 3 +- crates/relayer-cli/src/chain_registry.rs | 50 +- crates/relayer-cli/src/cli_utils.rs | 23 +- crates/relayer-cli/src/commands.rs | 18 +- crates/relayer-cli/src/commands/clear.rs | 42 +- .../relayer-cli/src/commands/completions.rs | 13 +- crates/relayer-cli/src/commands/config.rs | 3 +- .../relayer-cli/src/commands/config/auto.rs | 20 +- .../src/commands/config/validate.rs | 7 +- crates/relayer-cli/src/commands/create.rs | 10 +- .../src/commands/create/channel.rs | 47 +- .../src/commands/create/connection.rs | 28 +- crates/relayer-cli/src/commands/evidence.rs | 99 +- crates/relayer-cli/src/commands/fee.rs | 10 +- .../fee/register_counterparty_payee.rs | 31 +- .../src/commands/fee/register_payee.rs | 31 +- .../relayer-cli/src/commands/fee/transfer.rs | 7 +- crates/relayer-cli/src/commands/health.rs | 17 +- crates/relayer-cli/src/commands/keys.rs | 3 +- crates/relayer-cli/src/commands/keys/add.rs | 50 +- .../relayer-cli/src/commands/keys/balance.rs | 21 +- .../relayer-cli/src/commands/keys/delete.rs | 32 +- crates/relayer-cli/src/commands/keys/list.rs | 15 +- crates/relayer-cli/src/commands/listen.rs | 22 +- crates/relayer-cli/src/commands/logs.rs | 4 +- .../src/commands/logs/log_level.rs | 12 +- crates/relayer-cli/src/commands/logs/raw.rs | 12 +- crates/relayer-cli/src/commands/logs/reset.rs | 8 +- .../relayer-cli/src/commands/misbehaviour.rs | 41 +- crates/relayer-cli/src/commands/query.rs | 11 +- .../relayer-cli/src/commands/query/channel.rs | 35 +- .../src/commands/query/channel_client.rs | 19 +- .../src/commands/query/channel_ends.rs | 44 +- .../src/commands/query/channels.rs | 34 +- .../relayer-cli/src/commands/query/client.rs | 48 +- .../relayer-cli/src/commands/query/clients.rs | 26 +- .../src/commands/query/connection.rs | 38 +- .../src/commands/query/connections.rs | 24 +- .../relayer-cli/src/commands/query/packet.rs | 3 +- .../src/commands/query/packet/ack.rs | 40 +- .../src/commands/query/packet/acks.rs | 17 +- .../src/commands/query/packet/commitment.rs | 34 +- .../src/commands/query/packet/commitments.rs | 14 +- .../src/commands/query/packet/pending.rs | 22 +- .../src/commands/query/packet/pending_acks.rs | 30 +- .../commands/query/packet/pending_sends.rs | 30 +- .../src/commands/query/packet/util.rs | 9 +- .../src/commands/query/transfer.rs | 3 +- .../commands/query/transfer/denom_trace.rs | 16 +- crates/relayer-cli/src/commands/query/tx.rs | 3 +- .../src/commands/query/tx/events.rs | 28 +- crates/relayer-cli/src/commands/start.rs | 38 +- crates/relayer-cli/src/commands/tx.rs | 3 +- crates/relayer-cli/src/commands/tx/channel.rs | 41 +- crates/relayer-cli/src/commands/tx/client.rs | 50 +- .../relayer-cli/src/commands/tx/connection.rs | 21 +- crates/relayer-cli/src/commands/tx/packet.rs | 34 +- .../relayer-cli/src/commands/tx/transfer.rs | 20 +- crates/relayer-cli/src/commands/tx/upgrade.rs | 24 +- crates/relayer-cli/src/commands/update.rs | 3 +- crates/relayer-cli/src/commands/upgrade.rs | 3 +- crates/relayer-cli/src/commands/version.rs | 4 +- crates/relayer-cli/src/components.rs | 6 +- crates/relayer-cli/src/conclude.rs | 2 +- crates/relayer-cli/src/config.rs | 3 +- crates/relayer-cli/src/entry.rs | 9 +- crates/relayer-cli/src/error.rs | 29 +- crates/relayer-cli/src/tracing_handle.rs | 11 +- crates/relayer-rest/src/handle.rs | 6 +- crates/relayer-rest/src/server.rs | 3 +- crates/relayer-rest/tests/mock.rs | 8 +- .../src/applications/ics27_ica/cosmos_tx.rs | 18 +- .../src/applications/ics27_ica/error.rs | 5 +- .../applications/ics27_ica/msgs/register.rs | 22 +- .../applications/ics27_ica/msgs/send_tx.rs | 20 +- .../ics28_ccv/msgs/ccv_double_voting.rs | 11 +- .../ics28_ccv/msgs/ccv_misbehaviour.rs | 12 +- .../src/applications/ics29_fee/error.rs | 9 +- .../src/applications/ics29_fee/events.rs | 19 +- .../applications/ics29_fee/msgs/pay_packet.rs | 18 +- .../ics29_fee/msgs/pay_packet_async.rs | 28 +- .../ics29_fee/msgs/register_payee.rs | 19 +- .../src/applications/ics29_fee/packet_fee.rs | 22 +- .../src/applications/ics31_icq/error.rs | 4 +- .../src/applications/ics31_icq/events.rs | 10 +- .../src/applications/ics31_icq/response.rs | 6 +- .../src/applications/transfer/amount.rs | 5 +- .../src/applications/transfer/coin.rs | 18 +- .../src/applications/transfer/denom.rs | 12 +- .../src/applications/transfer/error.rs | 20 +- .../src/applications/transfer/events.rs | 12 +- .../src/applications/transfer/msgs/mod.rs | 2 + .../src/applications/transfer/msgs/send.rs | 19 +- .../applications/transfer/msgs/transfer.rs | 47 +- .../src/applications/transfer/packet.rs | 11 +- .../clients/ics07_tendermint/client_state.rs | 74 +- .../ics07_tendermint/consensus_state.rs | 24 +- .../src/clients/ics07_tendermint/error.rs | 20 +- .../src/clients/ics07_tendermint/header.rs | 40 +- .../clients/ics07_tendermint/misbehaviour.rs | 14 +- .../src/core/ics02_client/client_state.rs | 16 +- .../src/core/ics02_client/client_type.rs | 4 +- .../src/core/ics02_client/consensus_state.rs | 13 +- .../src/core/ics02_client/error.rs | 18 +- .../src/core/ics02_client/events.rs | 14 +- .../src/core/ics02_client/header.rs | 17 +- .../src/core/ics02_client/height.rs | 11 +- .../src/core/ics02_client/misbehaviour.rs | 3 +- .../src/core/ics02_client/msgs.rs | 8 +- .../core/ics02_client/msgs/create_client.rs | 27 +- .../core/ics02_client/msgs/misbehaviour.rs | 16 +- .../core/ics02_client/msgs/update_client.rs | 33 +- .../core/ics02_client/msgs/upgrade_client.rs | 32 +- .../src/core/ics02_client/trust_threshold.rs | 18 +- .../src/core/ics03_connection/connection.rs | 34 +- .../src/core/ics03_connection/error.rs | 22 +- .../src/core/ics03_connection/events.rs | 9 +- .../src/core/ics03_connection/msgs.rs | 15 +- .../ics03_connection/msgs/conn_open_ack.rs | 49 +- .../msgs/conn_open_confirm.rs | 33 +- .../ics03_connection/msgs/conn_open_init.rs | 50 +- .../ics03_connection/msgs/conn_open_try.rs | 68 +- .../src/core/ics03_connection/version.rs | 20 +- .../src/core/ics04_channel/channel.rs | 40 +- .../src/core/ics04_channel/error.rs | 30 +- .../src/core/ics04_channel/events.rs | 21 +- .../src/core/ics04_channel/msgs.rs | 17 +- .../ics04_channel/msgs/acknowledgement.rs | 43 +- .../ics04_channel/msgs/chan_close_confirm.rs | 43 +- .../ics04_channel/msgs/chan_close_init.rs | 30 +- .../core/ics04_channel/msgs/chan_open_ack.rs | 41 +- .../ics04_channel/msgs/chan_open_confirm.rs | 44 +- .../core/ics04_channel/msgs/chan_open_init.rs | 34 +- .../core/ics04_channel/msgs/chan_open_try.rs | 53 +- .../core/ics04_channel/msgs/recv_packet.rs | 46 +- .../src/core/ics04_channel/msgs/timeout.rs | 45 +- .../ics04_channel/msgs/timeout_on_close.rs | 37 +- .../src/core/ics04_channel/packet.rs | 25 +- .../src/core/ics04_channel/packet_id.rs | 11 +- .../src/core/ics04_channel/timeout.rs | 3 +- .../src/core/ics04_channel/version.rs | 9 +- .../src/core/ics23_commitment/commitment.rs | 16 +- .../src/core/ics23_commitment/merkle.rs | 20 +- .../src/core/ics24_host/identifier.rs | 12 +- .../relayer-types/src/core/ics24_host/path.rs | 11 +- .../src/core/ics24_host/validate.rs | 3 +- .../src/core/ics26_routing/error.rs | 8 +- .../src/core/ics26_routing/msgs.rs | 22 +- crates/relayer-types/src/events.rs | 50 +- crates/relayer-types/src/handler.rs | 4 +- crates/relayer-types/src/mock/client_state.rs | 26 +- .../relayer-types/src/mock/consensus_state.rs | 23 +- crates/relayer-types/src/mock/header.rs | 17 +- crates/relayer-types/src/mock/misbehaviour.rs | 12 +- crates/relayer-types/src/proofs.rs | 3 +- crates/relayer-types/src/serializers.rs | 3 +- crates/relayer-types/src/test.rs | 1 + crates/relayer-types/src/timestamp.rs | 18 +- crates/relayer-types/src/utils/pretty.rs | 14 +- crates/relayer/Cargo.toml | 78 +- crates/relayer/src/cache.rs | 16 +- crates/relayer/src/chain.rs | 1 + crates/relayer/src/chain/astria/endpoint.rs | 1426 +++++++++++++++++ crates/relayer/src/chain/astria/mod.rs | 5 + .../relayer/src/chain/astria/proof_specs.rs | 33 + crates/relayer/src/chain/astria/utils.rs | 52 + crates/relayer/src/chain/client.rs | 17 +- crates/relayer/src/chain/client_settings.rs | 8 +- crates/relayer/src/chain/cosmos.rs | 222 +-- crates/relayer/src/chain/cosmos/batch.rs | 63 +- crates/relayer/src/chain/cosmos/config.rs | 28 +- .../relayer/src/chain/cosmos/config/error.rs | 5 +- crates/relayer/src/chain/cosmos/encode.rs | 38 +- crates/relayer/src/chain/cosmos/estimate.rs | 28 +- crates/relayer/src/chain/cosmos/fee.rs | 28 +- crates/relayer/src/chain/cosmos/gas.rs | 8 +- crates/relayer/src/chain/cosmos/query.rs | 28 +- .../relayer/src/chain/cosmos/query/account.rs | 11 +- .../relayer/src/chain/cosmos/query/balance.rs | 5 +- .../src/chain/cosmos/query/consensus_state.rs | 15 +- .../relayer/src/chain/cosmos/query/custom.rs | 4 +- .../src/chain/cosmos/query/denom_trace.rs | 5 +- crates/relayer/src/chain/cosmos/query/fee.rs | 21 +- .../relayer/src/chain/cosmos/query/status.rs | 6 +- crates/relayer/src/chain/cosmos/query/tx.rs | 39 +- crates/relayer/src/chain/cosmos/retry.rs | 29 +- crates/relayer/src/chain/cosmos/simulate.rs | 8 +- crates/relayer/src/chain/cosmos/tx.rs | 31 +- .../relayer/src/chain/cosmos/types/account.rs | 1 + .../src/chain/cosmos/types/app_state.rs | 3 +- .../relayer/src/chain/cosmos/types/config.rs | 17 +- .../src/chain/cosmos/types/events/channel.rs | 32 +- .../src/chain/cosmos/types/events/fee.rs | 6 +- crates/relayer/src/chain/cosmos/types/gas.rs | 8 +- crates/relayer/src/chain/cosmos/version.rs | 3 +- crates/relayer/src/chain/cosmos/wait.rs | 27 +- crates/relayer/src/chain/counterparty.rs | 22 +- crates/relayer/src/chain/endpoint.rs | 93 +- crates/relayer/src/chain/handle.rs | 18 +- crates/relayer/src/chain/handle/base.rs | 22 +- crates/relayer/src/chain/handle/cache.rs | 83 +- crates/relayer/src/chain/handle/counting.rs | 83 +- crates/relayer/src/chain/penumbra/chain.rs | 16 +- crates/relayer/src/chain/requests.rs | 62 +- crates/relayer/src/chain/runtime.rs | 25 +- crates/relayer/src/channel.rs | 80 +- crates/relayer/src/channel/error.rs | 21 +- crates/relayer/src/channel/version.rs | 3 +- crates/relayer/src/client_state.rs | 50 +- crates/relayer/src/config.rs | 128 +- crates/relayer/src/config/compat_mode.rs | 11 +- crates/relayer/src/config/error.rs | 3 +- crates/relayer/src/config/filter.rs | 24 +- crates/relayer/src/config/gas_multiplier.rs | 10 +- crates/relayer/src/config/proof_specs.rs | 1 + crates/relayer/src/config/types.rs | 20 +- crates/relayer/src/connection.rs | 69 +- crates/relayer/src/connection/error.rs | 21 +- crates/relayer/src/consensus_state.rs | 36 +- crates/relayer/src/error.rs | 64 +- crates/relayer/src/event.rs | 59 +- crates/relayer/src/event/bus.rs | 5 +- crates/relayer/src/event/error.rs | 4 +- crates/relayer/src/event/source.rs | 7 +- crates/relayer/src/event/source/rpc.rs | 26 +- .../relayer/src/event/source/rpc/extract.rs | 17 +- crates/relayer/src/event/source/websocket.rs | 19 +- .../src/event/source/websocket/extract.rs | 28 +- crates/relayer/src/foreign_client.rs | 75 +- crates/relayer/src/keyring.rs | 11 +- .../relayer/src/keyring/ed25519_key_pair.rs | 18 +- crates/relayer/src/keyring/errors.rs | 3 +- .../relayer/src/keyring/secp256k1_key_pair.rs | 4 + crates/relayer/src/lib.rs | 2 +- crates/relayer/src/light_client.rs | 11 +- crates/relayer/src/light_client/tendermint.rs | 45 +- .../src/light_client/tendermint/detector.rs | 6 +- crates/relayer/src/link.rs | 18 +- crates/relayer/src/link/cli.rs | 56 +- crates/relayer/src/link/error.rs | 28 +- crates/relayer/src/link/operational_data.rs | 28 +- crates/relayer/src/link/packet_events.rs | 21 +- crates/relayer/src/link/pending.rs | 30 +- crates/relayer/src/link/relay_path.rs | 131 +- crates/relayer/src/link/relay_sender.rs | 13 +- crates/relayer/src/link/tx_hashes.rs | 4 +- crates/relayer/src/misbehaviour.rs | 24 +- crates/relayer/src/object.rs | 37 +- crates/relayer/src/path.rs | 6 +- crates/relayer/src/registry.rs | 6 +- crates/relayer/src/rest.rs | 3 +- crates/relayer/src/rest/error.rs | 3 +- crates/relayer/src/rest/request.rs | 3 +- crates/relayer/src/spawn.rs | 8 +- crates/relayer/src/supervisor.rs | 12 +- .../src/supervisor/client_state_filter.rs | 34 +- crates/relayer/src/supervisor/dump_state.rs | 6 +- crates/relayer/src/supervisor/error.rs | 13 +- crates/relayer/src/supervisor/scan.rs | 20 +- crates/relayer/src/supervisor/spawn.rs | 12 +- crates/relayer/src/transfer.rs | 123 +- crates/relayer/src/upgrade_chain.rs | 41 +- crates/relayer/src/util/compat_mode.rs | 6 +- crates/relayer/src/util/diff.rs | 6 +- crates/relayer/src/util/profiling.rs | 13 +- crates/relayer/src/util/retry.rs | 3 +- crates/relayer/src/util/stream.rs | 9 +- crates/relayer/src/util/task.rs | 11 +- crates/relayer/src/worker.rs | 7 +- crates/relayer/src/worker/channel.rs | 14 +- crates/relayer/src/worker/client.rs | 20 +- crates/relayer/src/worker/connection.rs | 13 +- .../relayer/src/worker/cross_chain_query.rs | 29 +- crates/relayer/src/worker/error.rs | 4 +- crates/relayer/src/worker/handle.rs | 24 +- crates/relayer/src/worker/map.rs | 10 +- crates/relayer/src/worker/packet.rs | 66 +- crates/relayer/src/worker/retry_strategy.rs | 3 +- crates/telemetry/src/encoder.rs | 15 +- crates/telemetry/src/lib.rs | 10 +- crates/telemetry/src/server.rs | 13 +- crates/telemetry/src/state.rs | 33 +- .../src/bin/test_setup_with_binary_channel.rs | 9 +- ...t_setup_with_fee_enabled_binary_channel.rs | 9 +- .../bin/test_setup_with_ternary_channel.rs | 9 +- tools/integration-test/src/mbt/handlers.rs | 36 +- tools/integration-test/src/mbt/itf.rs | 3 +- tools/integration-test/src/mbt/transfer.rs | 24 +- tools/integration-test/src/mbt/utils.rs | 7 +- .../src/tests/async_icq/simple_query.rs | 20 +- .../src/tests/clean_workers.rs | 11 +- .../src/tests/clear_packet.rs | 10 +- .../src/tests/client_expiration.rs | 34 +- .../src/tests/client_filter.rs | 20 +- .../src/tests/client_refresh.rs | 15 +- .../src/tests/client_settings.rs | 19 +- .../src/tests/client_upgrade.rs | 24 +- .../src/tests/connection_delay.rs | 8 +- .../src/tests/consensus_states.rs | 1 - .../integration-test/src/tests/denom_trace.rs | 3 +- .../src/tests/dynamic_gas_fee.rs | 4 + .../src/tests/error_events.rs | 3 +- .../src/tests/execute_schedule.rs | 4 +- .../src/tests/fee/auto_forward_relayer.rs | 3 +- .../src/tests/fee/filter_fees.rs | 11 +- .../src/tests/fee/forward_relayer.rs | 3 +- .../src/tests/fee/no_forward_relayer.rs | 3 +- .../src/tests/fee/non_fee_channel.rs | 3 +- .../src/tests/fee/pay_fee_async.rs | 6 +- .../src/tests/fee/register_payee.rs | 3 +- .../src/tests/fee/timeout_fee.rs | 6 +- tools/integration-test/src/tests/fee_grant.rs | 9 +- tools/integration-test/src/tests/ica.rs | 2 + .../src/tests/ics20_filter/memo.rs | 1 - tools/integration-test/src/tests/ics31.rs | 19 +- .../tests/interchain_security/ica_transfer.rs | 38 +- .../src/tests/interchain_security/icq.rs | 13 +- .../interchain_security/simple_transfer.rs | 14 +- .../src/tests/manual/simulation.rs | 7 +- tools/integration-test/src/tests/memo.rs | 13 +- .../src/tests/ordered_channel.rs | 6 +- .../src/tests/ordered_channel_clear.rs | 14 +- tools/integration-test/src/tests/python.rs | 11 +- .../src/tests/query_packet.rs | 16 +- .../integration-test/src/tests/supervisor.rs | 13 +- .../src/tests/tendermint/sequential.rs | 15 +- .../src/tests/ternary_transfer.rs | 3 +- tools/integration-test/src/tests/transfer.rs | 3 +- .../src/bootstrap/binary/chain.rs | 38 +- .../src/bootstrap/binary/channel.rs | 31 +- .../src/bootstrap/binary/connection.rs | 26 +- .../test-framework/src/bootstrap/consumer.rs | 21 +- tools/test-framework/src/bootstrap/init.rs | 8 +- .../src/bootstrap/nary/chain.rs | 31 +- .../src/bootstrap/nary/channel.rs | 35 +- .../src/bootstrap/nary/connection.rs | 28 +- tools/test-framework/src/bootstrap/single.rs | 26 +- tools/test-framework/src/chain/builder.rs | 13 +- tools/test-framework/src/chain/chain_type.rs | 13 +- .../test-framework/src/chain/cli/async_icq.rs | 3 +- .../test-framework/src/chain/cli/bootstrap.rs | 20 +- .../test-framework/src/chain/cli/fee_grant.rs | 3 +- .../test-framework/src/chain/cli/host_zone.rs | 3 +- tools/test-framework/src/chain/cli/ica.rs | 6 +- .../test-framework/src/chain/cli/provider.rs | 9 +- tools/test-framework/src/chain/cli/query.rs | 9 +- .../test-framework/src/chain/cli/transfer.rs | 3 +- tools/test-framework/src/chain/cli/upgrade.rs | 3 +- tools/test-framework/src/chain/cli/version.rs | 4 +- tools/test-framework/src/chain/config.rs | 1 + tools/test-framework/src/chain/driver.rs | 31 +- tools/test-framework/src/chain/exec.rs | 4 +- .../test-framework/src/chain/ext/async_icq.rs | 14 +- .../test-framework/src/chain/ext/bootstrap.rs | 47 +- .../src/chain/ext/crosschainquery.rs | 13 +- tools/test-framework/src/chain/ext/fee.rs | 30 +- .../test-framework/src/chain/ext/fee_grant.rs | 10 +- tools/test-framework/src/chain/ext/ica.rs | 26 +- .../test-framework/src/chain/ext/proposal.rs | 21 +- .../test-framework/src/chain/ext/transfer.rs | 34 +- tools/test-framework/src/chain/ext/version.rs | 9 +- tools/test-framework/src/chain/tagged.rs | 34 +- tools/test-framework/src/chain/version.rs | 6 +- tools/test-framework/src/error.rs | 15 +- tools/test-framework/src/framework/base.rs | 9 +- .../src/framework/binary/chain.rs | 42 +- .../src/framework/binary/channel.rs | 56 +- .../src/framework/binary/connection.rs | 37 +- .../src/framework/binary/ics.rs | 27 +- .../src/framework/binary/node.rs | 14 +- .../src/framework/nary/chain.rs | 35 +- .../src/framework/nary/channel.rs | 47 +- .../src/framework/nary/connection.rs | 39 +- .../test-framework/src/framework/nary/node.rs | 20 +- .../test-framework/src/framework/overrides.rs | 42 +- tools/test-framework/src/ibc/denom.rs | 7 +- tools/test-framework/src/ibc/token.rs | 19 +- tools/test-framework/src/prelude.rs | 147 +- tools/test-framework/src/relayer/chain.rs | 75 +- tools/test-framework/src/relayer/channel.rs | 37 +- .../test-framework/src/relayer/connection.rs | 32 +- tools/test-framework/src/relayer/driver.rs | 19 +- tools/test-framework/src/relayer/fee.rs | 51 +- .../src/relayer/foreign_client.rs | 9 +- tools/test-framework/src/relayer/refresh.rs | 9 +- tools/test-framework/src/relayer/transfer.rs | 42 +- tools/test-framework/src/relayer/tx.rs | 16 +- .../test-framework/src/types/binary/chains.rs | 10 +- .../src/types/binary/channel.rs | 9 +- .../test-framework/src/types/binary/client.rs | 6 +- .../src/types/binary/connection.rs | 9 +- .../src/types/binary/foreign_client.rs | 7 +- tools/test-framework/src/types/env.rs | 8 +- tools/test-framework/src/types/id.rs | 3 +- tools/test-framework/src/types/nary/chains.rs | 25 +- .../test-framework/src/types/nary/channel.rs | 18 +- .../src/types/nary/connection.rs | 15 +- .../src/types/nary/foreign_client.rs | 18 +- tools/test-framework/src/types/process.rs | 3 +- tools/test-framework/src/types/single/node.rs | 46 +- tools/test-framework/src/types/tagged/dual.rs | 10 +- tools/test-framework/src/types/tagged/mono.rs | 11 +- tools/test-framework/src/types/wallet.rs | 7 +- tools/test-framework/src/util/array.rs | 1 + tools/test-framework/src/util/file.rs | 4 +- .../src/util/interchain_security.rs | 7 +- .../src/util/proposal_status.rs | 3 +- tools/test-framework/src/util/random.rs | 7 +- tools/test-framework/src/util/retry.rs | 1 + tools/test-framework/src/util/suspend.rs | 7 +- 423 files changed, 7276 insertions(+), 4460 deletions(-) create mode 100644 config-astria-celestia.toml create mode 100644 config-astria-osmosis.toml create mode 100644 crates/relayer/src/chain/astria/endpoint.rs create mode 100644 crates/relayer/src/chain/astria/mod.rs create mode 100644 crates/relayer/src/chain/astria/proof_specs.rs create mode 100644 crates/relayer/src/chain/astria/utils.rs diff --git a/.rustfmt.toml b/.rustfmt.toml index 8c83f08221..3f8091e26c 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,5 +1,8 @@ max_width = 100 reorder_imports = true +imports_layout = "Vertical" +imports_granularity = "Crate" +group_imports = "StdExternalCrate" # nightly only diff --git a/Cargo.lock b/Cargo.lock index d1faf3b448..ba685fec7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if 1.0.0", "cipher 0.4.4", @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -143,9 +143,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -177,9 +177,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "arc-swap" @@ -415,6 +415,54 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "astria-core" +version = "0.1.0" +source = "git+https://github.com/astriaorg/astria?rev=112a66d6f9bb6638cce4935c949834e1d35416bb#112a66d6f9bb6638cce4935c949834e1d35416bb" +dependencies = [ + "astria-merkle", + "bytes", + "ed25519-consensus", + "hex", + "ibc-types", + "indexmap 2.2.5", + "penumbra-ibc", + "penumbra-proto", + "prost 0.12.3", + "prost-types", + "sha2 0.10.8", + "tendermint 0.32.0", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", + "thiserror", + "tracing", +] + +[[package]] +name = "astria-merkle" +version = "0.1.0" +source = "git+https://github.com/astriaorg/astria?rev=112a66d6f9bb6638cce4935c949834e1d35416bb#112a66d6f9bb6638cce4935c949834e1d35416bb" +dependencies = [ + "sha2 0.10.8", +] + +[[package]] +name = "astria-sequencer-client" +version = "0.1.0" +source = "git+https://github.com/astriaorg/astria?rev=112a66d6f9bb6638cce4935c949834e1d35416bb#112a66d6f9bb6638cce4935c949834e1d35416bb" +dependencies = [ + "astria-core", + "async-trait", + "futures", + "hex", + "prost 0.12.3", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", + "tendermint-rpc", + "thiserror", + "tracing", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -434,7 +482,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -445,7 +493,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -560,6 +608,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.21.7" @@ -617,7 +671,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -825,9 +879,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" [[package]] name = "byte-slice-cast" @@ -894,9 +948,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -916,11 +970,10 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ - "jobserver", "libc", ] @@ -972,15 +1025,15 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -1063,8 +1116,8 @@ dependencies = [ [[package]] name = "cnidarium" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "async-trait", @@ -1072,8 +1125,8 @@ dependencies = [ "futures", "hex", "ibc-types", - "ics23", - "jmt", + "ics23 0.11.1", + "jmt 0.9.0", "metrics", "once_cell", "parking_lot", @@ -1083,7 +1136,7 @@ dependencies = [ "sha2 0.10.8", "smallvec", "tempfile", - "tendermint", + "tendermint 0.34.1", "tokio", "tokio-stream", "tracing", @@ -1091,14 +1144,14 @@ dependencies = [ [[package]] name = "cnidarium-component" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "async-trait", "cnidarium", "hex", - "tendermint", + "tendermint 0.34.1", ] [[package]] @@ -1231,9 +1284,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils 0.8.19", ] @@ -1304,9 +1357,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -1327,7 +1380,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -1345,9 +1398,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.5" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ "darling_core", "darling_macro", @@ -1355,27 +1408,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.5" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.78", "quote", "strsim", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "darling_macro" -version = "0.20.5" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -1457,8 +1510,8 @@ dependencies = [ [[package]] name = "decaf377-fmd" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "ark-ff", "ark-serialize", @@ -1471,8 +1524,8 @@ dependencies = [ [[package]] name = "decaf377-frost" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -1487,8 +1540,8 @@ dependencies = [ [[package]] name = "decaf377-ka" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "ark-ff", "decaf377 0.5.0", @@ -1501,9 +1554,9 @@ dependencies = [ [[package]] name = "decaf377-rdsa" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc48f39a9939244f1d1e043b8065330022b8c4337cf359f32231fed8b2165973" +checksum = "2356bb010273c2b6e4e928b2bb442ddaa255ec242c16ff46cf9c3811fefa5ace" dependencies = [ "ark-ff", "ark-serialize", @@ -1639,7 +1692,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -1653,9 +1706,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" @@ -1699,9 +1752,9 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", @@ -1726,9 +1779,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elliptic-curve" @@ -1782,18 +1835,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "log", -] - -[[package]] -name = "env_logger" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" dependencies = [ "anstream", "anstyle", @@ -1844,9 +1888,9 @@ checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" [[package]] name = "eyre" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", @@ -1890,9 +1934,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" [[package]] name = "fixed-hash" @@ -2043,7 +2087,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -2185,18 +2229,18 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.1", + "indexmap 2.2.5", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.10", "tracing", ] [[package]] name = "half" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "hash32" @@ -2297,9 +2341,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -2439,9 +2483,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2468,7 +2512,7 @@ dependencies = [ "flex-error", "futures", "http", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-relayer-types", "itertools 0.10.5", "reqwest", @@ -2488,32 +2532,14 @@ dependencies = [ "ibc-relayer", "ibc-relayer-types", "ibc-test-framework", - "prost", + "prost 0.12.3", "serde", "serde_json", "tempfile", - "tendermint", + "tendermint 0.34.1", "tendermint-rpc", "time", - "toml 0.8.8", - "tonic", -] - -[[package]] -name = "ibc-proto" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4222cfac37f21da28292db0f2673fdb8455284895891ff09979680243efb9a20" -dependencies = [ - "base64", - "bytes", - "flex-error", - "ics23", - "informalsystems-pbjson", - "prost", - "serde", - "subtle-encoding", - "tendermint-proto", + "toml 0.8.10", "tonic", ] @@ -2523,15 +2549,15 @@ version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd4ee32b22d3b06f31529b956f4928e5c9a068d71e46cf6abfa19c31ca550553" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "flex-error", - "ics23", - "informalsystems-pbjson", - "prost", + "ics23 0.11.1", + "informalsystems-pbjson 0.7.0", + "prost 0.12.3", "serde", "subtle-encoding", - "tendermint-proto", + "tendermint-proto 0.34.1", "tonic", ] @@ -2540,19 +2566,22 @@ name = "ibc-relayer" version = "0.27.0" dependencies = [ "anyhow", + "astria-core", + "astria-sequencer-client", "async-stream", "bech32 0.9.1", "bitcoin", "bs58", "byte-unit", "bytes", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "digest 0.10.7", "dirs-next", "ed25519", + "ed25519-consensus", "ed25519-dalek", "ed25519-dalek-bip32", - "env_logger 0.11.1", + "env_logger", "flex-error", "futures", "generic-array", @@ -2561,10 +2590,12 @@ dependencies = [ "http", "humantime", "humantime-serde", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-relayer-types", "ibc-telemetry", + "ibc-types", "itertools 0.10.5", + "jmt 0.6.0", "moka", "num-bigint", "num-rational", @@ -2579,7 +2610,7 @@ dependencies = [ "penumbra-transaction", "penumbra-view", "penumbra-wallet", - "prost", + "prost 0.12.3", "regex", "reqwest", "retry", @@ -2594,11 +2625,11 @@ dependencies = [ "signature", "strum", "subtle-encoding", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client", "tendermint-light-client-detector", "tendermint-light-client-verifier", - "tendermint-proto", + "tendermint-proto 0.34.1", "tendermint-rpc", "tendermint-testgen", "test-log", @@ -2607,11 +2638,11 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.8", + "toml 0.8.10", "tonic", "tracing", "tracing-subscriber 0.3.18", - "uuid 1.7.0", + "uuid", ] [[package]] @@ -2623,7 +2654,7 @@ dependencies = [ "clap_complete", "color-eyre", "console", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "dialoguer", "dirs-next", "eyre", @@ -2646,7 +2677,7 @@ dependencies = [ "serial_test", "signal-hook", "subtle-encoding", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client-verifier", "tendermint-rpc", "time", @@ -2660,13 +2691,13 @@ name = "ibc-relayer-rest" version = "0.27.0" dependencies = [ "axum", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "ibc-relayer", "ibc-relayer-types", "reqwest", "serde", "tokio", - "toml 0.8.8", + "toml 0.8.10", "tracing", ] @@ -2676,22 +2707,22 @@ version = "0.27.0" dependencies = [ "bytes", "derive_more", - "env_logger 0.11.1", + "env_logger", "flex-error", - "ibc-proto 0.41.0", - "ics23", + "ibc-proto", + "ics23 0.11.1", "itertools 0.10.5", "num-rational", "primitive-types", - "prost", + "prost 0.12.3", "regex", "serde", "serde_derive", "serde_json", "subtle-encoding", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client-verifier", - "tendermint-proto", + "tendermint-proto 0.34.1", "tendermint-rpc", "tendermint-testgen", "test-log", @@ -2715,7 +2746,7 @@ dependencies = [ "prometheus", "serde", "serde_json", - "tendermint", + "tendermint 0.34.1", "tokio", "tracing", ] @@ -2725,19 +2756,19 @@ name = "ibc-test-framework" version = "0.27.0" dependencies = [ "color-eyre", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "eyre", "flex-error", "hdpath", "hex", "http", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-relayer", "ibc-relayer-cli", "ibc-relayer-types", "itertools 0.10.5", "once_cell", - "prost", + "prost 0.12.3", "rand", "semver", "serde", @@ -2747,7 +2778,7 @@ dependencies = [ "subtle-encoding", "tendermint-rpc", "tokio", - "toml 0.8.8", + "toml 0.8.10", "tonic", "tracing", "tracing-subscriber 0.3.18", @@ -2755,9 +2786,9 @@ dependencies = [ [[package]] name = "ibc-types" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3178d46ae589af5cab981989a8c631a76d12411edc54d23fd35a52e2fffee07f" +checksum = "ba606d86e2015991f86a129935dbaeacd94beab72fb90a733c1b1ea76be708a2" dependencies = [ "ibc-types-core-channel", "ibc-types-core-client", @@ -2773,67 +2804,67 @@ dependencies = [ [[package]] name = "ibc-types-core-channel" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743cdc9ec7f4b2c0985136ee0af8f24536b5e1624fb5d88fde7c300881322a82" +checksum = "86fb64ef52086b727e5ae01da0e773f8ca9172ec1fd9d0aa1a79c0c2c610b17a" dependencies = [ "anyhow", "bytes", "derive_more", "displaydoc", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types-core-client", "ibc-types-core-commitment", "ibc-types-core-connection", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23", + "ics23 0.11.1", "num-traits", "proc-macro2 0.1.10", - "prost", + "prost 0.12.3", "safe-regex", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint", - "tendermint-proto", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", "time", "tracing", ] [[package]] name = "ibc-types-core-client" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab7ff8d18f423c0ec0614104f3c07e320cdce2ae5d395606c7d83e4e25a34afc" +checksum = "4db9d4b136b9e84ccf581fec02bb9ebc4478ac0f145c526760ed4310b98741e7" dependencies = [ "anyhow", "bytes", "derive_more", "displaydoc", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23", + "ics23 0.11.1", "num-traits", - "prost", + "prost 0.12.3", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint", - "tendermint-proto", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", "time", ] [[package]] name = "ibc-types-core-commitment" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421f7cdfc48065437b276a2abe597ef47d6ffaff4815ba4efd111d5a3af43998" +checksum = "7e2c527e14707dd0b2c7e6e2f6f62b0655c83154ae3eb1504e441d9d8f454ac6" dependencies = [ "anyhow", "bytes", @@ -2842,22 +2873,22 @@ dependencies = [ "dyn-clone", "erased-serde", "hex", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23", + "ics23 0.11.1", "num-traits", "primitive-types", - "prost", + "prost 0.12.3", "safe-regex", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client-verifier", - "tendermint-proto", + "tendermint-proto 0.34.1", "time", "tracing", "uint", @@ -2865,49 +2896,49 @@ dependencies = [ [[package]] name = "ibc-types-core-connection" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f79832a232d5a69325f87aff6a4703c5490f39107a223998b30e83bc3a69510" +checksum = "5a8a326c00e9ba48059407478c826237fe39cc90dd2b47182484192926904fe7" dependencies = [ "anyhow", "bytes", "derive_more", "displaydoc", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types-core-client", "ibc-types-core-commitment", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23", + "ics23 0.11.1", "num-traits", - "prost", + "prost 0.12.3", "safe-regex", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint", - "tendermint-proto", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", "time", ] [[package]] name = "ibc-types-domain-type" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73649683daa4fa967f54ef7cf3f98429522895c37fc2dee2a94d490969444779" +checksum = "3abc9619b9dd7201804f45fc7f335dda72d2e4d6f82d96e8fe3abf4585e6101b" dependencies = [ "anyhow", "bytes", - "prost", + "prost 0.12.3", ] [[package]] name = "ibc-types-identifier" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e007333cded43d125cacb26aeb1a3630a8ffe03144d798ad9a8f2c99e4529a3a" +checksum = "405880cf06fef65f51c5c91b7efbdcbc8d7eba0ac16b43538b36ebd17f21edea" dependencies = [ "displaydoc", "serde", @@ -2915,9 +2946,9 @@ dependencies = [ [[package]] name = "ibc-types-lightclients-tendermint" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f9305a26e8d78faca85ac5414d5432549bb6c196a49032c00e723c9054d7b5" +checksum = "2ab22446058bd5afa50d64f8519a9107bbc5101ee65373df896314f52afa0fc6" dependencies = [ "anyhow", "bytes", @@ -2925,25 +2956,25 @@ dependencies = [ "displaydoc", "dyn-clone", "erased-serde", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types-core-client", "ibc-types-core-commitment", "ibc-types-core-connection", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23", + "ics23 0.11.1", "num-traits", "primitive-types", - "prost", + "prost 0.12.3", "safe-regex", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client-verifier", - "tendermint-proto", + "tendermint-proto 0.34.1", "time", "tracing", "uint", @@ -2951,9 +2982,9 @@ dependencies = [ [[package]] name = "ibc-types-path" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22688a533f90b48e6fde7a1271028f01b66f7a44d298747403bc346fdf08529" +checksum = "a29e6fd8871fdced76402a3008219abf8773e527a46f120e0d76d6a3bb9706c1" dependencies = [ "bytes", "derive_more", @@ -2962,38 +2993,38 @@ dependencies = [ "ibc-types-core-client", "ibc-types-core-connection", "num-traits", - "prost", + "prost 0.12.3", "serde", "serde_json", "subtle-encoding", - "tendermint", - "tendermint-proto", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", "time", ] [[package]] name = "ibc-types-timestamp" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e93de4be3480445111959b61b10b4f1865e6cad206961a46cb5170b88fdfc0" +checksum = "93d2e763838dbef62ca8a1344b4dd5b3919d685b4c61874183724644c912237a" dependencies = [ "bytes", "displaydoc", "num-traits", - "prost", + "prost 0.12.3", "serde", "serde_json", "subtle-encoding", - "tendermint", - "tendermint-proto", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", "time", ] [[package]] name = "ibc-types-transfer" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f7420000987bca27f718a44a220efbf4114dcf8dffbfea1aaed6e9b1e9551a" +checksum = "ad973ca1fbad8d0d1632ec0a329aecff8731bbb96395b7553d6b9fd749356d34" dependencies = [ "displaydoc", "serde", @@ -3011,6 +3042,23 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "ics23" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442d4bab37956e76f739c864f246c825d87c0bb7f9afa65660c57833c91bf6d4" +dependencies = [ + "anyhow", + "bytes", + "hex", + "informalsystems-pbjson 0.6.0", + "prost 0.11.9", + "ripemd", + "serde", + "sha2 0.10.8", + "sha3", +] + [[package]] name = "ics23" version = "0.11.1" @@ -3022,8 +3070,8 @@ dependencies = [ "blake3", "bytes", "hex", - "informalsystems-pbjson", - "prost", + "informalsystems-pbjson 0.7.0", + "prost 0.12.3", "ripemd", "serde", "sha2 0.10.8", @@ -3109,22 +3157,32 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", "serde", ] +[[package]] +name = "informalsystems-pbjson" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4eecd90f87bea412eac91c6ef94f6b1e390128290898cbe14f2b926787ae1fb" +dependencies = [ + "base64 0.13.1", + "serde", +] + [[package]] name = "informalsystems-pbjson" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" dependencies = [ - "base64", + "base64 0.21.7", "serde", ] @@ -3169,16 +3227,15 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jmt" -version = "0.9.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2950721a65dff82492e30fe67076127135d0d710aa0140f21efafda2aee7849" +checksum = "e1a302f0defd323b833c9848c20ab40c3156128f50d7bf8eebeed2ef58167258" dependencies = [ "anyhow", "borsh", - "digest 0.10.7", "hashbrown 0.13.2", "hex", - "ics23", + "ics23 0.10.2", "itertools 0.10.5", "mirai-annotations", "num-derive", @@ -3190,19 +3247,32 @@ dependencies = [ ] [[package]] -name = "jobserver" -version = "0.1.27" +name = "jmt" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "c2950721a65dff82492e30fe67076127135d0d710aa0140f21efafda2aee7849" dependencies = [ - "libc", + "anyhow", + "borsh", + "digest 0.10.7", + "hashbrown 0.13.2", + "hex", + "ics23 0.11.1", + "itertools 0.10.5", + "mirai-annotations", + "num-derive", + "num-traits", + "serde", + "sha2 0.10.8", + "thiserror", + "tracing", ] [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -3242,9 +3312,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -3329,9 +3399,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lz4-sys" @@ -3393,9 +3463,9 @@ dependencies = [ [[package]] name = "metrics" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b9e10a211c839210fd7f99954bda26e5f8e26ec686ad68da6a32df7c80e782" +checksum = "cd71d9db2e4287c3407fa04378b8c2ee570aebe0854431562cdd89ca091854f4" dependencies = [ "ahash", "portable-atomic", @@ -3415,9 +3485,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -3445,7 +3515,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" dependencies = [ - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "crossbeam-epoch", "crossbeam-utils 0.8.19", "once_cell", @@ -3457,7 +3527,7 @@ dependencies = [ "tagptr", "thiserror", "triomphe", - "uuid 1.7.0", + "uuid", ] [[package]] @@ -3514,13 +3584,19 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-derive" version = "0.3.3" @@ -3534,19 +3610,18 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" dependencies = [ "autocfg", "num-integer", @@ -3568,9 +3643,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -3581,7 +3656,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.4", + "hermit-abi 0.3.9", "libc", ] @@ -3665,7 +3740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1" dependencies = [ "async-trait", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "dashmap", "fnv", "futures-channel", @@ -3757,7 +3832,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" dependencies = [ - "base64", + "base64 0.21.7", "serde", ] @@ -3769,7 +3844,7 @@ checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" dependencies = [ "heck", "itertools 0.11.0", - "prost", + "prost 0.12.3", "prost-types", ] @@ -3783,7 +3858,7 @@ dependencies = [ "chrono", "pbjson", "pbjson-build", - "prost", + "prost 0.12.3", "prost-build", "serde", ] @@ -3815,9 +3890,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "peg" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166a" +checksum = "400bcab7d219c38abf8bd7cc2054eb9bbbd4312d66f6a5557d572a203f646f61" dependencies = [ "peg-macros", "peg-runtime", @@ -3825,9 +3900,9 @@ dependencies = [ [[package]] name = "peg-macros" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844c" +checksum = "46e61cce859b76d19090f62da50a9fe92bab7c2a5f09e183763559a2ac392c90" dependencies = [ "peg-runtime", "proc-macro2 1.0.78", @@ -3836,19 +3911,19 @@ dependencies = [ [[package]] name = "peg-runtime" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088" +checksum = "36bae92c60fa2398ce4678b98b2c4b5a7c61099961ca1fa305aec04a9ad28922" [[package]] name = "penumbra-app" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", "async-trait", - "base64", + "base64 0.21.7", "bech32 0.8.1", "bincode", "bitvec", @@ -3859,10 +3934,11 @@ dependencies = [ "decaf377-rdsa", "futures", "hex", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types", + "ics23 0.11.1", "im", - "jmt", + "jmt 0.9.0", "metrics", "once_cell", "parking_lot", @@ -3884,9 +3960,10 @@ dependencies = [ "penumbra-shielded-pool", "penumbra-stake", "penumbra-tct", + "penumbra-tower-trace", "penumbra-transaction", "penumbra-txhash", - "prost", + "prost 0.12.3", "rand_chacha", "regex", "serde", @@ -3895,18 +3972,23 @@ dependencies = [ "serde_with", "sha2 0.10.8", "tempfile", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client-verifier", - "tendermint-proto", + "tendermint-proto 0.34.1", "tokio", + "tokio-util 0.7.10", "tonic", + "tower", + "tower-abci", + "tower-actor", + "tower-service", "tracing", ] [[package]] name = "penumbra-asset" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -3914,7 +3996,7 @@ dependencies = [ "ark-relations", "ark-serialize", "ark-std", - "base64", + "base64 0.21.7", "bech32 0.8.1", "blake2b_simd 1.0.2", "bytes", @@ -3942,13 +4024,13 @@ dependencies = [ [[package]] name = "penumbra-community-pool" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", "async-trait", - "base64", + "base64 0.21.7", "blake2b_simd 1.0.2", "cnidarium", "cnidarium-component", @@ -3964,18 +4046,18 @@ dependencies = [ "penumbra-sct", "penumbra-shielded-pool", "penumbra-txhash", - "prost", + "prost 0.12.3", "serde", "sha2 0.10.8", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client-verifier", "tracing", ] [[package]] name = "penumbra-compact-block" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -4002,7 +4084,7 @@ dependencies = [ "rand", "rand_core", "serde", - "tendermint", + "tendermint 0.34.1", "tokio", "tokio-stream", "tonic", @@ -4011,13 +4093,13 @@ dependencies = [ [[package]] name = "penumbra-custody" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", "ark-serialize", - "base64", + "base64 0.21.7", "blake2b_simd 1.0.2", "bytes", "chacha20poly1305", @@ -4032,7 +4114,7 @@ dependencies = [ "penumbra-proto", "penumbra-transaction", "penumbra-txhash", - "prost", + "prost 0.12.3", "rand_core", "serde", "serde_json", @@ -4044,8 +4126,8 @@ dependencies = [ [[package]] name = "penumbra-dex" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -4056,7 +4138,7 @@ dependencies = [ "ark-snark", "async-stream", "async-trait", - "base64", + "base64 0.21.7", "bincode", "blake2b_simd 1.0.2", "cnidarium", @@ -4083,13 +4165,14 @@ dependencies = [ "penumbra-tct", "penumbra-txhash", "poseidon377", - "prost", + "prost 0.12.3", "rand_core", "regex", "serde", "serde_json", "sha2 0.10.8", - "tendermint", + "tap", + "tendermint 0.34.1", "tendermint-light-client-verifier", "thiserror", "tokio", @@ -4099,8 +4182,8 @@ dependencies = [ [[package]] name = "penumbra-distributions" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "async-trait", @@ -4111,14 +4194,14 @@ dependencies = [ "penumbra-proto", "penumbra-sct", "serde", - "tendermint", + "tendermint 0.34.1", "tracing", ] [[package]] name = "penumbra-fee" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -4136,21 +4219,22 @@ dependencies = [ "rand", "rand_core", "serde", - "tendermint", + "tendermint 0.34.1", "tonic", "tracing", ] [[package]] name = "penumbra-funding" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "async-trait", "cnidarium", "cnidarium-component", "futures", + "metrics", "penumbra-asset", "penumbra-community-pool", "penumbra-distributions", @@ -4159,14 +4243,14 @@ dependencies = [ "penumbra-shielded-pool", "penumbra-stake", "serde", - "tendermint", + "tendermint 0.34.1", "tracing", ] [[package]] name = "penumbra-genesis" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "penumbra-community-pool", @@ -4184,8 +4268,8 @@ dependencies = [ [[package]] name = "penumbra-governance" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -4196,7 +4280,7 @@ dependencies = [ "ark-snark", "async-stream", "async-trait", - "base64", + "base64 0.21.7", "blake2b_simd 1.0.2", "bytes", "cnidarium", @@ -4229,7 +4313,9 @@ dependencies = [ "rand_core", "regex", "serde", - "tendermint", + "tap", + "tendermint 0.34.1", + "thiserror", "tokio", "tonic", "tracing", @@ -4237,19 +4323,19 @@ dependencies = [ [[package]] name = "penumbra-ibc" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", "async-trait", - "base64", + "base64 0.21.7", "blake2b_simd 1.0.2", "cnidarium", "hex", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types", - "ics23", + "ics23 0.11.1", "metrics", "num-traits", "once_cell", @@ -4259,11 +4345,11 @@ dependencies = [ "penumbra-proto", "penumbra-sct", "penumbra-txhash", - "prost", + "prost 0.12.3", "serde", "serde_json", "sha2 0.10.8", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client-verifier", "tower", "tracing", @@ -4271,8 +4357,8 @@ dependencies = [ [[package]] name = "penumbra-keys" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "aes", "anyhow", @@ -4281,7 +4367,7 @@ dependencies = [ "ark-relations", "ark-serialize", "ark-std", - "base64", + "base64 0.21.7", "bech32 0.8.1", "bip32", "blake2b_simd 1.0.2", @@ -4315,8 +4401,8 @@ dependencies = [ [[package]] name = "penumbra-num" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -4326,7 +4412,7 @@ dependencies = [ "ark-serialize", "ark-snark", "ark-std", - "base64", + "base64 0.21.7", "bech32 0.8.1", "blake2b_simd 1.0.2", "bytes", @@ -4351,8 +4437,8 @@ dependencies = [ [[package]] name = "penumbra-proof-params" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ec", @@ -4377,8 +4463,8 @@ dependencies = [ [[package]] name = "penumbra-proto" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "async-trait", @@ -4390,17 +4476,17 @@ dependencies = [ "futures", "hex", "http-body", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types", - "ics23", + "ics23 0.11.1", "pbjson", "pbjson-types", "pin-project", - "prost", + "prost 0.12.3", "serde", "serde_json", "subtle-encoding", - "tendermint", + "tendermint 0.34.1", "tonic", "tower", "tracing", @@ -4408,8 +4494,8 @@ dependencies = [ [[package]] name = "penumbra-sct" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -4435,15 +4521,15 @@ dependencies = [ "rand", "rand_core", "serde", - "tendermint", + "tendermint 0.34.1", "tonic", "tracing", ] [[package]] name = "penumbra-shielded-pool" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -4453,7 +4539,7 @@ dependencies = [ "ark-serialize", "ark-snark", "async-trait", - "base64", + "base64 0.21.7", "blake2b_simd 1.0.2", "bytes", "chacha20poly1305", @@ -4478,12 +4564,13 @@ dependencies = [ "penumbra-tct", "penumbra-txhash", "poseidon377", - "prost", + "prost 0.12.3", "rand", "rand_core", "serde", "serde_json", - "tendermint", + "tap", + "tendermint 0.34.1", "thiserror", "tonic", "tracing", @@ -4491,8 +4578,8 @@ dependencies = [ [[package]] name = "penumbra-stake" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", @@ -4503,7 +4590,7 @@ dependencies = [ "ark-snark", "async-stream", "async-trait", - "base64", + "base64 0.21.7", "bech32 0.8.1", "bitvec", "cnidarium", @@ -4533,7 +4620,7 @@ dependencies = [ "serde_unit_struct", "serde_with", "sha2 0.10.8", - "tendermint", + "tendermint 0.34.1", "tokio", "tonic", "tracing", @@ -4541,8 +4628,8 @@ dependencies = [ [[package]] name = "penumbra-tct" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "ark-ed-on-bls12-377", "ark-ff", @@ -4567,15 +4654,37 @@ dependencies = [ "tracing", ] +[[package]] +name = "penumbra-tower-trace" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" +dependencies = [ + "futures", + "hex", + "http", + "pin-project", + "pin-project-lite", + "sha2 0.10.8", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", + "tokio", + "tokio-stream", + "tokio-util 0.7.10", + "tonic", + "tower", + "tower-service", + "tracing", +] + [[package]] name = "penumbra-transaction" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-ff", "ark-serialize", - "base64", + "base64 0.21.7", "bech32 0.8.1", "blake2b_simd 1.0.2", "bytes", @@ -4586,7 +4695,7 @@ dependencies = [ "decaf377-rdsa", "derivative", "hex", - "ibc-proto 0.40.0", + "ibc-proto", "ibc-types", "num-bigint", "once_cell", @@ -4620,8 +4729,8 @@ dependencies = [ [[package]] name = "penumbra-txhash" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "blake2b_simd 1.0.2", @@ -4633,8 +4742,8 @@ dependencies = [ [[package]] name = "penumbra-view" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-std", @@ -4670,7 +4779,7 @@ dependencies = [ "penumbra-stake", "penumbra-tct", "penumbra-transaction", - "prost", + "prost 0.12.3", "r2d2", "r2d2_sqlite", "rand", @@ -4678,7 +4787,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "tendermint", + "tendermint 0.34.1", "tokio", "tokio-stream", "tonic", @@ -4689,8 +4798,8 @@ dependencies = [ [[package]] name = "penumbra-wallet" -version = "0.66.0" -source = "git+https://github.com/penumbra-zone/penumbra?branch=main#3933ffe24522134d7552eb16074bb8d59a4f0d9f" +version = "0.68.1" +source = "git+https://github.com/penumbra-zone/penumbra?tag=v0.68.1#c462e9a6cc86a37d42a9d75f1ab9ceb0e3789f77" dependencies = [ "anyhow", "ark-std", @@ -4735,7 +4844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.1", + "indexmap 2.2.5", ] [[package]] @@ -4755,7 +4864,7 @@ checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -4782,9 +4891,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platforms" @@ -4905,7 +5014,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2 1.0.78", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -5027,6 +5136,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive 0.11.9", +] + [[package]] name = "prost" version = "0.12.3" @@ -5034,7 +5153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.12.3", ] [[package]] @@ -5051,14 +5170,27 @@ dependencies = [ "once_cell", "petgraph", "prettyplease", - "prost", + "prost 0.12.3", "prost-types", "regex", - "syn 2.0.48", + "syn 2.0.52", "tempfile", "which", ] +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2 1.0.78", + "quote", + "syn 1.0.109", +] + [[package]] name = "prost-derive" version = "0.12.3" @@ -5069,7 +5201,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -5078,7 +5210,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ - "prost", + "prost 0.12.3", ] [[package]] @@ -5141,7 +5273,7 @@ checksum = "99f31323d6161385f385046738df520e0e8694fa74852d35891fc0be08348ddc" dependencies = [ "r2d2", "rusqlite", - "uuid 1.7.0", + "uuid", ] [[package]] @@ -5200,9 +5332,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -5284,11 +5416,11 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -5311,6 +5443,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls", @@ -5340,16 +5473,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if 1.0.0", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -5414,9 +5548,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -5455,7 +5589,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64", + "base64 0.21.7", ] [[package]] @@ -5476,9 +5610,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "safe-proc-macro2" @@ -5586,9 +5720,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f622567e3b4b38154fb8190bcf6b160d7a4301d70595a49195b48c116007a27" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "bitcoin_hashes", "rand", @@ -5640,18 +5774,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -5677,20 +5811,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -5715,7 +5849,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -5743,7 +5877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f1b15838534b38fb67ffe60033fe3ffad48f916c175e8baa0400e0cdb958dec" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -5760,16 +5894,17 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" +checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" dependencies = [ - "base64", + "base64 0.21.7", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.1", + "indexmap 2.2.5", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -5777,23 +5912,23 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" +checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" dependencies = [ "darling", "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "serde_yaml" -version = "0.9.31" +version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" +checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.5", "itoa", "ryu", "serde", @@ -5832,7 +5967,7 @@ checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -5932,9 +6067,9 @@ dependencies = [ [[package]] name = "simple-error" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc47a29ce97772ca5c927f75bac34866b16d64e07f330c3248e2d7226623901b" +checksum = "8542b68b8800c3cda649d2c72d688b6907b30f1580043135d61669d4aad1c175" [[package]] name = "sized-chunks" @@ -5978,12 +6113,12 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -6042,7 +6177,7 @@ dependencies = [ "proc-macro2 1.0.78", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -6079,9 +6214,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2 1.0.78", "quote", @@ -6152,22 +6287,49 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if 1.0.0", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] [[package]] name = "tendermint" -version = "0.34.0" +version = "0.32.0" +source = "git+https://github.com/eigerco/celestia-tendermint-rs?rev=bbe7de8#bbe7de8c777f0c44b338f4bf26f0f6efb18e87f0" +dependencies = [ + "bytes", + "digest 0.10.7", + "ed25519", + "ed25519-consensus", + "flex-error", + "futures", + "num-traits", + "once_cell", + "prost 0.12.3", + "prost-types", + "serde", + "serde_bytes", + "serde_json", + "serde_repr", + "sha2 0.10.8", + "signature", + "subtle", + "subtle-encoding", + "tendermint-proto 0.32.0", + "time", + "zeroize", +] + +[[package]] +name = "tendermint" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2294fa667c8b548ee27a9ba59115472d0a09c2ba255771092a7f1dcf03a789" +checksum = "15ab8f0a25d0d2ad49ac615da054d6a76aa6603ff95f7d18bafdd34450a1a04b" dependencies = [ "bytes", "digest 0.10.7", @@ -6178,7 +6340,7 @@ dependencies = [ "k256", "num-traits", "once_cell", - "prost", + "prost 0.12.3", "prost-types", "ripemd", "serde", @@ -6189,30 +6351,30 @@ dependencies = [ "signature", "subtle", "subtle-encoding", - "tendermint-proto", + "tendermint-proto 0.34.1", "time", "zeroize", ] [[package]] name = "tendermint-config" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a25dbe8b953e80f3d61789fbdb83bf9ad6c0ef16df5ca6546f49912542cc137" +checksum = "e1a02da769166e2052cd537b1a97c78017632c2d9e19266367b27e73910434fc" dependencies = [ "flex-error", "serde", "serde_json", - "tendermint", + "tendermint 0.34.1", "toml 0.5.11", "url", ] [[package]] name = "tendermint-light-client" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94aecbdccbc4b557649b2d1b1a4bfc27ec85205e00fb8020fce044245a4c9e3f" +checksum = "dc60a09541be13b8f8be305c260eb6144e48e01299302f71956c6e5284f2e4d6" dependencies = [ "contracts", "crossbeam-channel 0.4.4", @@ -6225,7 +6387,7 @@ dependencies = [ "serde_derive", "serde_json", "static_assertions", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client-verifier", "tendermint-rpc", "time", @@ -6235,11 +6397,10 @@ dependencies = [ [[package]] name = "tendermint-light-client-detector" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea83654b03e3ddc6782c9704a3fefd4d0671bd6c5e3f09d29e31fcb45e75636c" +checksum = "6af616fb578fec00cb6466d57718ad962de8482e77a7b647f4c8acf3538913e4" dependencies = [ - "contracts", "crossbeam-channel 0.4.4", "derive_more", "flex-error", @@ -6249,9 +6410,9 @@ dependencies = [ "serde_derive", "serde_json", "static_assertions", - "tendermint", + "tendermint 0.34.1", "tendermint-light-client", - "tendermint-proto", + "tendermint-proto 0.34.1", "tendermint-rpc", "time", "tracing", @@ -6259,28 +6420,45 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74994da9de4b1144837a367ca2c60c650f5526a7c1a54760a3020959b522e474" +checksum = "9b8090d0eef9ad57b1b913b5e358e26145c86017e87338136509b94383a4af25" dependencies = [ "derive_more", "flex-error", "serde", - "tendermint", + "tendermint 0.34.1", "time", ] [[package]] name = "tendermint-proto" -version = "0.34.0" +version = "0.32.0" +source = "git+https://github.com/eigerco/celestia-tendermint-rs?rev=bbe7de8#bbe7de8c777f0c44b338f4bf26f0f6efb18e87f0" +dependencies = [ + "bytes", + "flex-error", + "num-derive", + "num-traits", + "prost 0.12.3", + "prost-types", + "serde", + "serde_bytes", + "subtle-encoding", + "time", +] + +[[package]] +name = "tendermint-proto" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc728a4f9e891d71adf66af6ecaece146f9c7a11312288a3107b3e1d6979aaf" +checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" dependencies = [ "bytes", "flex-error", "num-derive", "num-traits", - "prost", + "prost 0.12.3", "prost-types", "serde", "serde_bytes", @@ -6290,9 +6468,9 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbf0a4753b46a190f367337e0163d0b552a2674a6bac54e74f9f2cdcde2969b" +checksum = "71afae8bb5f6b14ed48d4e1316a643b6c2c3cbad114f510be77b4ed20b7b3e42" dependencies = [ "async-trait", "async-tungstenite", @@ -6302,6 +6480,7 @@ dependencies = [ "getrandom", "peg", "pin-project", + "rand", "reqwest", "semver", "serde", @@ -6309,23 +6488,23 @@ dependencies = [ "serde_json", "subtle", "subtle-encoding", - "tendermint", + "tendermint 0.34.1", "tendermint-config", - "tendermint-proto", + "tendermint-proto 0.34.1", "thiserror", "time", "tokio", "tracing", "url", - "uuid 0.8.2", + "uuid", "walkdir", ] [[package]] name = "tendermint-testgen" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19d4f02b7e38ce790da973fdc9edc71a0e35340ac57737bf278c8379037c1f5" +checksum = "ae652e9e8b23f27f6a4fbeb29ead22ff4c2256b8d32df226b73258ba2a4ce11e" dependencies = [ "ed25519-consensus", "gumdrop", @@ -6333,7 +6512,7 @@ dependencies = [ "serde_json", "simple-error", "tempfile", - "tendermint", + "tendermint 0.34.1", "time", ] @@ -6348,57 +6527,57 @@ dependencies = [ [[package]] name = "test-log" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" +checksum = "7b319995299c65d522680decf80f2c108d85b861d81dfe340a10d16cee29d9e6" dependencies = [ - "env_logger 0.10.2", + "env_logger", "test-log-macros", "tracing-subscriber 0.3.18", ] [[package]] name = "test-log-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" +checksum = "c8f546451eaa38373f549093fe9fd05e7d2bade739e2ddf834b9968621d60107" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "textwrap" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -6406,12 +6585,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -6426,10 +6606,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -6478,9 +6659,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -6514,7 +6695,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -6536,7 +6717,21 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", - "tokio-util", + "tokio-util 0.7.10", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", ] [[package]] @@ -6564,14 +6759,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.22.6", ] [[package]] @@ -6589,22 +6784,22 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.5", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.5", ] [[package]] @@ -6616,7 +6811,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64", + "base64 0.21.7", "bytes", "h2", "http", @@ -6625,7 +6820,7 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost", + "prost 0.12.3", "rustls", "rustls-native-certs", "rustls-pemfile", @@ -6653,12 +6848,46 @@ dependencies = [ "rand", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.10", "tower-layer", "tower-service", "tracing", ] +[[package]] +name = "tower-abci" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4826f3df3e9a37083d978cae73f020bcdf6143956b7dfc1bd6050b4e16367c" +dependencies = [ + "bytes", + "futures", + "pin-project", + "prost 0.12.3", + "tendermint 0.34.1", + "tendermint-proto 0.34.1", + "tokio", + "tokio-stream", + "tokio-util 0.6.10", + "tower", + "tracing", +] + +[[package]] +name = "tower-actor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b882e5e82ee7440a08335f4d5a2edd9f7678b2cba73eac4826b53c22fd76fdd3" +dependencies = [ + "futures", + "pin-project", + "thiserror", + "tokio", + "tokio-util 0.7.10", + "tower", + "tracing", +] + [[package]] name = "tower-layer" version = "0.3.2" @@ -6691,7 +6920,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -6862,9 +7091,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -6944,12 +7173,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "uuid" version = "1.7.0" @@ -6986,7 +7209,7 @@ checksum = "b3fd98999db9227cf28e59d83e1f120f42bc233d4b152e8fab9bc87d5bb1e0f8" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -7025,9 +7248,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -7035,24 +7258,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -7062,9 +7285,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7072,28 +7295,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -7148,7 +7371,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -7166,7 +7389,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -7186,17 +7409,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -7207,9 +7430,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -7219,9 +7442,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -7231,9 +7454,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -7243,9 +7466,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -7255,9 +7478,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -7267,9 +7490,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -7279,15 +7502,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" -version = "0.5.35" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] @@ -7328,7 +7560,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] @@ -7348,7 +7580,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2 1.0.78", "quote", - "syn 2.0.48", + "syn 2.0.52", ] [[package]] diff --git a/config-astria-celestia.toml b/config-astria-celestia.toml new file mode 100644 index 0000000000..78f6cc7c3c --- /dev/null +++ b/config-astria-celestia.toml @@ -0,0 +1,67 @@ + +[global] +log_level = 'debug' + +[mode] + +[mode.clients] +enabled = true +refresh = true +misbehaviour = false + +[mode.connections] +enabled = true + +[mode.channels] +enabled = true + +[mode.packets] +enabled = true +clear_interval = 100 +clear_on_start = true +tx_confirmation = true + +[telemetry] +enabled = false +host = '127.0.0.1' +port = 3001 + +[[chains]] +id = 'astria' +type = 'Astria' +rpc_addr = 'http://localhost:26657' +grpc_addr = 'http://localhost:8080' +event_source = { mode = 'pull', interval = '1s' } +rpc_timeout = '15s' +account_prefix = 'fake' # not used +key_name = 'astria-wallet' +store_prefix = 'ibc-data' +gas_price = { price = 1, denom = 'nria' } # not used +max_gas = 10000000 # not used +clock_drift = '5s' +trusting_period = '2h' # this should be changed in the future +trust_threshold = { numerator = '1', denominator = '3' } + +[[chains]] +id = 'celestia' +type = 'CosmosSdk' +rpc_addr = 'http://localhost:27050' +grpc_addr = 'http://localhost:9090' +event_source = { mode = 'push', url = 'ws://localhost:27050/websocket', batch_delay = '200ms' } +rpc_timeout = '15s' +trusted_node = true +account_prefix = 'celestia' +key_name = 'wallet' +store_prefix = 'ibc' +gas_price = { price = 0.0026, denom = 'utia' } +gas_multiplier = 1.2 +default_gas = 1000000 +max_gas = 10000000 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '30s' +trusting_period = '14days' +trust_threshold = { numerator = '2', denominator = '3' } +memo_prefix = 'astriawashere' +compat_mode = "0.34" diff --git a/config-astria-osmosis.toml b/config-astria-osmosis.toml new file mode 100644 index 0000000000..627061b9a6 --- /dev/null +++ b/config-astria-osmosis.toml @@ -0,0 +1,66 @@ + +[global] +log_level = 'debug' + +[mode] + +[mode.clients] +enabled = true +refresh = true +misbehaviour = false + +[mode.connections] +enabled = true + +[mode.channels] +enabled = true + +[mode.packets] +enabled = true +clear_interval = 100 +clear_on_start = true +tx_confirmation = true + +[telemetry] +enabled = false +host = '127.0.0.1' +port = 3001 + +[[chains]] +id = 'astria' +type = 'Astria' +rpc_addr = 'http://localhost:26657' +grpc_addr = 'http://localhost:8080' +event_source = { mode = 'pull', interval = '1s' } +rpc_timeout = '15s' +account_prefix = 'fake' # not used +key_name = 'astria-wallet' +store_prefix = 'ibc-data' +gas_price = { price = 1, denom = 'nria' } # not used +max_gas = 10000000 # not used +clock_drift = '5s' +trusting_period = '2h' # this should be changed in the future +trust_threshold = { numerator = '1', denominator = '3' } + +[[chains]] +id = 'ibc-0' +type = 'CosmosSdk' +rpc_addr = 'http://localhost:27050' +grpc_addr = 'http://localhost:9090' +event_source = { mode = 'push', url = 'ws://localhost:27050/websocket', batch_delay = '200ms' } +rpc_timeout = '15s' +trusted_node = true +account_prefix = 'osmo' +key_name = 'wallet' +store_prefix = 'ibc' +gas_price = { price = 0.0026, denom = 'stake' } +gas_multiplier = 1.2 +default_gas = 1000000 +max_gas = 10000000 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '30s' +trusting_period = '14days' +trust_threshold = { numerator = '2', denominator = '3' } +memo_prefix = 'astriawashere' diff --git a/crates/chain-registry/src/asset_list.rs b/crates/chain-registry/src/asset_list.rs index a4edc40a8c..8c695f1685 100644 --- a/crates/chain-registry/src/asset_list.rs +++ b/crates/chain-registry/src/asset_list.rs @@ -53,8 +53,7 @@ impl Fetchable for AssetList { #[cfg(test)] mod tests { use super::*; - use crate::constants::ALL_CHAINS; - use crate::error::RegistryError; + use crate::{constants::ALL_CHAINS, error::RegistryError}; #[tokio::test] #[ignore] diff --git a/crates/chain-registry/src/chain.rs b/crates/chain-registry/src/chain.rs index 48434c404d..ae4eee7061 100644 --- a/crates/chain-registry/src/chain.rs +++ b/crates/chain-registry/src/chain.rs @@ -1,9 +1,11 @@ //! Contains models for serializing and deserializing `chain.json` for a given chain //! Taken from -use crate::fetchable::Fetchable; +use std::path::PathBuf; + use ibc_relayer_types::core::ics24_host::identifier::ChainId; use serde::{Deserialize, Serialize}; -use std::path::PathBuf; + +use crate::fetchable::Fetchable; #[derive(Clone, Debug, Default, Deserialize, Serialize)] #[serde(default)] @@ -161,8 +163,7 @@ impl Fetchable for ChainData { #[cfg(test)] mod tests { use super::*; - use crate::constants::ALL_CHAINS; - use crate::error::RegistryError; + use crate::{constants::ALL_CHAINS, error::RegistryError}; #[tokio::test] #[ignore] @@ -186,8 +187,9 @@ mod tests { #[test] fn chain_data_deserialize() { - use ibc_relayer_types::core::ics24_host::identifier::ChainId; use std::str::FromStr; + + use ibc_relayer_types::core::ics24_host::identifier::ChainId; let json = r#"{ "$schema": "https://github.com/cosmos/chain-registry/blob/master/chain.schema.json", "chain_name": "test", diff --git a/crates/chain-registry/src/error.rs b/crates/chain-registry/src/error.rs index 662ce5cbab..366eb843e4 100644 --- a/crates/chain-registry/src/error.rs +++ b/crates/chain-registry/src/error.rs @@ -1,12 +1,12 @@ +use std::path::PathBuf; + use flex_error::{define_error, TraceError}; use http; use itertools::Itertools; use reqwest; use serde_json; -use std::path::PathBuf; use tendermint_rpc; -use tokio::task::JoinError; -use tokio::time::error::Elapsed; +use tokio::{task::JoinError, time::error::Elapsed}; define_error! { RegistryError { diff --git a/crates/chain-registry/src/fetchable.rs b/crates/chain-registry/src/fetchable.rs index 4085849a36..2c5ccacb07 100644 --- a/crates/chain-registry/src/fetchable.rs +++ b/crates/chain-registry/src/fetchable.rs @@ -1,12 +1,14 @@ //! Contains the trait required to fetch and deserialize data from the chain repository +use std::path::PathBuf; + +use async_trait::async_trait; +use http::uri::Builder; +use serde::de::DeserializeOwned; + use crate::{ constants::{DEFAULT_REF, HOST, PROTOCOL, REGISTRY_PATH}, error::RegistryError, }; -use async_trait::async_trait; -use http::uri::Builder; -use serde::de::DeserializeOwned; -use std::path::PathBuf; /// `Fetchable` represents the basic expectations for external data or resources that /// can be fetched. diff --git a/crates/chain-registry/src/formatter.rs b/crates/chain-registry/src/formatter.rs index 88b4227f7a..ee01dc61ca 100644 --- a/crates/chain-registry/src/formatter.rs +++ b/crates/chain-registry/src/formatter.rs @@ -2,13 +2,13 @@ //! Contains struct to build a `tendermint_rpc::Url` representing a //! WebSocket URL from a RPC URL and to parse or build a valid `http::Uri` //! from an (in)complete GRPC URL. -use crate::error::RegistryError; -use http::uri::Scheme; -use http::Uri; use std::str::FromStr; +use http::{uri::Scheme, Uri}; use tendermint_rpc::Url; +use crate::error::RegistryError; + /// `UriFormatter` contains the basic expectations to parse a valid URL from a `&str`. pub trait UriFormatter { /// Expected output format of the formatter. @@ -96,10 +96,9 @@ impl UriFormatter for SimpleGrpcFormatter { #[cfg(test)] mod tests { - use super::*; + use std::{cmp::PartialEq, fmt::Debug}; - use std::cmp::PartialEq; - use std::fmt::Debug; + use super::*; struct FormatterTest { input: &'static str, @@ -181,9 +180,7 @@ mod tests { #[tokio::test] #[ignore] async fn all_chain_registry_grpc_address() -> Result<(), RegistryError> { - use crate::chain::ChainData; - use crate::constants::ALL_CHAINS; - use crate::fetchable::Fetchable; + use crate::{chain::ChainData, constants::ALL_CHAINS, fetchable::Fetchable}; let mut handles = Vec::with_capacity(ALL_CHAINS.len()); @@ -204,9 +201,7 @@ mod tests { #[tokio::test] #[ignore] async fn all_chain_registry_rpc_address() -> Result<(), RegistryError> { - use crate::chain::ChainData; - use crate::constants::ALL_CHAINS; - use crate::fetchable::Fetchable; + use crate::{chain::ChainData, constants::ALL_CHAINS, fetchable::Fetchable}; let mut handles = Vec::with_capacity(ALL_CHAINS.len()); diff --git a/crates/chain-registry/src/paths.rs b/crates/chain-registry/src/paths.rs index 83f15e387e..f812aad1b4 100644 --- a/crates/chain-registry/src/paths.rs +++ b/crates/chain-registry/src/paths.rs @@ -1,9 +1,10 @@ +use std::path::PathBuf; + +use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; +use serde::{Deserialize, Serialize}; + /// Models for serializing and deserializing IBC path JSON data found in the `_IBC/` directory of the registry repository use crate::fetchable::Fetchable; -use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; -use serde::Deserialize; -use serde::Serialize; -use std::path::PathBuf; #[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(default)] @@ -67,9 +68,7 @@ impl Fetchable for IBCPath { #[cfg(test)] mod tests { use super::*; - use crate::error::RegistryError; - - use crate::constants::ALL_PATHS; + use crate::{constants::ALL_PATHS, error::RegistryError}; #[tokio::test] #[ignore] @@ -96,10 +95,11 @@ mod tests { #[test] fn paths_deserialize() { + use std::str::FromStr; + use ibc_relayer_types::core::ics24_host::identifier::{ ChannelId, ClientId, ConnectionId, PortId, }; - use std::str::FromStr; let path = r#"{ "$schema": "https://github.com/cosmos/chain-registry/blob/master/ibc_data.schema.json", diff --git a/crates/chain-registry/src/querier.rs b/crates/chain-registry/src/querier.rs index ac5a2c385c..1654ef4b3e 100644 --- a/crates/chain-registry/src/querier.rs +++ b/crates/chain-registry/src/querier.rs @@ -2,21 +2,20 @@ //! Contains struct to perform a health check on a gRPC/WebSocket endpoint and //! to retrieve the `max_block_size` from a RPC endpoint. -use std::fmt::Debug; -use std::str::FromStr; +use std::{fmt::Debug, str::FromStr}; use async_trait::async_trait; use futures::{stream::FuturesUnordered, StreamExt}; use http::Uri; -use tokio::time::timeout; -use tokio::time::Duration; -use tracing::{debug, info}; - use ibc_proto::cosmos::bank::v1beta1::query_client::QueryClient; use tendermint_rpc::{Client, SubscriptionClient, Url, WebSocketClient}; +use tokio::time::{timeout, Duration}; +use tracing::{debug, info}; -use crate::error::RegistryError; -use crate::formatter::{SimpleWebSocketFormatter, UriFormatter}; +use crate::{ + error::RegistryError, + formatter::{SimpleWebSocketFormatter, UriFormatter}, +}; /// `QueryTypes` represents the basic types required to query a node pub trait QueryTypes { diff --git a/crates/relayer-cli/build.rs b/crates/relayer-cli/build.rs index 7fdab17b07..5983d57a8e 100644 --- a/crates/relayer-cli/build.rs +++ b/crates/relayer-cli/build.rs @@ -36,8 +36,10 @@ fn is_ci_release() -> bool { mod git { use core::marker::PhantomData; - use std::ffi::OsStr; - use std::process::{Command, Output}; + use std::{ + ffi::OsStr, + process::{Command, Output}, + }; // A wrapper over a git shell command that is only constructable if git is available & the // current directory is a git repository diff --git a/crates/relayer-cli/src/application.rs b/crates/relayer-cli/src/application.rs index e7d524bf96..0238e54bab 100644 --- a/crates/relayer-cli/src/application.rs +++ b/crates/relayer-cli/src/application.rs @@ -6,8 +6,7 @@ use abscissa_core::{ application::{self, AppCell}, component::Component, config::{self, CfgCell}, - terminal::component::Terminal, - terminal::ColorChoice, + terminal::{component::Terminal, ColorChoice}, Application, Configurable, FrameworkError, FrameworkErrorKind, StandardPaths, }; use ibc_relayer::{ diff --git a/crates/relayer-cli/src/bin/hermes/main.rs b/crates/relayer-cli/src/bin/hermes/main.rs index 4cdb1744fc..061ec33720 100644 --- a/crates/relayer-cli/src/bin/hermes/main.rs +++ b/crates/relayer-cli/src/bin/hermes/main.rs @@ -3,8 +3,7 @@ #![deny(warnings, missing_docs, trivial_casts, unused_qualifications)] #![forbid(unsafe_code)] -use ibc_relayer_cli::application::APPLICATION; -use ibc_relayer_cli::components::enable_ansi; +use ibc_relayer_cli::{application::APPLICATION, components::enable_ansi}; fn main() -> eyre::Result<()> { install_error_reporter()?; diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index cbaae53590..357e2b5cf2 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -1,30 +1,34 @@ //! Contains functions to generate a relayer config for a given chain -use std::collections::HashMap; -use std::fmt::Display; -use std::marker::Send; +use std::{collections::HashMap, fmt::Display, marker::Send}; use futures::future::join_all; use http::Uri; -use ibc_relayer::config::dynamic_gas::DynamicGasPrice; -use tokio::task::{JoinError, JoinHandle}; -use tracing::trace; - -use ibc_chain_registry::asset_list::AssetList; -use ibc_chain_registry::chain::ChainData; -use ibc_chain_registry::error::RegistryError; -use ibc_chain_registry::fetchable::Fetchable; -use ibc_chain_registry::formatter::{SimpleGrpcFormatter, UriFormatter}; -use ibc_chain_registry::paths::IBCPath; -use ibc_chain_registry::querier::*; -use ibc_relayer::chain::cosmos::config::CosmosSdkConfig; -use ibc_relayer::config::filter::{FilterPattern, PacketFilter}; -use ibc_relayer::config::gas_multiplier::GasMultiplier; -use ibc_relayer::config::types::{MaxMsgNum, MaxTxSize, Memo, TrustThreshold}; -use ibc_relayer::config::{default, AddressType, ChainConfig, EventSourceMode, GasPrice}; -use ibc_relayer::keyring::Store; +use ibc_chain_registry::{ + asset_list::AssetList, + chain::ChainData, + error::RegistryError, + fetchable::Fetchable, + formatter::{SimpleGrpcFormatter, UriFormatter}, + paths::IBCPath, + querier::*, +}; +use ibc_relayer::{ + chain::cosmos::config::CosmosSdkConfig, + config::{ + default, + dynamic_gas::DynamicGasPrice, + filter::{FilterPattern, PacketFilter}, + gas_multiplier::GasMultiplier, + types::{MaxMsgNum, MaxTxSize, Memo, TrustThreshold}, + AddressType, ChainConfig, EventSourceMode, GasPrice, + }, + keyring::Store, +}; use tendermint_rpc::Url; +use tokio::task::{JoinError, JoinHandle}; +use tracing::trace; const MAX_HEALTHY_QUERY_RETRIES: u8 = 5; @@ -335,11 +339,13 @@ pub async fn get_configs( /// else they will fail due to the amount of concurrent queries. #[cfg(test)] mod tests { - use super::*; + use std::str::FromStr; + use ibc_relayer::config::filter::ChannelPolicy; use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; use serial_test::serial; - use std::str::FromStr; + + use super::*; // Use commit from 28.04.23 for tests const TEST_COMMIT: &str = "95b99457e828402bde994816ce57e548d7e1a76d"; diff --git a/crates/relayer-cli/src/cli_utils.rs b/crates/relayer-cli/src/cli_utils.rs index 733914fd06..5441bb1594 100644 --- a/crates/relayer-cli/src/cli_utils.rs +++ b/crates/relayer-cli/src/cli_utils.rs @@ -1,18 +1,23 @@ //! Various utilities for the Hermes CLI use alloc::sync::Arc; -use eyre::eyre; -use tokio::runtime::Runtime as TokioRuntime; -use tracing::debug; -use ibc_relayer::chain::counterparty::{channel_connection_client, ChannelConnectionClient}; -use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; -use ibc_relayer::chain::requests::{ - IncludeProof, QueryChannelRequest, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, +use eyre::eyre; +use ibc_relayer::{ + chain::{ + counterparty::{channel_connection_client, ChannelConnectionClient}, + handle::{BaseChainHandle, ChainHandle}, + requests::{ + IncludeProof, QueryChannelRequest, QueryClientStateRequest, QueryConnectionRequest, + QueryHeight, + }, + }, + config::Config, + spawn, }; -use ibc_relayer::config::Config; -use ibc_relayer::spawn; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; +use tokio::runtime::Runtime as TokioRuntime; +use tracing::debug; use crate::error::Error; diff --git a/crates/relayer-cli/src/commands.rs b/crates/relayer-cli/src/commands.rs index 60879018f5..055231ffbf 100644 --- a/crates/relayer-cli/src/commands.rs +++ b/crates/relayer-cli/src/commands.rs @@ -18,22 +18,22 @@ mod update; mod upgrade; mod version; +use core::time::Duration; +use std::path::PathBuf; + +use abscissa_core::{ + clap::Parser, config::Override, Command, Configurable, FrameworkError, Runnable, +}; +use ibc_relayer::config::{ChainConfig, Config}; +use tracing::{error, info}; + use self::{ clear::ClearCmds, completions::CompletionsCmd, config::ConfigCmd, create::CreateCmds, evidence::EvidenceCmd, fee::FeeCmd, health::HealthCheckCmd, keys::KeysCmd, listen::ListenCmd, logs::LogsCmd, misbehaviour::MisbehaviourCmd, query::QueryCmd, start::StartCmd, tx::TxCmd, update::UpdateCmds, upgrade::UpgradeCmds, version::VersionCmd, }; - -use core::time::Duration; -use std::path::PathBuf; - -use abscissa_core::clap::Parser; -use abscissa_core::{config::Override, Command, Configurable, FrameworkError, Runnable}; -use tracing::{error, info}; - use crate::DEFAULT_CONFIG_PATH; -use ibc_relayer::config::{ChainConfig, Config}; /// Default configuration file path pub fn default_config_file() -> Option { diff --git a/crates/relayer-cli/src/commands/clear.rs b/crates/relayer-cli/src/commands/clear.rs index 7535614312..02a6634060 100644 --- a/crates/relayer-cli/src/commands/clear.rs +++ b/crates/relayer-cli/src/commands/clear.rs @@ -1,21 +1,21 @@ use std::ops::RangeInclusive; -use abscissa_core::clap::Parser; -use abscissa_core::config::Override; -use abscissa_core::{Command, FrameworkErrorKind, Runnable}; - -use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; -use ibc_relayer::config::Config; -use ibc_relayer::link::error::LinkError; -use ibc_relayer::link::{Link, LinkParameters}; -use ibc_relayer::util::seq_range::parse_seq_range; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use ibc_relayer_types::events::IbcEvent; - -use crate::application::app_config; -use crate::cli_utils::spawn_chain_counterparty; -use crate::conclude::Output; +use abscissa_core::{clap::Parser, config::Override, Command, FrameworkErrorKind, Runnable}; +use ibc_relayer::{ + chain::handle::{BaseChainHandle, ChainHandle}, + config::Config, + link::{error::LinkError, Link, LinkParameters}, + util::seq_range::parse_seq_range, +}; +use ibc_relayer_types::{ + core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChainId, ChannelId, PortId}, + }, + events::IbcEvent, +}; + +use crate::{application::app_config, cli_utils::spawn_chain_counterparty, conclude::Output}; /// `clear` subcommands #[derive(Command, Debug, Parser, Runnable)] @@ -206,13 +206,15 @@ where #[cfg(test)] mod tests { - use super::ClearPacketsCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics04_channel::packet::Sequence; - use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use ibc_relayer_types::core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChainId, ChannelId, PortId}, + }; + + use crate::commands::clear::ClearPacketsCmd; #[test] fn test_clear_packets_required_only() { diff --git a/crates/relayer-cli/src/commands/completions.rs b/crates/relayer-cli/src/commands/completions.rs index 5ed1696eea..4e1b30cd62 100644 --- a/crates/relayer-cli/src/commands/completions.rs +++ b/crates/relayer-cli/src/commands/completions.rs @@ -1,9 +1,10 @@ -use crate::entry::EntryPoint; -use abscissa_core::clap::Parser; -use abscissa_core::Runnable; +use std::io; + +use abscissa_core::{clap::Parser, Runnable}; use clap::IntoApp; use clap_complete::Shell; -use std::io; + +use crate::entry::EntryPoint; #[derive(Debug, Parser, PartialEq, Eq)] pub struct CompletionsCmd { @@ -26,11 +27,11 @@ impl Runnable for CompletionsCmd { #[cfg(test)] mod tests { - use super::CompletionsCmd; - use abscissa_core::clap::Parser; use clap_complete::Shell; + use super::CompletionsCmd; + #[test] fn test_completions() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/config.rs b/crates/relayer-cli/src/commands/config.rs index cbe73c9403..737b4e877b 100644 --- a/crates/relayer-cli/src/commands/config.rs +++ b/crates/relayer-cli/src/commands/config.rs @@ -1,7 +1,6 @@ //! `config` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod auto; mod validate; diff --git a/crates/relayer-cli/src/commands/config/auto.rs b/crates/relayer-cli/src/commands/config/auto.rs index 64241d030d..33679be8e1 100644 --- a/crates/relayer-cli/src/commands/config/auto.rs +++ b/crates/relayer-cli/src/commands/config/auto.rs @@ -1,16 +1,12 @@ -use crate::chain_registry::get_configs; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use itertools::Itertools; - -use crate::conclude::Output; +use std::{collections::HashSet, path::PathBuf}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::config::{store, ChainConfig, Config}; - -use std::collections::HashSet; -use std::path::PathBuf; +use itertools::Itertools; use tracing::{info, warn}; +use crate::{chain_registry::get_configs, conclude::Output}; + fn find_key(chain_config: &ChainConfig) -> Option { let keys = chain_config.list_keys().ok()?; keys.into_iter().next().map(|(name, _)| name) @@ -180,10 +176,12 @@ impl Runnable for AutoCmd { #[cfg(test)] mod tests { - use super::AutoCmd; - use abscissa_core::clap::Parser; use std::path::PathBuf; + use abscissa_core::clap::Parser; + + use super::AutoCmd; + #[test] fn auto_config_without_commit() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/config/validate.rs b/crates/relayer-cli/src/commands/config/validate.rs index 03efaf018c..cecad2fff5 100644 --- a/crates/relayer-cli/src/commands/config/validate.rs +++ b/crates/relayer-cli/src/commands/config/validate.rs @@ -1,11 +1,8 @@ use std::fs; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; -use crate::conclude::Output; -use crate::config; -use crate::prelude::*; +use crate::{conclude::Output, config, prelude::*}; /// In order to validate the configuration file the command will check that the file exists, /// that it is readable and not empty. It will then check the validity of the fields inside diff --git a/crates/relayer-cli/src/commands/create.rs b/crates/relayer-cli/src/commands/create.rs index 0bb2dd9e19..d1b0433f53 100644 --- a/crates/relayer-cli/src/commands/create.rs +++ b/crates/relayer-cli/src/commands/create.rs @@ -1,10 +1,10 @@ //! `create` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; -use crate::commands::create::channel::CreateChannelCommand; -use crate::commands::create::connection::CreateConnectionCommand; -use crate::commands::tx::client::TxCreateClientCmd; +use crate::commands::{ + create::{channel::CreateChannelCommand, connection::CreateConnectionCommand}, + tx::client::TxCreateClientCmd, +}; mod channel; mod connection; diff --git a/crates/relayer-cli/src/commands/create/channel.rs b/crates/relayer-cli/src/commands/create/channel.rs index 98b8464ff3..2763cbd2b3 100644 --- a/crates/relayer-cli/src/commands/create/channel.rs +++ b/crates/relayer-cli/src/commands/create/channel.rs @@ -1,25 +1,27 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - +use abscissa_core::{clap::Parser, Command, Runnable}; use console::style; use dialoguer::Confirm; +use ibc_relayer::{ + chain::{ + handle::ChainHandle, + requests::{IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight}, + }, + channel::Channel, + config::default::connection_delay, + connection::Connection, + foreign_client::ForeignClient, +}; +use ibc_relayer_types::core::{ + ics03_connection::connection::IdentifiedConnectionEnd, + ics04_channel::{channel::Ordering, version::Version}, + ics24_host::identifier::{ChainId, ConnectionId, PortId}, +}; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{ - IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, +use crate::{ + cli_utils::{spawn_chain_runtime, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, + prelude::*, }; -use ibc_relayer::channel::Channel; -use ibc_relayer::connection::Connection; -use ibc_relayer::foreign_client::ForeignClient; -use ibc_relayer_types::core::ics03_connection::connection::IdentifiedConnectionEnd; -use ibc_relayer_types::core::ics04_channel::channel::Ordering; -use ibc_relayer_types::core::ics04_channel::version::Version; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ConnectionId, PortId}; - -use crate::cli_utils::{spawn_chain_runtime, ChainHandlePair}; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::prelude::*; -use ibc_relayer::config::default::connection_delay; static PROMPT: &str = "Are you sure you want a new connection & clients to be created? Hermes will use default security parameters."; static HINT: &str = "Consider using the default invocation\n\nhermes create channel --a-port --b-port --a-chain --a-connection \n\nto reuse a pre-existing connection."; @@ -271,12 +273,13 @@ impl CreateChannelCommand { mod tests { use std::str::FromStr; - use super::CreateChannelCommand; use abscissa_core::clap::Parser; + use ibc_relayer_types::core::{ + ics04_channel::{channel::Ordering, version::Version}, + ics24_host::identifier::{ChainId, ConnectionId, PortId}, + }; - use ibc_relayer_types::core::ics04_channel::channel::Ordering; - use ibc_relayer_types::core::ics04_channel::version::Version; - use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ConnectionId, PortId}; + use super::CreateChannelCommand; #[test] fn test_create_channel_a_conn_required() { diff --git a/crates/relayer-cli/src/commands/create/connection.rs b/crates/relayer-cli/src/commands/create/connection.rs index 052411d069..6b50b284e2 100644 --- a/crates/relayer-cli/src/commands/create/connection.rs +++ b/crates/relayer-cli/src/commands/create/connection.rs @@ -1,17 +1,21 @@ use core::time::Duration; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}; -use ibc_relayer::connection::Connection; -use ibc_relayer::foreign_client::ForeignClient; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::{ + chain::{ + handle::ChainHandle, + requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, + }, + connection::Connection, + foreign_client::ForeignClient, +}; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; -use crate::cli_utils::{spawn_chain_runtime, ChainHandlePair}; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::prelude::*; +use crate::{ + cli_utils::{spawn_chain_runtime, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] #[clap(override_usage("hermes create connection [OPTIONS] --a-chain --b-chain @@ -176,12 +180,12 @@ impl CreateConnectionCommand { #[cfg(test)] mod tests { - use super::CreateConnectionCommand; + use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; - use std::str::FromStr; + use super::CreateConnectionCommand; #[test] fn test_create_connection_b_chain() { diff --git a/crates/relayer-cli/src/commands/evidence.rs b/crates/relayer-cli/src/commands/evidence.rs index eb3bc9afe8..f6b15c3bad 100644 --- a/crates/relayer-cli/src/commands/evidence.rs +++ b/crates/relayer-cli/src/commands/evidence.rs @@ -1,38 +1,48 @@ -use std::collections::HashMap; -use std::ops::{ControlFlow, Deref}; -use std::sync::Arc; -use std::thread::sleep; -use std::time::Duration; - -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer::config::{ChainConfig, Config}; -use tokio::runtime::Runtime as TokioRuntime; - -use tendermint::block::Height as TendermintHeight; -use tendermint::evidence::{DuplicateVoteEvidence, LightClientAttackEvidence}; -use tendermint::validator; +use std::{ + collections::HashMap, + ops::{ControlFlow, Deref}, + sync::Arc, + thread::sleep, + time::Duration, +}; + +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::{ + chain::{ + cosmos::CosmosSdkChain, + endpoint::ChainEndpoint, + handle::{BaseChainHandle, ChainHandle}, + requests::{IncludeProof, PageRequest, QueryHeight}, + tracking::TrackedMsgs, + }, + config::{ChainConfig, Config}, + foreign_client::ForeignClient, + spawn::spawn_chain_runtime_with_modified_config, +}; +use ibc_relayer_types::{ + applications::ics28_ccv::msgs::{ + ccv_double_voting::MsgSubmitIcsConsumerDoubleVoting, + ccv_misbehaviour::MsgSubmitIcsConsumerMisbehaviour, + }, + clients::ics07_tendermint::{ + header::Header as TendermintHeader, misbehaviour::Misbehaviour as TendermintMisbehaviour, + }, + core::{ + ics02_client::{height::Height, msgs::misbehaviour::MsgSubmitMisbehaviour}, + ics24_host::identifier::{ChainId, ClientId}, + }, + events::IbcEvent, + tx_msg::Msg, +}; +use tendermint::{ + block::Height as TendermintHeight, + evidence::{DuplicateVoteEvidence, LightClientAttackEvidence}, + validator, +}; use tendermint_rpc::{Client, Paging}; +use tokio::runtime::Runtime as TokioRuntime; -use ibc_relayer::chain::cosmos::CosmosSdkChain; -use ibc_relayer::chain::endpoint::ChainEndpoint; -use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; -use ibc_relayer::chain::requests::{IncludeProof, PageRequest, QueryHeight}; -use ibc_relayer::chain::tracking::TrackedMsgs; -use ibc_relayer::foreign_client::ForeignClient; -use ibc_relayer::spawn::spawn_chain_runtime_with_modified_config; -use ibc_relayer_types::applications::ics28_ccv::msgs::ccv_double_voting::MsgSubmitIcsConsumerDoubleVoting; -use ibc_relayer_types::applications::ics28_ccv::msgs::ccv_misbehaviour::MsgSubmitIcsConsumerMisbehaviour; -use ibc_relayer_types::clients::ics07_tendermint::header::Header as TendermintHeader; -use ibc_relayer_types::clients::ics07_tendermint::misbehaviour::Misbehaviour as TendermintMisbehaviour; -use ibc_relayer_types::core::ics02_client::height::Height; -use ibc_relayer_types::core::ics02_client::msgs::misbehaviour::MsgSubmitMisbehaviour; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; -use ibc_relayer_types::events::IbcEvent; -use ibc_relayer_types::tx_msg::Msg; - -use crate::conclude::Output; -use crate::prelude::*; +use crate::{conclude::Output, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct EvidenceCmd { @@ -76,14 +86,6 @@ impl Runnable for EvidenceCmd { .exit() }); - if !matches!(chain_config, ChainConfig::CosmosSdk(_)) { - Output::error(format!( - "chain `{}` is not a Cosmos SDK chain", - self.chain_id - )) - .exit(); - } - if let Some(ref key_name) = self.key_name { chain_config.set_key_name(key_name.to_string()); } @@ -95,7 +97,16 @@ impl Runnable for EvidenceCmd { .unwrap(), ); - let chain = CosmosSdkChain::bootstrap(chain_config, rt.clone()).unwrap(); + let chain = match chain_config { + ChainConfig::Astria(_) => { + todo!("AstriaEndpoint::bootstrap"); + } + ChainConfig::CosmosSdk(ref _cfg) => { + CosmosSdkChain::bootstrap(chain_config, rt.clone()).unwrap() + } + ChainConfig::Penumbra(_) => todo!(), + }; + let res = monitor_misbehaviours( rt, &config, @@ -829,11 +840,11 @@ fn build_evidence_headers( #[cfg(test)] mod tests { - use super::EvidenceCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::EvidenceCmd; + #[test] fn test_misbehaviour() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/fee.rs b/crates/relayer-cli/src/commands/fee.rs index 0c8af55ed7..bc713c621b 100644 --- a/crates/relayer-cli/src/commands/fee.rs +++ b/crates/relayer-cli/src/commands/fee.rs @@ -1,12 +1,12 @@ //! `fee` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{config::Override, Command, Runnable}; +use abscissa_core::{clap::Parser, config::Override, Command, Runnable}; use ibc_relayer::config::Config; -use self::register_counterparty_payee::RegisterCounterpartyPayeeCmd; -use self::register_payee::RegisterPayeeCmd; -use self::transfer::FeeTransferCmd; +use self::{ + register_counterparty_payee::RegisterCounterpartyPayeeCmd, register_payee::RegisterPayeeCmd, + transfer::FeeTransferCmd, +}; pub mod register_counterparty_payee; pub mod register_payee; diff --git a/crates/relayer-cli/src/commands/fee/register_counterparty_payee.rs b/crates/relayer-cli/src/commands/fee/register_counterparty_payee.rs index de82f5a7ec..864f8a5f3d 100644 --- a/crates/relayer-cli/src/commands/fee/register_counterparty_payee.rs +++ b/crates/relayer-cli/src/commands/fee/register_counterparty_payee.rs @@ -1,16 +1,19 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use core::str::FromStr; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::tracking::TrackedMsgs; -use ibc_relayer_types::applications::ics29_fee::msgs::register_payee::build_register_counterparty_payee_message; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use ibc_relayer_types::signer::Signer; -use crate::application::app_config; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{handle::ChainHandle, tracking::TrackedMsgs}; +use ibc_relayer_types::{ + applications::ics29_fee::msgs::register_payee::build_register_counterparty_payee_message, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, + signer::Signer, +}; + +use crate::{ + application::app_config, + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct RegisterCounterpartyPayeeCmd { @@ -104,13 +107,13 @@ fn run_register_counterparty_payee_command( #[cfg(test)] mod tests { - use super::RegisterCounterpartyPayeeCmd; - - use abscissa_core::clap::Parser; use std::str::FromStr; + use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::RegisterCounterpartyPayeeCmd; + #[test] fn test_register_counterparty_payee() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/fee/register_payee.rs b/crates/relayer-cli/src/commands/fee/register_payee.rs index 4c43917b4c..a8aa42df58 100644 --- a/crates/relayer-cli/src/commands/fee/register_payee.rs +++ b/crates/relayer-cli/src/commands/fee/register_payee.rs @@ -1,16 +1,19 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use core::str::FromStr; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::tracking::TrackedMsgs; -use ibc_relayer_types::applications::ics29_fee::msgs::register_payee::build_register_payee_message; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use ibc_relayer_types::signer::Signer; -use crate::application::app_config; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{handle::ChainHandle, tracking::TrackedMsgs}; +use ibc_relayer_types::{ + applications::ics29_fee::msgs::register_payee::build_register_payee_message, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, + signer::Signer, +}; + +use crate::{ + application::app_config, + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct RegisterPayeeCmd { @@ -95,13 +98,13 @@ fn run_register_payee_command( #[cfg(test)] mod tests { - use super::RegisterPayeeCmd; - - use abscissa_core::clap::Parser; use std::str::FromStr; + use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::RegisterPayeeCmd; + #[test] fn test_regiser_payee() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/fee/transfer.rs b/crates/relayer-cli/src/commands/fee/transfer.rs index 3893a2d232..58d471a659 100644 --- a/crates/relayer-cli/src/commands/fee/transfer.rs +++ b/crates/relayer-cli/src/commands/fee/transfer.rs @@ -4,7 +4,6 @@ use abscissa_core::{ clap::Parser, config::Override, Command, FrameworkError, FrameworkErrorKind, Runnable, }; use eyre::eyre; - use ibc_relayer::{ chain::handle::ChainHandle, config::Config, @@ -305,16 +304,16 @@ fn fee_transfer(chains: ChainHandlePair, opts: FeeTransferOptions) -> Result<(), #[cfg(test)] mod tests { - use super::FeeTransferCmd; - - use abscissa_core::clap::Parser; use std::str::FromStr; + use abscissa_core::clap::Parser; use ibc_relayer_types::{ applications::transfer::Amount, core::ics24_host::identifier::{ChainId, ChannelId, PortId}, }; + use super::FeeTransferCmd; + #[test] fn test_fee_transfer_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/health.rs b/crates/relayer-cli/src/commands/health.rs index 8514bb087f..7a4758f051 100644 --- a/crates/relayer-cli/src/commands/health.rs +++ b/crates/relayer-cli/src/commands/health.rs @@ -1,12 +1,11 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::chain::endpoint::HealthCheck::*; -use ibc_relayer::chain::handle::ChainHandle; - -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::prelude::*; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{endpoint::HealthCheck::*, handle::ChainHandle}; + +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser)] pub struct HealthCheckCmd {} diff --git a/crates/relayer-cli/src/commands/keys.rs b/crates/relayer-cli/src/commands/keys.rs index 42dee11ff4..4d1c3f0986 100644 --- a/crates/relayer-cli/src/commands/keys.rs +++ b/crates/relayer-cli/src/commands/keys.rs @@ -1,6 +1,5 @@ //! `keys` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod add; mod balance; diff --git a/crates/relayer-cli/src/commands/keys/add.rs b/crates/relayer-cli/src/commands/keys/add.rs index 470667cfe4..c11547fc01 100644 --- a/crates/relayer-cli/src/commands/keys/add.rs +++ b/crates/relayer-cli/src/commands/keys/add.rs @@ -4,22 +4,20 @@ use std::{ path::{Path, PathBuf}, }; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - +use abscissa_core::{clap::Parser, Command, Runnable}; use eyre::eyre; use hdpath::StandardHDPath; use ibc_relayer::{ config::{ChainConfig, Config}, keyring::{ - AnySigningKeyPair, KeyRing, Secp256k1KeyPair, SigningKeyPair, SigningKeyPairSized, Store, + AnySigningKeyPair, Ed25519KeyPair, KeyRing, Secp256k1KeyPair, SigningKeyPair, + SigningKeyPairSized, Store, }, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tracing::warn; -use crate::application::app_config; -use crate::conclude::Output; +use crate::{application::app_config, conclude::Output}; /// The data structure that represents the arguments when invoking the `keys add` CLI command. /// @@ -220,6 +218,23 @@ pub fn add_key( keyring.add_key(key_name, key_pair.clone())?; key_pair.into() } + ChainConfig::Astria(config) => { + let mut keyring = KeyRing::new_ed25519( + Store::Test, + &config.account_prefix, + &config.id, + &config.key_store_folder, + )?; + + check_key_exists(&keyring, key_name, overwrite); + + let key_contents = + fs::read_to_string(file).map_err(|_| eyre!("error reading the key file"))?; + let key_pair = Ed25519KeyPair::from_seed_file(&key_contents, hd_path)?; + + keyring.add_key(key_name, key_pair.clone())?; + key_pair.into() + } ChainConfig::Penumbra(_) => todo!(), }; @@ -257,6 +272,26 @@ pub fn restore_key( keyring.add_key(key_name, key_pair.clone())?; key_pair.into() } + ChainConfig::Astria(config) => { + let mut keyring = KeyRing::new_ed25519( + Store::Test, + &config.account_prefix, + &config.id, + &config.key_store_folder, + )?; + + check_key_exists(&keyring, key_name, overwrite); + + let key_pair = Ed25519KeyPair::from_mnemonic( + &mnemonic_content, + hdpath, + &config.address_type, + keyring.account_prefix(), + )?; + + keyring.add_key(key_name, key_pair.clone())?; + key_pair.into() + } ChainConfig::Penumbra(_) => todo!(), }; @@ -279,12 +314,13 @@ fn check_key_exists(keyring: &KeyRing, key_name: &str #[cfg(test)] mod tests { - use super::KeysAddCmd; use std::path::PathBuf; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::KeysAddCmd; + #[test] fn test_keys_add_key_file() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/keys/balance.rs b/crates/relayer-cli/src/commands/keys/balance.rs index d0e8611c67..8d59e35c7c 100644 --- a/crates/relayer-cli/src/commands/keys/balance.rs +++ b/crates/relayer-cli/src/commands/keys/balance.rs @@ -1,15 +1,14 @@ use std::fmt::Write; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::config::ChainConfig; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::{chain::handle::ChainHandle, config::ChainConfig}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use crate::application::app_config; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, json, Output}; +use crate::{ + application::app_config, + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, json, Output}, +}; /// The data structure that represents the arguments when invoking the `keys balance` CLI command. /// @@ -78,6 +77,7 @@ fn get_balance(chain: impl ChainHandle, key_name: Option, denom: Option< let chain_config = chain.config().unwrap_or_else(exit_with_unrecoverable_error); match chain_config { ChainConfig::CosmosSdk(chain_config) => chain_config.key_name, + ChainConfig::Astria(chain_config) => chain_config.key_name, ChainConfig::Penumbra(_) => todo!(), } }); @@ -101,6 +101,7 @@ fn get_balances(chain: impl ChainHandle, key_name: Option) { let chain_config = chain.config().unwrap_or_else(exit_with_unrecoverable_error); match chain_config { ChainConfig::CosmosSdk(chain_config) => chain_config.key_name, + ChainConfig::Astria(chain_config) => chain_config.key_name, ChainConfig::Penumbra(_) => todo!(), } }); @@ -120,11 +121,11 @@ fn get_balances(chain: impl ChainHandle, key_name: Option) { #[cfg(test)] mod tests { - use super::KeyBalanceCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::KeyBalanceCmd; + #[test] fn test_keys_balance_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/keys/delete.rs b/crates/relayer-cli/src/commands/keys/delete.rs index 5104e8d639..2279264dbe 100644 --- a/crates/relayer-cli/src/commands/keys/delete.rs +++ b/crates/relayer-cli/src/commands/keys/delete.rs @@ -1,6 +1,4 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - +use abscissa_core::{clap::Parser, Command, Runnable}; use eyre::eyre; use ibc_relayer::{ config::{ChainConfig, Config}, @@ -8,8 +6,7 @@ use ibc_relayer::{ }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use crate::application::app_config; -use crate::conclude::Output; +use crate::{application::app_config, conclude::Output}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] #[clap( @@ -123,6 +120,15 @@ pub fn delete_key(config: &ChainConfig, key_name: &str) -> eyre::Result<()> { )?; keyring.remove_key(key_name)?; } + ChainConfig::Astria(config) => { + let mut keyring = KeyRing::new_ed25519( + Store::Test, + &config.account_prefix, + &config.id, + &config.key_store_folder, + )?; + keyring.remove_key(key_name)?; + } ChainConfig::Penumbra(_) => todo!(), } Ok(()) @@ -142,6 +148,18 @@ pub fn delete_all_keys(config: &ChainConfig) -> eyre::Result<()> { keyring.remove_key(&key_name)?; } } + ChainConfig::Astria(config) => { + let mut keyring = KeyRing::new_ed25519( + Store::Test, + &config.account_prefix, + &config.id, + &config.key_store_folder, + )?; + let keys = keyring.keys()?; + for (key_name, _) in keys { + keyring.remove_key(&key_name)?; + } + } ChainConfig::Penumbra(_) => todo!(), } Ok(()) @@ -149,11 +167,11 @@ pub fn delete_all_keys(config: &ChainConfig) -> eyre::Result<()> { #[cfg(test)] mod tests { - use super::KeysDeleteCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::KeysDeleteCmd; + #[test] fn test_keys_delete_key_name() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/keys/list.rs b/crates/relayer-cli/src/commands/keys/list.rs index cf3ec72651..ac6c202755 100644 --- a/crates/relayer-cli/src/commands/keys/list.rs +++ b/crates/relayer-cli/src/commands/keys/list.rs @@ -1,14 +1,15 @@ use alloc::collections::btree_map::BTreeMap as HashMap; use core::fmt::Write; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use crate::conclude::Output; -use crate::{application::app_config, conclude::json}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::config::{ChainConfig, Config}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use crate::{ + application::app_config, + conclude::{json, Output}, +}; + #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct KeysListCmd { #[clap( @@ -66,11 +67,11 @@ pub struct KeysListOptions { #[cfg(test)] mod tests { - use super::KeysListCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::KeysListCmd; + #[test] fn test_keys_list() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/listen.rs b/crates/relayer-cli/src/commands/listen.rs index c428ec45a5..a5b44d0a16 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -5,14 +5,8 @@ use core::{ }; use std::thread; -use abscissa_core::clap::Parser; -use abscissa_core::{application::fatal_error, Runnable}; +use abscissa_core::{application::fatal_error, clap::Parser, Runnable}; use eyre::eyre; -use itertools::Itertools; -use tendermint_rpc::{client::CompatMode, Client, HttpClient}; -use tokio::runtime::Runtime as TokioRuntime; -use tracing::{error, info, instrument}; - use ibc_relayer::{ chain::handle::Subscription, config::{ChainConfig, EventSourceMode}, @@ -20,6 +14,10 @@ use ibc_relayer::{ util::compat_mode::compat_mode_from_version, }; use ibc_relayer_types::{core::ics24_host::identifier::ChainId, events::IbcEvent}; +use itertools::Itertools; +use tendermint_rpc::{client::CompatMode, Client, HttpClient}; +use tokio::runtime::Runtime as TokioRuntime; +use tracing::{error, info, instrument}; use crate::prelude::*; @@ -147,7 +145,7 @@ fn subscribe( // Q: Should this be restricted only to backends that support it, // or are all backends expected to support subscriptions? match chain_config { - ChainConfig::CosmosSdk(config) => { + ChainConfig::CosmosSdk(config) | ChainConfig::Astria(config) => { let (event_source, monitor_tx) = match &config.event_source { EventSourceMode::Push { url, batch_delay } => EventSource::websocket( chain_config.id().clone(), @@ -201,6 +199,7 @@ fn detect_compatibility_mode( // TODO(erwan): move this to the cosmos sdk endpoint implementation let rpc_addr = match config { ChainConfig::CosmosSdk(config) => config.rpc_addr.clone(), + ChainConfig::Astria(config) => config.rpc_addr.clone(), ChainConfig::Penumbra(config) => config.rpc_addr.clone(), }; let client = HttpClient::new(rpc_addr)?; @@ -209,6 +208,9 @@ fn detect_compatibility_mode( ChainConfig::CosmosSdk(config) => { compat_mode_from_version(&config.compat_mode, status.node_info.version)?.into() } + ChainConfig::Astria(config) => { + compat_mode_from_version(&config.compat_mode, status.node_info.version)?.into() + } ChainConfig::Penumbra(config) => { compat_mode_from_version(&config.compat_mode, status.node_info.version)?.into() } @@ -218,13 +220,13 @@ fn detect_compatibility_mode( #[cfg(test)] mod tests { - use super::{EventFilter, ListenCmd}; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::{EventFilter, ListenCmd}; + #[test] fn test_listen_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/logs.rs b/crates/relayer-cli/src/commands/logs.rs index 2a55b2a8f1..46f5e8f1ec 100644 --- a/crates/relayer-cli/src/commands/logs.rs +++ b/crates/relayer-cli/src/commands/logs.rs @@ -1,6 +1,4 @@ -use abscissa_core::clap::Parser; -use abscissa_core::Command; -use abscissa_core::Runnable; +use abscissa_core::{clap::Parser, Command, Runnable}; pub mod log_level; pub mod raw; diff --git a/crates/relayer-cli/src/commands/logs/log_level.rs b/crates/relayer-cli/src/commands/logs/log_level.rs index 51d349bfd1..58b115488a 100644 --- a/crates/relayer-cli/src/commands/logs/log_level.rs +++ b/crates/relayer-cli/src/commands/logs/log_level.rs @@ -1,11 +1,7 @@ -use abscissa_core::clap::Parser; -use abscissa_core::Command; -use abscissa_core::Runnable; -use tracing::info; -use tracing::Level; - -use crate::prelude::app_config; -use crate::tracing_handle::send_command; +use abscissa_core::{clap::Parser, Command, Runnable}; +use tracing::{info, Level}; + +use crate::{prelude::app_config, tracing_handle::send_command}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct SetLogLevelCmd { diff --git a/crates/relayer-cli/src/commands/logs/raw.rs b/crates/relayer-cli/src/commands/logs/raw.rs index 6c680e0c9b..82316d0e4e 100644 --- a/crates/relayer-cli/src/commands/logs/raw.rs +++ b/crates/relayer-cli/src/commands/logs/raw.rs @@ -1,11 +1,7 @@ -use abscissa_core::clap::Parser; -use abscissa_core::Command; -use abscissa_core::Runnable; -use tracing::error; -use tracing::info; - -use crate::prelude::app_config; -use crate::tracing_handle::send_command; +use abscissa_core::{clap::Parser, Command, Runnable}; +use tracing::{error, info}; + +use crate::{prelude::app_config, tracing_handle::send_command}; // TODO `hermes set-raw-filter` #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] diff --git a/crates/relayer-cli/src/commands/logs/reset.rs b/crates/relayer-cli/src/commands/logs/reset.rs index e216af3c32..901d9c6ba9 100644 --- a/crates/relayer-cli/src/commands/logs/reset.rs +++ b/crates/relayer-cli/src/commands/logs/reset.rs @@ -1,10 +1,6 @@ -use abscissa_core::clap::Parser; -use abscissa_core::Command; -use abscissa_core::Runnable; +use abscissa_core::{clap::Parser, Command, Runnable}; -use crate::components::default_directive; -use crate::prelude::*; -use crate::tracing_handle::send_command; +use crate::{components::default_directive, prelude::*, tracing_handle::send_command}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct ResetCmd {} diff --git a/crates/relayer-cli/src/commands/misbehaviour.rs b/crates/relayer-cli/src/commands/misbehaviour.rs index 8400d11ad9..63fc55c66c 100644 --- a/crates/relayer-cli/src/commands/misbehaviour.rs +++ b/crates/relayer-cli/src/commands/misbehaviour.rs @@ -1,20 +1,29 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}; -use ibc_relayer::config::Config; -use ibc_relayer::foreign_client::{ForeignClient, MisbehaviourResults}; -use ibc_relayer::util::pretty::PrettySlice; -use ibc_relayer_types::core::ics02_client::events::UpdateClient; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; -use ibc_relayer_types::events::IbcEvent; use std::ops::Deref; -use crate::cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic}; -use crate::conclude::Output; -use crate::prelude::*; +use abscissa_core::{clap::Parser, Command, Runnable}; use eyre::eyre; -use ibc_relayer_types::core::ics02_client::client_state::ClientState; +use ibc_relayer::{ + chain::{ + handle::ChainHandle, + requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, + }, + config::Config, + foreign_client::{ForeignClient, MisbehaviourResults}, + util::pretty::PrettySlice, +}; +use ibc_relayer_types::{ + core::{ + ics02_client::{client_state::ClientState, events::UpdateClient}, + ics24_host::identifier::{ChainId, ClientId}, + }, + events::IbcEvent, +}; + +use crate::{ + cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic}, + conclude::Output, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct MisbehaviourCmd { @@ -155,13 +164,13 @@ fn misbehaviour_handling( #[cfg(test)] mod tests { - use super::MisbehaviourCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; + use super::MisbehaviourCmd; + #[test] fn test_misbehaviour() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query.rs b/crates/relayer-cli/src/commands/query.rs index e154f6a98c..3dd73168a2 100644 --- a/crates/relayer-cli/src/commands/query.rs +++ b/crates/relayer-cli/src/commands/query.rs @@ -1,12 +1,11 @@ //! `query` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; -use crate::commands::query::channel_client::QueryChannelClientCmd; -use crate::commands::query::channel_ends::QueryChannelEndsCmd; -use crate::commands::query::channels::QueryChannelsCmd; -use crate::commands::query::packet::QueryPacketCmds; +use crate::commands::query::{ + channel_client::QueryChannelClientCmd, channel_ends::QueryChannelEndsCmd, + channels::QueryChannelsCmd, packet::QueryPacketCmds, +}; mod channel; mod channel_client; diff --git a/crates/relayer-cli/src/commands/query/channel.rs b/crates/relayer-cli/src/commands/query/channel.rs index f350ea8dd6..2502983d20 100644 --- a/crates/relayer-cli/src/commands/query/channel.rs +++ b/crates/relayer-cli/src/commands/query/channel.rs @@ -1,16 +1,21 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer::chain::handle::ChainHandle; - -use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; -use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; - -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::prelude::*; -use ibc_relayer_types::core::ics04_channel::channel::State; -use ibc_relayer_types::Height; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{ + handle::ChainHandle, + requests::{IncludeProof, QueryChannelRequest, QueryHeight}, +}; +use ibc_relayer_types::{ + core::{ + ics04_channel::channel::State, + ics24_host::identifier::{ChainId, ChannelId, PortId}, + }, + Height, +}; + +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryChannelEndCmd { @@ -89,13 +94,13 @@ impl Runnable for QueryChannelEndCmd { #[cfg(test)] mod tests { - use super::QueryChannelEndCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::QueryChannelEndCmd; + #[test] fn test_query_channel_end_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/channel_client.rs b/crates/relayer-cli/src/commands/query/channel_client.rs index 4824aa53a1..e8a2ae0cca 100644 --- a/crates/relayer-cli/src/commands/query/channel_client.rs +++ b/crates/relayer-cli/src/commands/query/channel_client.rs @@ -1,13 +1,12 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::QueryChannelClientStateRequest; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{handle::ChainHandle, requests::QueryChannelClientStateRequest}; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use crate::application::app_config; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; +use crate::{ + application::app_config, + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, +}; /// The data structure that represents the arguments when invoking the `query channel client` CLI command. /// @@ -64,13 +63,13 @@ impl Runnable for QueryChannelClientCmd { #[cfg(test)] mod tests { - use super::QueryChannelClientCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::QueryChannelClientCmd; + #[test] fn test_query_channel_client() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/channel_ends.rs b/crates/relayer-cli/src/commands/query/channel_ends.rs index aaa668beb1..0f372ab8d3 100644 --- a/crates/relayer-cli/src/commands/query/channel_ends.rs +++ b/crates/relayer-cli/src/commands/query/channel_ends.rs @@ -1,22 +1,30 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use serde::{Deserialize, Serialize}; - +use abscissa_core::{clap::Parser, Command, Runnable}; use eyre::eyre; -use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; -use ibc_relayer::chain::requests::{ - IncludeProof, QueryChannelRequest, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, +use ibc_relayer::{ + chain::{ + handle::{BaseChainHandle, ChainHandle}, + requests::{ + IncludeProof, QueryChannelRequest, QueryClientStateRequest, QueryConnectionRequest, + QueryHeight, + }, + }, + client_state::AnyClientState, + registry::Registry, }; -use ibc_relayer::client_state::AnyClientState; -use ibc_relayer::registry::Registry; -use ibc_relayer_types::core::ics03_connection::connection::ConnectionEnd; -use ibc_relayer_types::core::ics04_channel::channel::{ChannelEnd, State}; -use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; -use ibc_relayer_types::Height; +use ibc_relayer_types::{ + core::{ + ics03_connection::connection::ConnectionEnd, + ics04_channel::channel::{ChannelEnd, State}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, + }, + Height, +}; +use serde::{Deserialize, Serialize}; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::prelude::*; +use crate::{ + conclude::{exit_with_unrecoverable_error, Output}, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryChannelEndsCmd { @@ -254,13 +262,13 @@ impl Runnable for QueryChannelEndsCmd { #[cfg(test)] mod tests { - use super::QueryChannelEndsCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::QueryChannelEndsCmd; + #[test] fn test_query_channel_ends_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/channels.rs b/crates/relayer-cli/src/commands/query/channels.rs index a516854416..97b2e4075f 100644 --- a/crates/relayer-cli/src/commands/query/channels.rs +++ b/crates/relayer-cli/src/commands/query/channels.rs @@ -1,24 +1,24 @@ use core::fmt::{Debug, Error, Formatter}; -use abscissa_core::clap::Parser; -use abscissa_core::Runnable; -use serde::Serialize; - +use abscissa_core::{clap::Parser, Runnable}; use eyre::eyre; -use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; -use ibc_relayer::chain::requests::{ - IncludeProof, PageRequest, QueryChannelRequest, QueryChannelsRequest, QueryClientStateRequest, - QueryConnectionRequest, QueryHeight, +use ibc_relayer::{ + chain::{ + handle::{BaseChainHandle, ChainHandle}, + requests::{ + IncludeProof, PageRequest, QueryChannelRequest, QueryChannelsRequest, + QueryClientStateRequest, QueryConnectionRequest, QueryHeight, + }, + }, + registry::Registry, }; -use ibc_relayer::registry::Registry; -use ibc_relayer_types::core::ics04_channel::channel::{ChannelEnd, State}; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, ChannelId, ConnectionId, PortChannelId, PortId, +use ibc_relayer_types::core::{ + ics04_channel::channel::{ChannelEnd, State}, + ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortChannelId, PortId}, }; +use serde::Serialize; -use crate::commands::query::channel_ends::ChannelEnds; -use crate::conclude::Output; -use crate::prelude::*; +use crate::{commands::query::channel_ends::ChannelEnds, conclude::Output, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryChannelsCmd { @@ -383,11 +383,11 @@ impl Debug for QueryChannelsOutput { #[cfg(test)] mod tests { - use super::QueryChannelsCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::QueryChannelsCmd; + #[test] fn test_query_channels_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/client.rs b/crates/relayer-cli/src/commands/query/client.rs index cd613df4df..722f1e181a 100644 --- a/crates/relayer-cli/src/commands/query/client.rs +++ b/crates/relayer-cli/src/commands/query/client.rs @@ -1,23 +1,27 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; use color_eyre::eyre::eyre; - -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{ - IncludeProof, PageRequest, QueryClientConnectionsRequest, QueryClientEventRequest, - QueryClientStateRequest, QueryConsensusStateHeightsRequest, QueryConsensusStateRequest, - QueryHeight, QueryTxRequest, +use ibc_relayer::chain::{ + handle::ChainHandle, + requests::{ + IncludeProof, PageRequest, QueryClientConnectionsRequest, QueryClientEventRequest, + QueryClientStateRequest, QueryConsensusStateHeightsRequest, QueryConsensusStateRequest, + QueryHeight, QueryTxRequest, + }, +}; +use ibc_relayer_types::{ + core::{ + ics02_client::client_state::ClientState, + ics24_host::identifier::{ChainId, ClientId}, + }, + events::WithBlockDataType, + Height, }; -use ibc_relayer_types::core::ics02_client::client_state::ClientState; -use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use ibc_relayer_types::core::ics24_host::identifier::ClientId; -use ibc_relayer_types::events::WithBlockDataType; -use ibc_relayer_types::Height; - -use crate::application::app_config; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; +use crate::{ + application::app_config, + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, +}; /// Query client state command #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] @@ -407,16 +411,16 @@ impl Runnable for QueryClientConnectionsCmd { #[cfg(test)] mod tests { - use super::{ - QueryClientConnectionsCmd, QueryClientConsensusCmd, QueryClientHeaderCmd, - QueryClientStateCmd, QueryClientStatusCmd, - }; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; + use super::{ + QueryClientConnectionsCmd, QueryClientConsensusCmd, QueryClientHeaderCmd, + QueryClientStateCmd, QueryClientStatusCmd, + }; + #[test] fn test_query_client_connections_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/clients.rs b/crates/relayer-cli/src/commands/query/clients.rs index 0ced719b2b..242b12213f 100644 --- a/crates/relayer-cli/src/commands/query/clients.rs +++ b/crates/relayer-cli/src/commands/query/clients.rs @@ -1,15 +1,17 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer::chain::handle::ChainHandle; -use serde::Serialize; - -use ibc_relayer::chain::requests::{PageRequest, QueryClientStatesRequest}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{ + handle::ChainHandle, + requests::{PageRequest, QueryClientStatesRequest}, +}; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; +use serde::Serialize; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; -use crate::prelude::*; +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, + prelude::*, +}; /// Query clients command #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] @@ -109,11 +111,11 @@ impl Runnable for QueryAllClientsCmd { #[cfg(test)] mod tests { - use super::QueryAllClientsCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::QueryAllClientsCmd; + #[test] fn test_query_clients_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/connection.rs b/crates/relayer-cli/src/commands/query/connection.rs index 28b044985d..10c27d61d3 100644 --- a/crates/relayer-cli/src/commands/query/connection.rs +++ b/crates/relayer-cli/src/commands/query/connection.rs @@ -1,21 +1,25 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{ - IncludeProof, PageRequest, QueryConnectionChannelsRequest, QueryConnectionRequest, QueryHeight, +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{ + handle::ChainHandle, + requests::{ + IncludeProof, PageRequest, QueryConnectionChannelsRequest, QueryConnectionRequest, + QueryHeight, + }, }; - -use ibc_relayer_types::core::{ - ics03_connection::connection::State, - ics24_host::identifier::ConnectionId, - ics24_host::identifier::{ChainId, PortChannelId}, +use ibc_relayer_types::{ + core::{ + ics03_connection::connection::State, + ics24_host::identifier::{ChainId, ConnectionId, PortChannelId}, + }, + Height, }; -use ibc_relayer_types::Height; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; -use crate::prelude::*; +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryConnectionEndCmd { @@ -140,13 +144,13 @@ impl Runnable for QueryConnectionChannelsCmd { #[cfg(test)] mod tests { - use super::{QueryConnectionChannelsCmd, QueryConnectionEndCmd}; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ConnectionId}; + use super::{QueryConnectionChannelsCmd, QueryConnectionEndCmd}; + #[test] fn test_query_connection_channels() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/connections.rs b/crates/relayer-cli/src/commands/query/connections.rs index dadef9d6a2..63bf6cc94b 100644 --- a/crates/relayer-cli/src/commands/query/connections.rs +++ b/crates/relayer-cli/src/commands/query/connections.rs @@ -1,15 +1,17 @@ -use abscissa_core::clap::Parser; -use abscissa_core::Runnable; - -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{ - IncludeProof, PageRequest, QueryClientStateRequest, QueryConnectionsRequest, QueryHeight, +use abscissa_core::{clap::Parser, Runnable}; +use ibc_relayer::chain::{ + handle::ChainHandle, + requests::{ + IncludeProof, PageRequest, QueryClientStateRequest, QueryConnectionsRequest, QueryHeight, + }, }; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ConnectionId}; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::prelude::*; +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryConnectionsCmd { @@ -99,11 +101,11 @@ impl Runnable for QueryConnectionsCmd { #[cfg(test)] mod tests { - use super::QueryConnectionsCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::QueryConnectionsCmd; + #[test] fn test_query_connections_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/packet.rs b/crates/relayer-cli/src/commands/query/packet.rs index b4bdbd4331..0920605ce3 100644 --- a/crates/relayer-cli/src/commands/query/packet.rs +++ b/crates/relayer-cli/src/commands/query/packet.rs @@ -1,5 +1,4 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod ack; mod acks; diff --git a/crates/relayer-cli/src/commands/query/packet/ack.rs b/crates/relayer-cli/src/commands/query/packet/ack.rs index 93c59d1efc..7353acd594 100644 --- a/crates/relayer-cli/src/commands/query/packet/ack.rs +++ b/crates/relayer-cli/src/commands/query/packet/ack.rs @@ -1,17 +1,23 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer::chain::requests::{IncludeProof, QueryHeight, QueryPacketAcknowledgementRequest}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{ + handle::ChainHandle, + requests::{IncludeProof, QueryHeight, QueryPacketAcknowledgementRequest}, +}; +use ibc_relayer_types::{ + core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChainId, ChannelId, PortId}, + }, + Height, +}; use subtle_encoding::{Encoding, Hex}; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use ibc_relayer_types::Height; - -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; -use crate::prelude::*; +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryPacketAcknowledgmentCmd { @@ -102,13 +108,15 @@ impl Runnable for QueryPacketAcknowledgmentCmd { #[cfg(test)] mod tests { - use super::QueryPacketAcknowledgmentCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics04_channel::packet::Sequence; - use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use ibc_relayer_types::core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChainId, ChannelId, PortId}, + }; + + use super::QueryPacketAcknowledgmentCmd; #[test] fn test_query_packet_ack_required_only() { diff --git a/crates/relayer-cli/src/commands/query/packet/acks.rs b/crates/relayer-cli/src/commands/query/packet/acks.rs index f7e85156dc..afa493321b 100644 --- a/crates/relayer-cli/src/commands/query/packet/acks.rs +++ b/crates/relayer-cli/src/commands/query/packet/acks.rs @@ -1,16 +1,9 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::chain::counterparty::acknowledgements_on_chain; -use ibc_relayer::chain::handle::BaseChainHandle; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{counterparty::acknowledgements_on_chain, handle::BaseChainHandle}; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use crate::cli_utils::spawn_chain_counterparty; -use crate::conclude::Output; -use crate::error::Error; -use crate::prelude::*; - use super::util::PacketSeqs; +use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryPacketAcknowledgementsCmd { @@ -81,13 +74,13 @@ impl Runnable for QueryPacketAcknowledgementsCmd { #[cfg(test)] mod tests { - use super::QueryPacketAcknowledgementsCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::QueryPacketAcknowledgementsCmd; + #[test] fn test_query_packet_acks() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/packet/commitment.rs b/crates/relayer-cli/src/commands/query/packet/commitment.rs index 74779dd5a1..26e49d56b1 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitment.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitment.rs @@ -1,18 +1,24 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer::chain::requests::{IncludeProof, QueryHeight, QueryPacketCommitmentRequest}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{ + handle::ChainHandle, + requests::{IncludeProof, QueryHeight, QueryPacketCommitmentRequest}, +}; +use ibc_relayer_types::{ + core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChainId, ChannelId, PortId}, + }, + Height, +}; use serde::Serialize; use subtle_encoding::{Encoding, Hex}; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use ibc_relayer_types::Height; - -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; -use crate::prelude::*; +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, + prelude::*, +}; #[derive(Serialize, Debug)] struct PacketSeqs { @@ -112,8 +118,6 @@ impl Runnable for QueryPacketCommitmentCmd { #[cfg(test)] mod tests { - use super::QueryPacketCommitmentCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; @@ -122,6 +126,8 @@ mod tests { ics24_host::identifier::{ChainId, ChannelId, PortId}, }; + use super::QueryPacketCommitmentCmd; + #[test] fn test_query_packet_commitment_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/packet/commitments.rs b/crates/relayer-cli/src/commands/query/packet/commitments.rs index a308e5b83d..648770e762 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitments.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitments.rs @@ -1,15 +1,9 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::counterparty::commitments_on_chain; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::Output; -use crate::error::Error; -use crate::prelude::*; - use super::util::PacketSeqs; +use crate::{cli_utils::spawn_chain_runtime, conclude::Output, error::Error, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryPacketCommitmentsCmd { @@ -72,13 +66,13 @@ impl Runnable for QueryPacketCommitmentsCmd { #[cfg(test)] mod tests { - use super::QueryPacketCommitmentsCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::QueryPacketCommitmentsCmd; + #[test] fn test_query_packet_commitments() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/packet/pending.rs b/crates/relayer-cli/src/commands/query/packet/pending.rs index 73a1781b5c..ed6a679e04 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending.rs @@ -1,21 +1,15 @@ use core::fmt; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use serde::Serialize; - -use ibc_relayer::chain::counterparty::{ - channel_on_destination, pending_packet_summary, PendingPackets, +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{ + counterparty::{channel_on_destination, pending_packet_summary, PendingPackets}, + handle::{BaseChainHandle, ChainHandle}, }; -use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; - -use crate::cli_utils::spawn_chain_counterparty; -use crate::conclude::Output; -use crate::error::Error; -use crate::prelude::*; +use serde::Serialize; use super::util::CollatedPendingPackets; +use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; /// A structure to display pending packet commitment sequence IDs /// at both ends of a channel. @@ -168,13 +162,13 @@ impl Runnable for QueryPendingPacketsCmd { #[cfg(test)] mod tests { - use super::QueryPendingPacketsCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::QueryPendingPacketsCmd; + #[test] fn test_query_packet_pending() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/packet/pending_acks.rs b/crates/relayer-cli/src/commands/query/packet/pending_acks.rs index ea5288dbbc..aef53a7511 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending_acks.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending_acks.rs @@ -1,17 +1,15 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::chain::counterparty::unreceived_acknowledgements; -use ibc_relayer::chain::handle::BaseChainHandle; -use ibc_relayer::path::PathIdentifiers; -use ibc_relayer::util::collate::CollatedIterExt; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; - -use crate::cli_utils::spawn_chain_counterparty; -use crate::conclude::Output; -use crate::error::Error; -use crate::prelude::*; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::{ + chain::{counterparty::unreceived_acknowledgements, handle::BaseChainHandle}, + path::PathIdentifiers, + util::collate::CollatedIterExt, +}; +use ibc_relayer_types::core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChainId, ChannelId, PortId}, +}; + +use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; /// This command does the following: /// 1. queries the chain to get its counterparty, channel and port identifiers (needed in 2) @@ -90,13 +88,13 @@ impl Runnable for QueryPendingAcksCmd { #[cfg(test)] mod tests { - use super::QueryPendingAcksCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::QueryPendingAcksCmd; + #[test] fn test_query_packet_unreceived_acks() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/packet/pending_sends.rs b/crates/relayer-cli/src/commands/query/packet/pending_sends.rs index 8d305e496e..4cbbc81179 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending_sends.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending_sends.rs @@ -1,17 +1,15 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::chain::counterparty::unreceived_packets; -use ibc_relayer::chain::handle::BaseChainHandle; -use ibc_relayer::path::PathIdentifiers; -use ibc_relayer::util::collate::CollatedIterExt; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; - -use crate::cli_utils::spawn_chain_counterparty; -use crate::conclude::Output; -use crate::error::Error; -use crate::prelude::*; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::{ + chain::{counterparty::unreceived_packets, handle::BaseChainHandle}, + path::PathIdentifiers, + util::collate::CollatedIterExt, +}; +use ibc_relayer_types::core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChainId, ChannelId, PortId}, +}; + +use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; /// This command does the following: /// 1. queries the chain to get its counterparty chain, channel and port identifiers (needed in 2) @@ -89,13 +87,13 @@ impl Runnable for QueryPendingSendsCmd { #[cfg(test)] mod tests { - use super::QueryPendingSendsCmd; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::QueryPendingSendsCmd; + #[test] fn test_query_packet_unreceived_packets() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/packet/util.rs b/crates/relayer-cli/src/commands/query/packet/util.rs index 781bb96552..b7068cf344 100644 --- a/crates/relayer-cli/src/commands/query/packet/util.rs +++ b/crates/relayer-cli/src/commands/query/packet/util.rs @@ -1,12 +1,9 @@ use core::fmt; -use serde::Serialize; - -use ibc_relayer::util::collate::{Collated, CollatedIterExt}; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::Height; - pub use ibc_relayer::chain::counterparty::PendingPackets; +use ibc_relayer::util::collate::{Collated, CollatedIterExt}; +use ibc_relayer_types::{core::ics04_channel::packet::Sequence, Height}; +use serde::Serialize; #[derive(Serialize)] pub struct CollatedPendingPackets { diff --git a/crates/relayer-cli/src/commands/query/transfer.rs b/crates/relayer-cli/src/commands/query/transfer.rs index 1c59cccb5a..d1ec140a61 100644 --- a/crates/relayer-cli/src/commands/query/transfer.rs +++ b/crates/relayer-cli/src/commands/query/transfer.rs @@ -1,7 +1,6 @@ //! `query transfer` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod denom_trace; diff --git a/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs b/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs index 3ce25c0658..dcffce2657 100644 --- a/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs +++ b/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs @@ -1,12 +1,12 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use crate::application::app_config; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, json, Output}; +use crate::{ + application::app_config, + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, json, Output}, +}; /// The data structure that represents the arguments when invoking the `query transfer denom-trace` CLI command. /// @@ -58,11 +58,11 @@ impl Runnable for DenomTraceCmd { #[cfg(test)] mod tests { - use super::DenomTraceCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::DenomTraceCmd; + #[test] fn test_transfer_denom_trace() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/query/tx.rs b/crates/relayer-cli/src/commands/query/tx.rs index 0a7849ed0e..4d06b38256 100644 --- a/crates/relayer-cli/src/commands/query/tx.rs +++ b/crates/relayer-cli/src/commands/query/tx.rs @@ -1,7 +1,6 @@ //! `query tx` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod events; diff --git a/crates/relayer-cli/src/commands/query/tx/events.rs b/crates/relayer-cli/src/commands/query/tx/events.rs index 0cd1a878cf..cd77ab0d04 100644 --- a/crates/relayer-cli/src/commands/query/tx/events.rs +++ b/crates/relayer-cli/src/commands/query/tx/events.rs @@ -1,19 +1,19 @@ use core::str::FromStr; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use tendermint::Hash; - +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{ + handle::ChainHandle, + requests::{QueryTxHash, QueryTxRequest}, +}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use tendermint::Hash; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{QueryTxHash, QueryTxRequest}; - -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; -use crate::prelude::app_config; +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, + prelude::app_config, +}; /// Query the events emitted by transaction #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] @@ -62,11 +62,11 @@ impl Runnable for QueryTxEventsCmd { #[cfg(test)] mod tests { - use super::QueryTxEventsCmd; - use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; + use super::QueryTxEventsCmd; + #[test] fn test_query_tx_events() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/start.rs b/crates/relayer-cli/src/commands/start.rs index 5f0346d211..6ca38f9df7 100644 --- a/crates/relayer-cli/src/commands/start.rs +++ b/crates/relayer-cli/src/commands/start.rs @@ -1,21 +1,20 @@ -use ibc_relayer::supervisor::SupervisorOptions; -use ibc_relayer::util::debug_section::DebugSection; -use std::error::Error; -use std::io; +use std::{error::Error, io}; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; use crossbeam_channel::Sender; - -use ibc_relayer::chain::handle::{CachingChainHandle, ChainHandle}; -use ibc_relayer::config::Config; -use ibc_relayer::registry::SharedRegistry; -use ibc_relayer::rest; -use ibc_relayer::supervisor::{cmd::SupervisorCmd, spawn_supervisor, SupervisorHandle}; - -use crate::conclude::json; -use crate::conclude::Output; -use crate::prelude::*; +use ibc_relayer::{ + chain::handle::{CachingChainHandle, ChainHandle}, + config::Config, + registry::SharedRegistry, + rest, + supervisor::{cmd::SupervisorCmd, spawn_supervisor, SupervisorHandle, SupervisorOptions}, + util::debug_section::DebugSection, +}; + +use crate::{ + conclude::{json, Output}, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct StartCmd { @@ -31,8 +30,7 @@ impl Runnable for StartCmd { let app = app_reader(); if app.debug_enabled(DebugSection::ProfilingJson) { - use std::env; - use std::path::Path; + use std::{env, path::Path}; use ibc_relayer::util::profiling::open_or_create_profile_file; @@ -246,10 +244,10 @@ fn make_supervisor( #[cfg(test)] mod tests { - use super::StartCmd; - use abscissa_core::clap::Parser; + use super::StartCmd; + #[test] fn test_start_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/tx.rs b/crates/relayer-cli/src/commands/tx.rs index f8cadf766b..0908cfb837 100644 --- a/crates/relayer-cli/src/commands/tx.rs +++ b/crates/relayer-cli/src/commands/tx.rs @@ -1,6 +1,5 @@ //! `tx` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{config::Override, Command, Runnable}; +use abscissa_core::{clap::Parser, config::Override, Command, Runnable}; use ibc_relayer::config::Config; mod channel; diff --git a/crates/relayer-cli/src/commands/tx/channel.rs b/crates/relayer-cli/src/commands/tx/channel.rs index 0531c85dfe..2d7f625e3c 100644 --- a/crates/relayer-cli/src/commands/tx/channel.rs +++ b/crates/relayer-cli/src/commands/tx/channel.rs @@ -1,22 +1,23 @@ #![allow(clippy::redundant_closure_call)] -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{IncludeProof, QueryConnectionRequest, QueryHeight}; -use ibc_relayer::channel::{Channel, ChannelSide}; -use ibc_relayer_types::core::ics03_connection::connection::ConnectionEnd; -use ibc_relayer_types::core::ics04_channel::channel::Ordering; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, ChannelId, ClientId, ConnectionId, PortId, +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::{ + chain::{ + handle::ChainHandle, + requests::{IncludeProof, QueryConnectionRequest, QueryHeight}, + }, + channel::{Channel, ChannelSide}, +}; +use ibc_relayer_types::{ + core::{ + ics03_connection::connection::ConnectionEnd, + ics04_channel::channel::Ordering, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, + }, + events::IbcEvent, }; -use ibc_relayer_types::events::IbcEvent; -use crate::cli_utils::ChainHandlePair; -use crate::conclude::Output; -use crate::error::Error; -use crate::prelude::*; +use crate::{cli_utils::ChainHandlePair, conclude::Output, error::Error, prelude::*}; macro_rules! tx_chan_cmd { ($dbg_string:literal, $func:ident, $self:expr, $chan:expr) => { @@ -671,11 +672,6 @@ impl Runnable for TxChanCloseConfirmCmd { #[cfg(test)] mod tests { - use super::{ - TxChanCloseConfirmCmd, TxChanCloseInitCmd, TxChanOpenAckCmd, TxChanOpenConfirmCmd, - TxChanOpenInitCmd, TxChanOpenTryCmd, - }; - use std::str::FromStr; use abscissa_core::clap::Parser; @@ -684,6 +680,11 @@ mod tests { ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortId}, }; + use super::{ + TxChanCloseConfirmCmd, TxChanCloseInitCmd, TxChanOpenAckCmd, TxChanOpenConfirmCmd, + TxChanOpenInitCmd, TxChanOpenTryCmd, + }; + #[test] fn test_chan_open_init_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/tx/client.rs b/crates/relayer-cli/src/commands/tx/client.rs index 96d4496e96..1c813487a5 100644 --- a/crates/relayer-cli/src/commands/tx/client.rs +++ b/crates/relayer-cli/src/commands/tx/client.rs @@ -4,31 +4,35 @@ use core::{ }; use std::thread; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::config::Config; -use ibc_relayer::event::IbcEventWithHeight; -use ibc_relayer::foreign_client::{CreateOptions, ForeignClient}; -use ibc_relayer::{chain::handle::ChainHandle, config::GenesisRestart}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::{ - chain::requests::{ - IncludeProof, PageRequest, QueryClientStateRequest, QueryClientStatesRequest, QueryHeight, + chain::{ + handle::ChainHandle, + requests::{ + IncludeProof, PageRequest, QueryClientStateRequest, QueryClientStatesRequest, + QueryHeight, + }, }, - config::ChainConfig, + config::{ChainConfig, Config, GenesisRestart}, + event::IbcEventWithHeight, + foreign_client::{CreateOptions, ForeignClient}, +}; +use ibc_relayer_types::{ + core::ics24_host::identifier::{ChainId, ClientId}, + events::IbcEvent, + Height, }; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; -use ibc_relayer_types::events::IbcEvent; -use ibc_relayer_types::Height; use tendermint::block::Height as BlockHeight; use tendermint_light_client_verifier::types::TrustThreshold; use tendermint_rpc::Url; use tracing::debug; -use crate::application::app_config; -use crate::cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic, ChainHandlePair}; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; +use crate::{ + application::app_config, + cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct TxCreateClientCmd { @@ -206,7 +210,7 @@ impl Runnable for TxUpdateClientCmd { if let Some(restart_params) = self.genesis_restart_params() { match config.find_chain_mut(&reference_chain_id) { Some(chain_config) => match chain_config { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Astria(chain_config) => { chain_config.genesis_restart = Some(restart_params) } ChainConfig::Penumbra(_) => todo!(), @@ -609,11 +613,6 @@ impl OutputBuffer { #[cfg(test)] mod tests { - use super::{ - parse_trust_threshold, TxCreateClientCmd, TxUpdateClientCmd, TxUpgradeClientCmd, - TxUpgradeClientsCmd, - }; - use std::str::FromStr; use abscissa_core::clap::Parser; @@ -621,6 +620,11 @@ mod tests { use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use tendermint_light_client_verifier::types::TrustThreshold; + use super::{ + parse_trust_threshold, TxCreateClientCmd, TxUpdateClientCmd, TxUpgradeClientCmd, + TxUpgradeClientsCmd, + }; + #[test] fn test_parse_trust_threshold() { let threshold = parse_trust_threshold("3/5").unwrap(); diff --git a/crates/relayer-cli/src/commands/tx/connection.rs b/crates/relayer-cli/src/commands/tx/connection.rs index fb88a61d2e..89803dc16e 100644 --- a/crates/relayer-cli/src/commands/tx/connection.rs +++ b/crates/relayer-cli/src/commands/tx/connection.rs @@ -1,17 +1,14 @@ #![allow(clippy::redundant_closure_call)] -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::connection::{Connection, ConnectionSide}; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId, ConnectionId}; -use ibc_relayer_types::events::IbcEvent; -use ibc_relayer_types::timestamp::ZERO_DURATION; +use ibc_relayer_types::{ + core::ics24_host::identifier::{ChainId, ClientId, ConnectionId}, + events::IbcEvent, + timestamp::ZERO_DURATION, +}; -use crate::cli_utils::ChainHandlePair; -use crate::conclude::Output; -use crate::error::Error; -use crate::prelude::*; +use crate::{cli_utils::ChainHandlePair, conclude::Output, error::Error, prelude::*}; macro_rules! conn_open_cmd { ($dbg_string:literal, $func:ident, $self:expr, $conn:expr) => { @@ -345,13 +342,13 @@ impl Runnable for TxConnConfirmCmd { #[cfg(test)] mod tests { - use super::{TxConnAckCmd, TxConnConfirmCmd, TxConnInitCmd, TxConnTryCmd}; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId, ConnectionId}; + use super::{TxConnAckCmd, TxConnConfirmCmd, TxConnInitCmd, TxConnTryCmd}; + #[test] fn test_conn_init() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/tx/packet.rs b/crates/relayer-cli/src/commands/tx/packet.rs index 9a81666b37..bc63a045cd 100644 --- a/crates/relayer-cli/src/commands/tx/packet.rs +++ b/crates/relayer-cli/src/commands/tx/packet.rs @@ -1,19 +1,21 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer_types::core::ics02_client::height::Height; use std::ops::RangeInclusive; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::link::{Link, LinkParameters}; -use ibc_relayer::util::seq_range::parse_seq_range; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; -use ibc_relayer_types::events::IbcEvent; - -use crate::cli_utils::ChainHandlePair; -use crate::conclude::Output; -use crate::error::Error; -use crate::prelude::*; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::{ + chain::handle::ChainHandle, + link::{Link, LinkParameters}, + util::seq_range::parse_seq_range, +}; +use ibc_relayer_types::{ + core::{ + ics02_client::height::Height, + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChainId, ChannelId, PortId}, + }, + events::IbcEvent, +}; + +use crate::{cli_utils::ChainHandlePair, conclude::Output, error::Error, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct TxPacketRecvCmd { @@ -211,13 +213,13 @@ impl Runnable for TxPacketAckCmd { #[cfg(test)] mod tests { - use super::{TxPacketAckCmd, TxPacketRecvCmd}; - use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + use super::{TxPacketAckCmd, TxPacketRecvCmd}; + #[test] fn test_packet_recv_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/tx/transfer.rs b/crates/relayer-cli/src/commands/tx/transfer.rs index 66b14026ae..5f2933718a 100644 --- a/crates/relayer-cli/src/commands/tx/transfer.rs +++ b/crates/relayer-cli/src/commands/tx/transfer.rs @@ -1,9 +1,7 @@ use core::time::Duration; -use abscissa_core::clap::Parser; -use abscissa_core::{config::Override, Command, FrameworkErrorKind, Runnable}; +use abscissa_core::{clap::Parser, config::Override, Command, FrameworkErrorKind, Runnable}; use eyre::eyre; - use ibc_relayer::{ chain::handle::ChainHandle, config::Config, @@ -15,10 +13,12 @@ use ibc_relayer_types::{ core::ics24_host::identifier::{ChainId, ChannelId, PortId}, }; -use crate::cli_utils::{check_can_send_on_channel, ChainHandlePair}; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; -use crate::prelude::*; +use crate::{ + cli_utils::{check_can_send_on_channel, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct TxIcs20MsgTransferCmd { @@ -211,6 +211,9 @@ impl Runnable for TxIcs20MsgTransferCmd { #[cfg(test)] mod tests { + use std::str::FromStr; + + use abscissa_core::clap::Parser; use ibc_relayer_types::{ applications::transfer::Amount, core::ics24_host::identifier::{ChainId, ChannelId, PortId}, @@ -218,9 +221,6 @@ mod tests { use super::TxIcs20MsgTransferCmd; - use abscissa_core::clap::Parser; - use std::str::FromStr; - #[test] fn test_ft_transfer_required_only() { assert_eq!( diff --git a/crates/relayer-cli/src/commands/tx/upgrade.rs b/crates/relayer-cli/src/commands/tx/upgrade.rs index c56a60832c..a8931c6cad 100644 --- a/crates/relayer-cli/src/commands/tx/upgrade.rs +++ b/crates/relayer-cli/src/commands/tx/upgrade.rs @@ -1,16 +1,17 @@ use core::time::Duration; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use ibc_relayer::upgrade_chain::requires_legacy_upgrade_proposal; -use ibc_relayer::upgrade_chain::{build_and_send_ibc_upgrade_proposal, UpgradePlanOptions}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::upgrade_chain::{ + build_and_send_ibc_upgrade_proposal, requires_legacy_upgrade_proposal, UpgradePlanOptions, +}; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; -use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -use crate::error::Error; -use crate::prelude::*; +use crate::{ + cli_utils::spawn_chain_runtime, + conclude::{exit_with_unrecoverable_error, Output}, + error::Error, + prelude::*, +}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct TxIbcUpgradeChainCmd { @@ -153,11 +154,12 @@ impl Runnable for TxIbcUpgradeChainCmd { #[cfg(test)] mod tests { - use super::TxIbcUpgradeChainCmd; + use std::str::FromStr; use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; - use std::str::FromStr; + + use super::TxIbcUpgradeChainCmd; #[test] fn test_upgrade_chain_required_only() { diff --git a/crates/relayer-cli/src/commands/update.rs b/crates/relayer-cli/src/commands/update.rs index 351c764b0f..29967578ed 100644 --- a/crates/relayer-cli/src/commands/update.rs +++ b/crates/relayer-cli/src/commands/update.rs @@ -1,7 +1,6 @@ //! `update` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; use crate::commands::tx::client::TxUpdateClientCmd; diff --git a/crates/relayer-cli/src/commands/upgrade.rs b/crates/relayer-cli/src/commands/upgrade.rs index f69f904142..e0fa869d53 100644 --- a/crates/relayer-cli/src/commands/upgrade.rs +++ b/crates/relayer-cli/src/commands/upgrade.rs @@ -1,7 +1,6 @@ //! `upgrade` subcommand -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::{clap::Parser, Command, Runnable}; use crate::commands::tx::client::{TxUpgradeClientCmd, TxUpgradeClientsCmd}; diff --git a/crates/relayer-cli/src/commands/version.rs b/crates/relayer-cli/src/commands/version.rs index 427afd3808..270b2b0a26 100644 --- a/crates/relayer-cli/src/commands/version.rs +++ b/crates/relayer-cli/src/commands/version.rs @@ -1,8 +1,8 @@ //! `version` subcommand +use abscissa_core::{clap::Parser, Command, Runnable}; + use super::CliCmd; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; /// `version` subcommand /// diff --git a/crates/relayer-cli/src/components.rs b/crates/relayer-cli/src/components.rs index a4751e343f..91c76b216e 100644 --- a/crates/relayer-cli/src/components.rs +++ b/crates/relayer-cli/src/components.rs @@ -1,15 +1,13 @@ //! Various components for internal use by the Abscissa subsystem. use abscissa_core::{Component, FrameworkError, FrameworkErrorKind}; -use tracing_subscriber::{filter::EnvFilter, util::SubscriberInitExt, FmtSubscriber}; - use ibc_relayer::{ - config::{GlobalConfig, LogLevel}, + config::{Error, GlobalConfig, LogLevel}, util::debug_section::DebugSection, }; +use tracing_subscriber::{filter::EnvFilter, util::SubscriberInitExt, FmtSubscriber}; use crate::tracing_handle::ReloadHandle; -use ibc_relayer::config::Error; /// The name of the environment variable through which one can override /// the tracing filter built in [`build_tracing_filter`]. diff --git a/crates/relayer-cli/src/conclude.rs b/crates/relayer-cli/src/conclude.rs index 41b45d8cbb..af279e0402 100644 --- a/crates/relayer-cli/src/conclude.rs +++ b/crates/relayer-cli/src/conclude.rs @@ -55,9 +55,9 @@ //! Output::success(h).with_result(end).exit(); //! ``` -use console::style; use core::fmt; +use console::style; use serde::Serialize; use tracing::warn; diff --git a/crates/relayer-cli/src/config.rs b/crates/relayer-cli/src/config.rs index 39e5f9106d..8f58312633 100644 --- a/crates/relayer-cli/src/config.rs +++ b/crates/relayer-cli/src/config.rs @@ -1,6 +1,7 @@ -use crate::prelude::app_reader; use std::path::PathBuf; +use crate::prelude::app_reader; + /// Get the path to configuration file pub fn config_path() -> Option { let app = app_reader(); diff --git a/crates/relayer-cli/src/entry.rs b/crates/relayer-cli/src/entry.rs index 1ffa17bc3e..cdcbc41551 100644 --- a/crates/relayer-cli/src/entry.rs +++ b/crates/relayer-cli/src/entry.rs @@ -2,14 +2,11 @@ //! Definition of the entrypoint for the Hermes CLI. -use std::path::PathBuf; -use std::process; +use std::{path::PathBuf, process}; -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Configurable, FrameworkError, Runnable}; +use abscissa_core::{clap::Parser, Command, Configurable, FrameworkError, Runnable}; use clap::{IntoApp, ValueEnum}; -use ibc_relayer::config::Config; -use ibc_relayer::util::debug_section::DebugSection; +use ibc_relayer::{config::Config, util::debug_section::DebugSection}; use crate::commands::CliCmd; diff --git a/crates/relayer-cli/src/error.rs b/crates/relayer-cli/src/error.rs index a87c15a5d4..b989ccbb7b 100644 --- a/crates/relayer-cli/src/error.rs +++ b/crates/relayer-cli/src/error.rs @@ -1,26 +1,21 @@ //! All errors which can be raised from a command. -use flex_error::{define_error, DisplayError}; use std::io::Error as IoError; +use flex_error::{define_error, DisplayError}; +use ibc_relayer::{ + channel::ChannelError, connection::ConnectionError, error::Error as RelayerError, + foreign_client::ForeignClientError, keyring::errors::Error as KeyRingError, + link::error::LinkError, spawn::SpawnError, supervisor::Error as SupervisorError, + transfer::TransferError, upgrade_chain::UpgradeChainError, +}; +use ibc_relayer_types::{ + applications::ics29_fee::error::Error as FeeError, + core::{ics04_channel::channel::IdentifiedChannelEnd, ics24_host::identifier::ChainId}, + signer::SignerError, +}; use tendermint::Error as TendermintError; -use ibc_relayer_types::applications::ics29_fee::error::Error as FeeError; -use ibc_relayer_types::core::ics04_channel::channel::IdentifiedChannelEnd; -use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use ibc_relayer_types::signer::SignerError; - -use ibc_relayer::channel::ChannelError; -use ibc_relayer::connection::ConnectionError; -use ibc_relayer::error::Error as RelayerError; -use ibc_relayer::foreign_client::ForeignClientError; -use ibc_relayer::keyring::errors::Error as KeyRingError; -use ibc_relayer::link::error::LinkError; -use ibc_relayer::spawn::SpawnError; -use ibc_relayer::supervisor::Error as SupervisorError; -use ibc_relayer::transfer::TransferError; -use ibc_relayer::upgrade_chain::UpgradeChainError; - define_error! { /// An error raised within the relayer CLI Error { diff --git a/crates/relayer-cli/src/tracing_handle.rs b/crates/relayer-cli/src/tracing_handle.rs index aa70af4294..6f7ca2c8e5 100644 --- a/crates/relayer-cli/src/tracing_handle.rs +++ b/crates/relayer-cli/src/tracing_handle.rs @@ -1,12 +1,11 @@ use std::io; -use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader}; -use tokio::net::TcpListener; -use tokio::net::TcpStream; -use tracing_subscriber::filter; -use tracing_subscriber::reload::Handle; - use ibc_relayer::config::TracingServerConfig; +use tokio::{ + io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader}, + net::{TcpListener, TcpStream}, +}; +use tracing_subscriber::{filter, reload::Handle}; pub type ReloadHandle = Handle; diff --git a/crates/relayer-rest/src/handle.rs b/crates/relayer-rest/src/handle.rs index e2dd00899f..0f9f9f1f74 100644 --- a/crates/relayer-rest/src/handle.rs +++ b/crates/relayer-rest/src/handle.rs @@ -1,18 +1,16 @@ use core::fmt::Debug; -use tracing::error; - use crossbeam_channel as channel; - -use ibc_relayer::supervisor::dump_state::SupervisorState; use ibc_relayer::{ config::ChainConfig, rest::{ request::{reply_channel, ReplySender, Request, VersionInfo}, RestApiError, }, + supervisor::dump_state::SupervisorState, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use tracing::error; pub const NAME: &str = env!( "CARGO_PKG_NAME", diff --git a/crates/relayer-rest/src/server.rs b/crates/relayer-rest/src/server.rs index 4ad1d297bc..53b1bfbbaa 100644 --- a/crates/relayer-rest/src/server.rs +++ b/crates/relayer-rest/src/server.rs @@ -10,12 +10,11 @@ use axum::{ Extension, Json, Router, Server, }; use crossbeam_channel as channel; +use ibc_relayer::rest::{request::Request, RestApiError}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use serde::{Deserialize, Serialize}; use tokio::task::JoinHandle; -use ibc_relayer::rest::{request::Request, RestApiError}; - use crate::handle::{ all_chain_ids, assemble_version_info, chain_config, supervisor_state, trigger_clear_packets, }; diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index 9b1b1e530a..ebdb268144 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -1,15 +1,13 @@ use std::{fmt::Debug, str::FromStr, time::Duration}; -use serde::{de::DeserializeOwned, Deserialize, Serialize}; - use ibc_relayer::{ config::ChainConfig, rest::request::{Request, VersionInfo}, supervisor::dump_state::SupervisorState, }; -use ibc_relayer_types::core::ics24_host::identifier::ChainId; - use ibc_relayer_rest::spawn; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; enum TestResult { Success, @@ -100,7 +98,7 @@ type = 'CosmosSdk' rpc_addr = 'http://127.0.0.1:26557' grpc_addr = 'http://127.0.0.1:9091' event_source = { mode = 'push', url = 'ws://127.0.0.1:26557/websocket', batch_delay = '500ms' } -rpc_timeout = '10s' +rpc_timeout = '60s' account_prefix = 'cosmos' key_name = 'testkey' store_prefix = 'ibc' diff --git a/crates/relayer-types/src/applications/ics27_ica/cosmos_tx.rs b/crates/relayer-types/src/applications/ics27_ica/cosmos_tx.rs index f6b6043de8..4c08c6b617 100644 --- a/crates/relayer-types/src/applications/ics27_ica/cosmos_tx.rs +++ b/crates/relayer-types/src/applications/ics27_ica/cosmos_tx.rs @@ -1,12 +1,12 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::applications::interchain_accounts::v1::CosmosTx as RawCosmosTx; -use ibc_proto::Protobuf; -use serde_derive::Deserialize; -use serde_derive::Serialize; - -use crate::applications::ics27_ica::error::Error; -use crate::core::ics24_host::error::ValidationError; -use crate::tx_msg::Msg; +use ibc_proto::{ + google::protobuf::Any, ibc::applications::interchain_accounts::v1::CosmosTx as RawCosmosTx, + Protobuf, +}; +use serde_derive::{Deserialize, Serialize}; + +use crate::{ + applications::ics27_ica::error::Error, core::ics24_host::error::ValidationError, tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.applications.interchain_accounts.v1.CosmosTx"; diff --git a/crates/relayer-types/src/applications/ics27_ica/error.rs b/crates/relayer-types/src/applications/ics27_ica/error.rs index 52f2027496..5a2054421e 100644 --- a/crates/relayer-types/src/applications/ics27_ica/error.rs +++ b/crates/relayer-types/src/applications/ics27_ica/error.rs @@ -1,8 +1,7 @@ -use crate::core::ics24_host::error::ValidationError; -use crate::signer::SignerError; - use flex_error::define_error; +use crate::{core::ics24_host::error::ValidationError, signer::SignerError}; + define_error! { #[derive(Debug, PartialEq, Eq)] Error { diff --git a/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs b/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs index 9c73c9de93..7847e28c0c 100644 --- a/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs +++ b/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs @@ -1,14 +1,18 @@ +use ibc_proto::{ + ibc::applications::interchain_accounts::controller::v1::MsgRegisterInterchainAccount as RawMsgRegisterInterchainAccount, + Protobuf, +}; use serde::{Deserialize, Serialize}; -use ibc_proto::ibc::applications::interchain_accounts::controller::v1::MsgRegisterInterchainAccount as RawMsgRegisterInterchainAccount; -use ibc_proto::Protobuf; - -use crate::applications::ics27_ica::error::Error; -use crate::core::ics04_channel::version::Version; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::ConnectionId; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use crate::{ + applications::ics27_ica::error::Error, + core::{ + ics04_channel::version::Version, + ics24_host::{error::ValidationError, identifier::ConnectionId}, + }, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount"; diff --git a/crates/relayer-types/src/applications/ics27_ica/msgs/send_tx.rs b/crates/relayer-types/src/applications/ics27_ica/msgs/send_tx.rs index 72bc922a2d..939ab6072a 100644 --- a/crates/relayer-types/src/applications/ics27_ica/msgs/send_tx.rs +++ b/crates/relayer-types/src/applications/ics27_ica/msgs/send_tx.rs @@ -1,15 +1,15 @@ +use ibc_proto::{ + ibc::applications::interchain_accounts::controller::v1::MsgSendTx as RawMsgSendTx, Protobuf, +}; use serde_derive::{Deserialize, Serialize}; -use ibc_proto::ibc::applications::interchain_accounts::controller::v1::MsgSendTx as RawMsgSendTx; -use ibc_proto::Protobuf; - -use crate::applications::ics27_ica::error::Error; -use crate::applications::ics27_ica::packet_data::InterchainAccountPacketData; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::ConnectionId; -use crate::signer::Signer; -use crate::timestamp::Timestamp; -use crate::tx_msg::Msg; +use crate::{ + applications::ics27_ica::{error::Error, packet_data::InterchainAccountPacketData}, + core::ics24_host::{error::ValidationError, identifier::ConnectionId}, + signer::Signer, + timestamp::Timestamp, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx"; diff --git a/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_double_voting.rs b/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_double_voting.rs index a1ce4291d9..2f058cc01b 100644 --- a/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_double_voting.rs +++ b/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_double_voting.rs @@ -1,14 +1,13 @@ use core::fmt; -use ibc_proto::interchain_security::ccv::provider::v1::MsgSubmitConsumerDoubleVoting as RawIcsDoubleVoting; -use ibc_proto::Protobuf; +use ibc_proto::{ + interchain_security::ccv::provider::v1::MsgSubmitConsumerDoubleVoting as RawIcsDoubleVoting, + Protobuf, +}; use tendermint::evidence::DuplicateVoteEvidence; -use crate::clients::ics07_tendermint::header::Header; -use crate::signer::Signer; -use crate::tx_msg::Msg; - use super::error::Error; +use crate::{clients::ics07_tendermint::header::Header, signer::Signer, tx_msg::Msg}; pub const ICS_DOUBLE_VOTING_TYPE_URL: &str = "/interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting"; diff --git a/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_misbehaviour.rs b/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_misbehaviour.rs index 8b5c6c2750..a46bfc26ce 100644 --- a/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_misbehaviour.rs +++ b/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_misbehaviour.rs @@ -1,15 +1,13 @@ use core::fmt; +use ibc_proto::{ + interchain_security::ccv::provider::v1::MsgSubmitConsumerMisbehaviour as RawIcsMisbehaviour, + Protobuf, +}; use serde::{Deserialize, Serialize}; -use ibc_proto::interchain_security::ccv::provider::v1::MsgSubmitConsumerMisbehaviour as RawIcsMisbehaviour; -use ibc_proto::Protobuf; - -use crate::clients::ics07_tendermint::misbehaviour::Misbehaviour; -use crate::signer::Signer; -use crate::tx_msg::Msg; - use super::error::Error; +use crate::{clients::ics07_tendermint::misbehaviour::Misbehaviour, signer::Signer, tx_msg::Msg}; pub const ICS_MISBEHAVIOR_TYPE_URL: &str = "/interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour"; diff --git a/crates/relayer-types/src/applications/ics29_fee/error.rs b/crates/relayer-types/src/applications/ics29_fee/error.rs index 79ba5e1bc2..2b623c61ca 100644 --- a/crates/relayer-types/src/applications/ics29_fee/error.rs +++ b/crates/relayer-types/src/applications/ics29_fee/error.rs @@ -1,10 +1,11 @@ use flex_error::{define_error, TraceError}; use prost::EncodeError; -use crate::applications::transfer::error::Error as TransferError; -use crate::core::ics04_channel::error::Error as ChannelError; -use crate::core::ics24_host::error::ValidationError; -use crate::signer::SignerError; +use crate::{ + applications::transfer::error::Error as TransferError, + core::{ics04_channel::error::Error as ChannelError, ics24_host::error::ValidationError}, + signer::SignerError, +}; define_error! { #[derive(Debug, PartialEq, Eq)] diff --git a/crates/relayer-types/src/applications/ics29_fee/events.rs b/crates/relayer-types/src/applications/ics29_fee/events.rs index 34ea98c8c0..4e34b32e1b 100644 --- a/crates/relayer-types/src/applications/ics29_fee/events.rs +++ b/crates/relayer-types/src/applications/ics29_fee/events.rs @@ -1,16 +1,19 @@ +use std::{fmt::Display, str::FromStr}; + use itertools::Itertools; use serde_derive::{Deserialize, Serialize}; -use std::fmt::Display; -use std::str::FromStr; use tendermint::abci; use super::error::Error; -use crate::applications::transfer::coin::RawCoin; -use crate::core::ics04_channel::packet::Sequence; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; -use crate::events::IbcEventType; - -use crate::signer::Signer; +use crate::{ + applications::transfer::coin::RawCoin, + core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChannelId, PortId}, + }, + events::IbcEventType, + signer::Signer, +}; #[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)] pub struct IncentivizedPacket { diff --git a/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet.rs b/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet.rs index 80e74c04a4..8fcda126a0 100644 --- a/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet.rs +++ b/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet.rs @@ -1,12 +1,14 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::applications::fee::v1::{Fee as ProtoFee, MsgPayPacketFee}; +use ibc_proto::{ + google::protobuf::Any, + ibc::applications::fee::v1::{Fee as ProtoFee, MsgPayPacketFee}, +}; -use crate::applications::ics29_fee::error::Error; -use crate::applications::transfer::coin::RawCoin; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; - -use crate::signer::Signer; -use crate::tx_msg::encode_message; +use crate::{ + applications::{ics29_fee::error::Error, transfer::coin::RawCoin}, + core::ics24_host::identifier::{ChannelId, PortId}, + signer::Signer, + tx_msg::encode_message, +}; const TYPE_URL: &str = "/ibc.applications.fee.v1.MsgPayPacketFee"; diff --git a/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet_async.rs b/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet_async.rs index 4787f74f63..4382321734 100644 --- a/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet_async.rs +++ b/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet_async.rs @@ -1,16 +1,22 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::applications::fee::v1::{ - Fee as ProtoFee, MsgPayPacketFeeAsync, PacketFee as ProtoPacketFee, +use ibc_proto::{ + google::protobuf::Any, + ibc::{ + applications::fee::v1::{ + Fee as ProtoFee, MsgPayPacketFeeAsync, PacketFee as ProtoPacketFee, + }, + core::channel::v1::PacketId as ProtoPacketId, + }, }; -use ibc_proto::ibc::core::channel::v1::PacketId as ProtoPacketId; -use crate::applications::ics29_fee::error::Error; -use crate::applications::transfer::coin::RawCoin; -use crate::core::ics04_channel::packet::Sequence; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; - -use crate::signer::Signer; -use crate::tx_msg::encode_message; +use crate::{ + applications::{ics29_fee::error::Error, transfer::coin::RawCoin}, + core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChannelId, PortId}, + }, + signer::Signer, + tx_msg::encode_message, +}; const TYPE_URL: &str = "/ibc.applications.fee.v1.MsgPayPacketFeeAsync"; diff --git a/crates/relayer-types/src/applications/ics29_fee/msgs/register_payee.rs b/crates/relayer-types/src/applications/ics29_fee/msgs/register_payee.rs index 5ba8901471..2c70d036b9 100644 --- a/crates/relayer-types/src/applications/ics29_fee/msgs/register_payee.rs +++ b/crates/relayer-types/src/applications/ics29_fee/msgs/register_payee.rs @@ -1,11 +1,14 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::applications::fee::v1::{MsgRegisterCounterpartyPayee, MsgRegisterPayee}; - -use crate::applications::ics29_fee::error::Error; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; - -use crate::signer::Signer; -use crate::tx_msg::encode_message; +use ibc_proto::{ + google::protobuf::Any, + ibc::applications::fee::v1::{MsgRegisterCounterpartyPayee, MsgRegisterPayee}, +}; + +use crate::{ + applications::ics29_fee::error::Error, + core::ics24_host::identifier::{ChannelId, PortId}, + signer::Signer, + tx_msg::encode_message, +}; pub fn build_register_counterparty_payee_message( address: &Signer, diff --git a/crates/relayer-types/src/applications/ics29_fee/packet_fee.rs b/crates/relayer-types/src/applications/ics29_fee/packet_fee.rs index 366ecba740..d27ede7931 100644 --- a/crates/relayer-types/src/applications/ics29_fee/packet_fee.rs +++ b/crates/relayer-types/src/applications/ics29_fee/packet_fee.rs @@ -1,15 +1,19 @@ -use ibc_proto::cosmos::base::v1beta1::Coin as ProtoCoin; -use ibc_proto::ibc::applications::fee::v1::{ - Fee as ProtoFee, IdentifiedPacketFees as ProtoIdentifiedPacketFees, PacketFee as ProtoPacketFee, -}; use std::str::FromStr; -use super::error::Error; -use crate::applications::transfer::amount::Amount; -use crate::applications::transfer::coin::RawCoin; -use crate::core::ics04_channel::packet_id::PacketId; +use ibc_proto::{ + cosmos::base::v1beta1::Coin as ProtoCoin, + ibc::applications::fee::v1::{ + Fee as ProtoFee, IdentifiedPacketFees as ProtoIdentifiedPacketFees, + PacketFee as ProtoPacketFee, + }, +}; -use crate::signer::Signer; +use super::error::Error; +use crate::{ + applications::transfer::{amount::Amount, coin::RawCoin}, + core::ics04_channel::packet_id::PacketId, + signer::Signer, +}; /// The core type that encodes the different fees that are redeemable by relayers for relaying /// different types of packets. diff --git a/crates/relayer-types/src/applications/ics31_icq/error.rs b/crates/relayer-types/src/applications/ics31_icq/error.rs index 32251625af..3fe78b0ef9 100644 --- a/crates/relayer-types/src/applications/ics31_icq/error.rs +++ b/crates/relayer-types/src/applications/ics31_icq/error.rs @@ -1,7 +1,7 @@ -use crate::core::ics24_host::error::ValidationError as Ics24ValidationError; +use flex_error::define_error; use tendermint::error::Error as TendermintError; -use flex_error::define_error; +use crate::core::ics24_host::error::ValidationError as Ics24ValidationError; define_error! { Error { diff --git a/crates/relayer-types/src/applications/ics31_icq/events.rs b/crates/relayer-types/src/applications/ics31_icq/events.rs index 739fecedba..07c0f8ba94 100644 --- a/crates/relayer-types/src/applications/ics31_icq/events.rs +++ b/crates/relayer-types/src/applications/ics31_icq/events.rs @@ -1,13 +1,13 @@ -use std::collections::BTreeMap; -use std::str::FromStr; +use std::{collections::BTreeMap, str::FromStr}; use serde::{Deserialize, Serialize}; use tendermint::{abci, block::Height}; -use crate::core::ics24_host::identifier::{ChainId, ConnectionId}; -use crate::events::IbcEvent; - use super::error::Error; +use crate::{ + core::ics24_host::identifier::{ChainId, ConnectionId}, + events::IbcEvent, +}; const EVENT_TYPE_PREFIX: &str = "query_request"; diff --git a/crates/relayer-types/src/applications/ics31_icq/response.rs b/crates/relayer-types/src/applications/ics31_icq/response.rs index 98b45acf06..6abdaeb18a 100644 --- a/crates/relayer-types/src/applications/ics31_icq/response.rs +++ b/crates/relayer-types/src/applications/ics31_icq/response.rs @@ -1,11 +1,9 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::stride::interchainquery::v1::MsgSubmitQueryResponse; +use ibc_proto::{google::protobuf::Any, stride::interchainquery::v1::MsgSubmitQueryResponse}; use prost::Message; use tendermint::merkle::proof::ProofOps as TendermintProofOps; use tendermint_proto::crypto::{ProofOp, ProofOps}; -use crate::applications::ics31_icq::error::Error; -use crate::signer::Signer; +use crate::{applications::ics31_icq::error::Error, signer::Signer}; pub const TYPE_URL: &str = "/stride.interchainquery.v1.MsgSubmitQueryResponse"; diff --git a/crates/relayer-types/src/applications/transfer/amount.rs b/crates/relayer-types/src/applications/transfer/amount.rs index ff52510a8e..ce9446c511 100644 --- a/crates/relayer-types/src/applications/transfer/amount.rs +++ b/crates/relayer-types/src/applications/transfer/amount.rs @@ -1,8 +1,7 @@ +use std::{iter::Sum, ops::Add, str::FromStr}; + use derive_more::{Display, From, Into}; use serde::{Deserialize, Serialize}; -use std::iter::Sum; -use std::ops::Add; -use std::str::FromStr; use super::error::Error; use crate::bigint::U256; diff --git a/crates/relayer-types/src/applications/transfer/coin.rs b/crates/relayer-types/src/applications/transfer/coin.rs index 5319ea301a..90ef36df93 100644 --- a/crates/relayer-types/src/applications/transfer/coin.rs +++ b/crates/relayer-types/src/applications/transfer/coin.rs @@ -1,17 +1,19 @@ -use std::fmt::{Display, Error as FmtError, Formatter}; -use std::str::FromStr; +use std::{ + fmt::{Display, Error as FmtError, Formatter}, + str::FromStr, +}; +use ibc_proto::cosmos::base::v1beta1::Coin as ProtoCoin; use regex::Regex; use serde::{Deserialize, Serialize}; -use ibc_proto::cosmos::base::v1beta1::Coin as ProtoCoin; - +use super::{ + amount::Amount, + denom::{BaseDenom, PrefixedDenom}, + error::Error, +}; use crate::serializers::serde_string; -use super::amount::Amount; -use super::denom::{BaseDenom, PrefixedDenom}; -use super::error::Error; - /// A `Coin` type with fully qualified `PrefixedDenom`. pub type PrefixedCoin = Coin; diff --git a/crates/relayer-types/src/applications/transfer/denom.rs b/crates/relayer-types/src/applications/transfer/denom.rs index 35a5e572b1..d74701c048 100644 --- a/crates/relayer-types/src/applications/transfer/denom.rs +++ b/crates/relayer-types/src/applications/transfer/denom.rs @@ -1,13 +1,17 @@ -use std::fmt::{Display, Error as FmtError, Formatter}; -use std::str::FromStr; +use std::{ + fmt::{Display, Error as FmtError, Formatter}, + str::FromStr, +}; use derive_more::{Display, From}; use ibc_proto::ibc::applications::transfer::v1::DenomTrace as RawDenomTrace; use serde::{Deserialize, Serialize}; use super::error::Error; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; -use crate::serializers::serde_string; +use crate::{ + core::ics24_host::identifier::{ChannelId, PortId}, + serializers::serde_string, +}; /// Base denomination type #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize, Display)] diff --git a/crates/relayer-types/src/applications/transfer/error.rs b/crates/relayer-types/src/applications/transfer/error.rs index f0e52d946d..4e9fc8577e 100644 --- a/crates/relayer-types/src/applications/transfer/error.rs +++ b/crates/relayer-types/src/applications/transfer/error.rs @@ -1,18 +1,20 @@ -use std::convert::Infallible; -use std::str::Utf8Error; -use std::string::FromUtf8Error; +use std::{convert::Infallible, str::Utf8Error, string::FromUtf8Error}; use flex_error::{define_error, DisplayOnly, TraceError}; use subtle_encoding::Error as EncodingError; use tendermint_proto::Error as TendermintProtoError; use uint::FromDecStrErr; -use crate::core::ics04_channel::channel::Ordering; -use crate::core::ics04_channel::error as channel_error; -use crate::core::ics04_channel::version::Version; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; -use crate::signer::SignerError; +use crate::{ + core::{ + ics04_channel::{channel::Ordering, error as channel_error, version::Version}, + ics24_host::{ + error::ValidationError, + identifier::{ChannelId, PortId}, + }, + }, + signer::SignerError, +}; define_error! { #[derive(Debug, PartialEq, Eq)] diff --git a/crates/relayer-types/src/applications/transfer/events.rs b/crates/relayer-types/src/applications/transfer/events.rs index 4f16e5297a..51a83a44b7 100644 --- a/crates/relayer-types/src/applications/transfer/events.rs +++ b/crates/relayer-types/src/applications/transfer/events.rs @@ -1,8 +1,10 @@ -use crate::applications::transfer::acknowledgement::Acknowledgement; -use crate::applications::transfer::{Amount, PrefixedDenom, MODULE_ID_STR}; -use crate::events::ModuleEvent; - -use crate::signer::Signer; +use crate::{ + applications::transfer::{ + acknowledgement::Acknowledgement, Amount, PrefixedDenom, MODULE_ID_STR, + }, + events::ModuleEvent, + signer::Signer, +}; const EVENT_TYPE_PACKET: &str = "fungible_token_packet"; const EVENT_TYPE_TIMEOUT: &str = "timeout"; diff --git a/crates/relayer-types/src/applications/transfer/msgs/mod.rs b/crates/relayer-types/src/applications/transfer/msgs/mod.rs index b3caa7e353..f621d83924 100644 --- a/crates/relayer-types/src/applications/transfer/msgs/mod.rs +++ b/crates/relayer-types/src/applications/transfer/msgs/mod.rs @@ -1,2 +1,4 @@ pub mod send; pub mod transfer; + +pub const ASTRIA_WITHDRAWAL_TYPE_URL: &str = "/astria.sequencer.v1alpha1.Ics20Withdrawal"; diff --git a/crates/relayer-types/src/applications/transfer/msgs/send.rs b/crates/relayer-types/src/applications/transfer/msgs/send.rs index 36e71dc66b..599e228aa1 100644 --- a/crates/relayer-types/src/applications/transfer/msgs/send.rs +++ b/crates/relayer-types/src/applications/transfer/msgs/send.rs @@ -1,16 +1,13 @@ -use std::fmt::Display; -use std::str::FromStr; +use std::{fmt::Display, str::FromStr}; -use ibc_proto::Protobuf; -use serde_derive::Deserialize; -use serde_derive::Serialize; +use ibc_proto::{cosmos::bank::v1beta1::MsgSend as RawMsgSend, Protobuf}; +use serde_derive::{Deserialize, Serialize}; -use ibc_proto::cosmos::bank::v1beta1::MsgSend as RawMsgSend; - -use crate::applications::transfer::error::Error; -use crate::applications::transfer::Coin; -use crate::core::ics24_host::error::ValidationError; -use crate::tx_msg::Msg; +use crate::{ + applications::transfer::{error::Error, Coin}, + core::ics24_host::error::ValidationError, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/cosmos.bank.v1beta1.MsgSend"; diff --git a/crates/relayer-types/src/applications/transfer/msgs/transfer.rs b/crates/relayer-types/src/applications/transfer/msgs/transfer.rs index 8bfc198b44..63ee23ad08 100644 --- a/crates/relayer-types/src/applications/transfer/msgs/transfer.rs +++ b/crates/relayer-types/src/applications/transfer/msgs/transfer.rs @@ -1,16 +1,20 @@ //! This is the definition of a transfer messages that an application submits to a chain. -use ibc_proto::cosmos::base::v1beta1::Coin; -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::applications::transfer::v1::MsgTransfer as RawMsgTransfer; -use ibc_proto::Protobuf; - -use crate::applications::transfer::error::Error; -use crate::core::ics04_channel::timeout::TimeoutHeight; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; -use crate::signer::Signer; -use crate::timestamp::Timestamp; -use crate::tx_msg::Msg; +use ibc_proto::{ + cosmos::base::v1beta1::Coin, google::protobuf::Any, + ibc::applications::transfer::v1::MsgTransfer as RawMsgTransfer, Protobuf, +}; + +use crate::{ + applications::transfer::error::Error, + core::{ + ics04_channel::timeout::TimeoutHeight, + ics24_host::identifier::{ChannelId, PortId}, + }, + signer::Signer, + timestamp::Timestamp, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.applications.transfer.v1.MsgTransfer"; @@ -129,19 +133,20 @@ impl From for Any { #[cfg(test)] pub mod test_util { - use core::ops::Add; - use core::time::Duration; + use core::{ops::Add, time::Duration}; use super::MsgTransfer; - use crate::applications::transfer::packet::PacketData; - use crate::applications::transfer::Coin; - use crate::bigint::U256; - use crate::core::ics04_channel::packet::{Packet, Sequence}; - use crate::core::ics04_channel::timeout::TimeoutHeight; - use crate::signer::Signer; use crate::{ - applications::transfer::{BaseCoin, PrefixedCoin}, - core::ics24_host::identifier::{ChannelId, PortId}, + applications::transfer::{packet::PacketData, BaseCoin, Coin, PrefixedCoin}, + bigint::U256, + core::{ + ics04_channel::{ + packet::{Packet, Sequence}, + timeout::TimeoutHeight, + }, + ics24_host::identifier::{ChannelId, PortId}, + }, + signer::Signer, test_utils::get_dummy_bech32_account, timestamp::Timestamp, }; diff --git a/crates/relayer-types/src/applications/transfer/packet.rs b/crates/relayer-types/src/applications/transfer/packet.rs index c467542fe4..ff93868dff 100644 --- a/crates/relayer-types/src/applications/transfer/packet.rs +++ b/crates/relayer-types/src/applications/transfer/packet.rs @@ -1,12 +1,13 @@ -use std::convert::TryFrom; -use std::str::FromStr; -use std::string::{String, ToString}; +use std::{ + convert::TryFrom, + str::FromStr, + string::{String, ToString}, +}; use ibc_proto::ibc::applications::transfer::v2::FungibleTokenPacketData as RawPacketData; use serde::{Deserialize, Serialize}; -use super::error::Error; -use super::{Amount, PrefixedCoin, PrefixedDenom}; +use super::{error::Error, Amount, PrefixedCoin, PrefixedDenom}; use crate::signer::Signer; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs index 9ca7c7e233..2eeb46fadb 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs @@ -1,26 +1,33 @@ -use std::convert::{TryFrom, TryInto}; -use std::time::Duration; - +use std::{ + convert::{TryFrom, TryInto}, + time::Duration, +}; + +use ibc_proto::{ + google::protobuf::Any, + ibc::{ + core::client::v1::Height as RawHeight, + lightclients::tendermint::v1::ClientState as RawTmClientState, + }, + Protobuf, +}; use prost::Message; use serde::{Deserialize, Serialize}; - -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::core::client::v1::Height as RawHeight; -use ibc_proto::ibc::lightclients::tendermint::v1::ClientState as RawTmClientState; -use ibc_proto::Protobuf; - use tendermint_light_client_verifier::options::Options; -use crate::clients::ics07_tendermint::error::Error; -use crate::clients::ics07_tendermint::header::Header as TmHeader; -use crate::core::ics02_client::client_state::ClientState as Ics2ClientState; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::error::Error as Ics02Error; -use crate::core::ics02_client::trust_threshold::TrustThreshold; -use crate::core::ics23_commitment::specs::ProofSpecs; -use crate::core::ics24_host::identifier::ChainId; -use crate::timestamp::{Timestamp, ZERO_DURATION}; -use crate::Height; +use crate::{ + clients::ics07_tendermint::{error::Error, header::Header as TmHeader}, + core::{ + ics02_client::{ + client_state::ClientState as Ics2ClientState, client_type::ClientType, + error::Error as Ics02Error, trust_threshold::TrustThreshold, + }, + ics23_commitment::specs::ProofSpecs, + ics24_host::identifier::ChainId, + }, + timestamp::{Timestamp, ZERO_DURATION}, + Height, +}; pub const TENDERMINT_CLIENT_STATE_TYPE_URL: &str = "/ibc.lightclients.tendermint.v1.ClientState"; @@ -326,9 +333,10 @@ impl TryFrom for ClientState { type Error = Ics02Error; fn try_from(raw: Any) -> Result { - use bytes::Buf; use core::ops::Deref; + use bytes::Buf; + fn decode_client_state(buf: B) -> Result { RawTmClientState::decode(buf) .map_err(Error::decode)? @@ -359,19 +367,22 @@ impl From for Any { #[cfg(test)] mod tests { - use crate::Height; use core::time::Duration; - use test_log::test; use ibc_proto::ics23::ProofSpec as Ics23ProofSpec; use tendermint_rpc::endpoint::abci_query::AbciQuery; + use test_log::test; - use crate::clients::ics07_tendermint::client_state::{AllowUpdate, ClientState}; - use crate::core::ics02_client::trust_threshold::TrustThreshold; - use crate::core::ics23_commitment::specs::ProofSpecs; - use crate::core::ics24_host::identifier::ChainId; - use crate::test::test_serialization_roundtrip; - use crate::timestamp::{Timestamp, ZERO_DURATION}; + use crate::{ + clients::ics07_tendermint::client_state::{AllowUpdate, ClientState}, + core::{ + ics02_client::trust_threshold::TrustThreshold, ics23_commitment::specs::ProofSpecs, + ics24_host::identifier::ChainId, + }, + test::test_serialization_roundtrip, + timestamp::{Timestamp, ZERO_DURATION}, + Height, + }; #[derive(Clone, Debug, PartialEq)] struct ClientStateParams { @@ -667,9 +678,10 @@ pub mod test_util { use tendermint::block::Header; - use crate::clients::ics07_tendermint::client_state::{AllowUpdate, ClientState}; - use crate::core::ics02_client::height::Height; - use crate::core::ics24_host::identifier::ChainId; + use crate::{ + clients::ics07_tendermint::client_state::{AllowUpdate, ClientState}, + core::{ics02_client::height::Height, ics24_host::identifier::ChainId}, + }; pub fn get_dummy_tendermint_client_state(tm_header: Header) -> ClientState { ClientState::new( diff --git a/crates/relayer-types/src/clients/ics07_tendermint/consensus_state.rs b/crates/relayer-types/src/clients/ics07_tendermint/consensus_state.rs index 5cbd77732b..67087c5910 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/consensus_state.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/consensus_state.rs @@ -1,16 +1,19 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::lightclients::tendermint::v1::ConsensusState as RawConsensusState; -use ibc_proto::Protobuf; +use ibc_proto::{ + google::protobuf::Any, ibc::lightclients::tendermint::v1::ConsensusState as RawConsensusState, + Protobuf, +}; use serde::{Deserialize, Serialize}; use tendermint::{hash::Algorithm, time::Time, Hash}; use tendermint_proto::google::protobuf as tpb; -use crate::clients::ics07_tendermint::error::Error; -use crate::clients::ics07_tendermint::header::Header; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::error::Error as Ics02Error; -use crate::core::ics23_commitment::commitment::CommitmentRoot; -use crate::timestamp::Timestamp; +use crate::{ + clients::ics07_tendermint::{error::Error, header::Header}, + core::{ + ics02_client::{client_type::ClientType, error::Error as Ics02Error}, + ics23_commitment::commitment::CommitmentRoot, + }, + timestamp::Timestamp, +}; pub const TENDERMINT_CONSENSUS_STATE_TYPE_URL: &str = "/ibc.lightclients.tendermint.v1.ConsensusState"; @@ -100,8 +103,9 @@ impl TryFrom for ConsensusState { type Error = Ics02Error; fn try_from(raw: Any) -> Result { - use bytes::Buf; use core::ops::Deref; + + use bytes::Buf; use prost::Message; fn decode_consensus_state(buf: B) -> Result { diff --git a/crates/relayer-types/src/clients/ics07_tendermint/error.rs b/crates/relayer-types/src/clients/ics07_tendermint/error.rs index d56731a8b3..6cfb85a1bc 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/error.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/error.rs @@ -1,16 +1,16 @@ use flex_error::{define_error, TraceError}; - -use crate::core::ics02_client::error::Error as Ics02Error; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::ClientId; -use crate::timestamp::{Timestamp, TimestampOverflowError}; - -use crate::Height; -use tendermint::account::Id; -use tendermint::hash::Hash; -use tendermint::Error as TendermintError; +use tendermint::{account::Id, hash::Hash, Error as TendermintError}; use tendermint_light_client_verifier::errors::VerificationErrorDetail as LightClientErrorDetail; +use crate::{ + core::{ + ics02_client::error::Error as Ics02Error, + ics24_host::{error::ValidationError, identifier::ClientId}, + }, + timestamp::{Timestamp, TimestampOverflowError}, + Height, +}; + define_error! { #[derive(Debug, PartialEq, Eq)] Error { diff --git a/crates/relayer-types/src/clients/ics07_tendermint/header.rs b/crates/relayer-types/src/clients/ics07_tendermint/header.rs index 57b99db1e9..1734e7d56e 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/header.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/header.rs @@ -1,21 +1,23 @@ use std::fmt::{Display, Error as FmtError, Formatter}; use bytes::Buf; -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::lightclients::tendermint::v1::Header as RawHeader; -use ibc_proto::Protobuf; +use ibc_proto::{ + google::protobuf::Any, ibc::lightclients::tendermint::v1::Header as RawHeader, Protobuf, +}; use prost::Message; use serde_derive::{Deserialize, Serialize}; -use tendermint::block::signed_header::SignedHeader; -use tendermint::validator::Set as ValidatorSet; - -use crate::clients::ics07_tendermint::error::Error; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::error::Error as Ics02Error; -use crate::core::ics24_host::identifier::ChainId; -use crate::timestamp::Timestamp; -use crate::utils::pretty::{PrettySignedHeader, PrettyValidatorSet}; -use crate::Height; +use tendermint::{block::signed_header::SignedHeader, validator::Set as ValidatorSet}; + +use crate::{ + clients::ics07_tendermint::error::Error, + core::{ + ics02_client::{client_type::ClientType, error::Error as Ics02Error}, + ics24_host::identifier::ChainId, + }, + timestamp::Timestamp, + utils::pretty::{PrettySignedHeader, PrettyValidatorSet}, + Height, +}; pub const TENDERMINT_HEADER_TYPE_URL: &str = "/ibc.lightclients.tendermint.v1.Header"; @@ -151,13 +153,13 @@ impl From
for RawHeader { pub mod test_util { use subtle_encoding::hex; - use tendermint::block::signed_header::SignedHeader; - use tendermint::validator::Info as ValidatorInfo; - use tendermint::validator::Set as ValidatorSet; - use tendermint::PublicKey; + use tendermint::{ + block::signed_header::SignedHeader, + validator::{Info as ValidatorInfo, Set as ValidatorSet}, + PublicKey, + }; - use crate::clients::ics07_tendermint::header::Header; - use crate::Height; + use crate::{clients::ics07_tendermint::header::Header, Height}; pub fn get_dummy_tendermint_header() -> tendermint::block::Header { serde_json::from_str::(include_str!( diff --git a/crates/relayer-types/src/clients/ics07_tendermint/misbehaviour.rs b/crates/relayer-types/src/clients/ics07_tendermint/misbehaviour.rs index 1336e160bf..d01f3f33cc 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/misbehaviour.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/misbehaviour.rs @@ -1,12 +1,12 @@ -use ibc_proto::ibc::lightclients::tendermint::v1::Misbehaviour as RawMisbehaviour; -use ibc_proto::Protobuf; +use ibc_proto::{ibc::lightclients::tendermint::v1::Misbehaviour as RawMisbehaviour, Protobuf}; use serde::{Deserialize, Serialize}; -use crate::clients::ics07_tendermint::error::Error; -use crate::clients::ics07_tendermint::header::Header; -use crate::core::ics24_host::identifier::ClientId; -use crate::tx_msg::Msg; -use crate::Height; +use crate::{ + clients::ics07_tendermint::{error::Error, header::Header}, + core::ics24_host::identifier::ClientId, + tx_msg::Msg, + Height, +}; pub const TENDERMINT_MISBEHAVIOR_TYPE_URL: &str = "/ibc.lightclients.tendermint.v1.Misbehaviour"; diff --git a/crates/relayer-types/src/core/ics02_client/client_state.rs b/crates/relayer-types/src/core/ics02_client/client_state.rs index 007bc19e17..814922861b 100644 --- a/crates/relayer-types/src/core/ics02_client/client_state.rs +++ b/crates/relayer-types/src/core/ics02_client/client_state.rs @@ -1,11 +1,13 @@ use core::fmt::Debug; -use std::marker::{Send, Sync}; -use std::time::Duration; - -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics24_host::identifier::ChainId; - -use crate::Height; +use std::{ + marker::{Send, Sync}, + time::Duration, +}; + +use crate::{ + core::{ics02_client::client_type::ClientType, ics24_host::identifier::ChainId}, + Height, +}; pub trait ClientState: Clone + Debug + Send + Sync // Any: From, { diff --git a/crates/relayer-types/src/core/ics02_client/client_type.rs b/crates/relayer-types/src/core/ics02_client/client_type.rs index a35e44604d..67054ef349 100644 --- a/crates/relayer-types/src/core/ics02_client/client_type.rs +++ b/crates/relayer-types/src/core/ics02_client/client_type.rs @@ -1,6 +1,7 @@ -use serde_derive::{Deserialize, Serialize}; use std::fmt::{Display, Error as FmtError, Formatter}; +use serde_derive::{Deserialize, Serialize}; + use super::error::Error; /// Type of the client, depending on the specific consensus algorithm. @@ -53,6 +54,7 @@ impl core::str::FromStr for ClientType { #[cfg(test)] mod tests { use core::str::FromStr; + use test_log::test; use super::ClientType; diff --git a/crates/relayer-types/src/core/ics02_client/consensus_state.rs b/crates/relayer-types/src/core/ics02_client/consensus_state.rs index fc544f800d..6211e442f9 100644 --- a/crates/relayer-types/src/core/ics02_client/consensus_state.rs +++ b/crates/relayer-types/src/core/ics02_client/consensus_state.rs @@ -1,9 +1,12 @@ -use core::fmt::Debug; -use core::marker::{Send, Sync}; +use core::{ + fmt::Debug, + marker::{Send, Sync}, +}; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics23_commitment::commitment::CommitmentRoot; -use crate::timestamp::Timestamp; +use crate::{ + core::{ics02_client::client_type::ClientType, ics23_commitment::commitment::CommitmentRoot}, + timestamp::Timestamp, +}; /// Abstract of consensus state information used by the validity predicate /// to verify new commits & state roots. diff --git a/crates/relayer-types/src/core/ics02_client/error.rs b/crates/relayer-types/src/core/ics02_client/error.rs index 094a883aa6..43fcc611ef 100644 --- a/crates/relayer-types/src/core/ics02_client/error.rs +++ b/crates/relayer-types/src/core/ics02_client/error.rs @@ -1,14 +1,16 @@ use flex_error::{define_error, TraceError}; use tendermint_proto::Error as TendermintProtoError; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::height::HeightError; -use crate::core::ics23_commitment::error::Error as Ics23Error; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::ClientId; -use crate::signer::SignerError; -use crate::timestamp::Timestamp; -use crate::Height; +use crate::{ + core::{ + ics02_client::{client_type::ClientType, height::HeightError}, + ics23_commitment::error::Error as Ics23Error, + ics24_host::{error::ValidationError, identifier::ClientId}, + }, + signer::SignerError, + timestamp::Timestamp, + Height, +}; define_error! { #[derive(Debug, PartialEq, Eq)] diff --git a/crates/relayer-types/src/core/ics02_client/events.rs b/crates/relayer-types/src/core/ics02_client/events.rs index 3abe9b7b8d..6605b2534a 100644 --- a/crates/relayer-types/src/core/ics02_client/events.rs +++ b/crates/relayer-types/src/core/ics02_client/events.rs @@ -1,15 +1,19 @@ //! Types for the IBC events emitted from Tendermint Websocket by the client module. -use serde_derive::{Deserialize, Serialize}; use std::fmt::{Display, Error as FmtError, Formatter}; + +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; use tendermint_proto::Protobuf; use super::header::AnyHeader; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::height::Height; -use crate::core::ics24_host::identifier::ClientId; -use crate::events::{IbcEvent, IbcEventType}; +use crate::{ + core::{ + ics02_client::{client_type::ClientType, height::Height}, + ics24_host::identifier::ClientId, + }, + events::{IbcEvent, IbcEventType}, +}; /// The content of the `key` field for the attribute containing the client identifier. pub const CLIENT_ID_ATTRIBUTE_KEY: &str = "client_id"; diff --git a/crates/relayer-types/src/core/ics02_client/header.rs b/crates/relayer-types/src/core/ics02_client/header.rs index e238fe1d96..9692a5f8f4 100644 --- a/crates/relayer-types/src/core/ics02_client/header.rs +++ b/crates/relayer-types/src/core/ics02_client/header.rs @@ -1,17 +1,16 @@ use core::fmt::Debug; +use ibc_proto::{google::protobuf::Any, Protobuf}; use serde::{Deserialize, Serialize}; -use ibc_proto::google::protobuf::Any; -use ibc_proto::Protobuf; - -use crate::clients::ics07_tendermint::header::{ - decode_header as tm_decode_header, Header as TendermintHeader, TENDERMINT_HEADER_TYPE_URL, +use crate::{ + clients::ics07_tendermint::header::{ + decode_header as tm_decode_header, Header as TendermintHeader, TENDERMINT_HEADER_TYPE_URL, + }, + core::ics02_client::{client_type::ClientType, error::Error}, + timestamp::Timestamp, + Height, }; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::error::Error; -use crate::timestamp::Timestamp; -use crate::Height; /// Abstract of consensus state update information pub trait Header: Debug + Send + Sync // Any: From, diff --git a/crates/relayer-types/src/core/ics02_client/height.rs b/crates/relayer-types/src/core/ics02_client/height.rs index 4563333244..6fb3de355b 100644 --- a/crates/relayer-types/src/core/ics02_client/height.rs +++ b/crates/relayer-types/src/core/ics02_client/height.rs @@ -1,15 +1,10 @@ -use std::cmp::Ordering; -use std::num::ParseIntError; -use std::str::FromStr; +use std::{cmp::Ordering, num::ParseIntError, str::FromStr}; use flex_error::{define_error, TraceError}; -use ibc_proto::Protobuf; +use ibc_proto::{ibc::core::client::v1::Height as RawHeight, Protobuf}; use serde_derive::{Deserialize, Serialize}; -use ibc_proto::ibc::core::client::v1::Height as RawHeight; - -use crate::core::ics02_client::error::Error; -use crate::core::ics24_host::identifier::ChainId; +use crate::core::{ics02_client::error::Error, ics24_host::identifier::ChainId}; #[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Height { diff --git a/crates/relayer-types/src/core/ics02_client/misbehaviour.rs b/crates/relayer-types/src/core/ics02_client/misbehaviour.rs index 21b296ec29..ca1d30711a 100644 --- a/crates/relayer-types/src/core/ics02_client/misbehaviour.rs +++ b/crates/relayer-types/src/core/ics02_client/misbehaviour.rs @@ -1,7 +1,6 @@ use core::fmt::Debug; -use crate::core::ics24_host::identifier::ClientId; -use crate::Height; +use crate::{core::ics24_host::identifier::ClientId, Height}; pub trait Misbehaviour: Clone + Debug + Send + Sync { /// The type of client (eg. Tendermint) diff --git a/crates/relayer-types/src/core/ics02_client/msgs.rs b/crates/relayer-types/src/core/ics02_client/msgs.rs index ac28763ee5..fc13f07445 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs.rs @@ -4,10 +4,10 @@ //! subsequently calls into the chain-specific (e.g., ICS 07) client handler. See: //! . -use crate::core::ics02_client::msgs::create_client::MsgCreateClient; -use crate::core::ics02_client::msgs::misbehaviour::MsgSubmitMisbehaviour; -use crate::core::ics02_client::msgs::update_client::MsgUpdateClient; -use crate::core::ics02_client::msgs::upgrade_client::MsgUpgradeClient; +use crate::core::ics02_client::msgs::{ + create_client::MsgCreateClient, misbehaviour::MsgSubmitMisbehaviour, + update_client::MsgUpdateClient, upgrade_client::MsgUpgradeClient, +}; pub mod create_client; pub mod misbehaviour; diff --git a/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs index 078bce2d31..208ba6a7d2 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs @@ -1,12 +1,10 @@ //! Definition of domain type message `MsgCreateClient`. -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::core::client::v1::MsgCreateClient as RawMsgCreateClient; -use ibc_proto::Protobuf; +use ibc_proto::{ + google::protobuf::Any, ibc::core::client::v1::MsgCreateClient as RawMsgCreateClient, Protobuf, +}; -use crate::core::ics02_client::error::Error; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use crate::{core::ics02_client::error::Error, signer::Signer, tx_msg::Msg}; pub const TYPE_URL: &str = "/ibc.core.client.v1.MsgCreateClient"; @@ -76,15 +74,18 @@ impl From for RawMsgCreateClient { #[cfg(test)] mod tests { - use test_log::test; - use ibc_proto::ibc::core::client::v1::MsgCreateClient as RawMsgCreateClient; + use test_log::test; - use crate::clients::ics07_tendermint::client_state::test_util::get_dummy_tendermint_client_state; - use crate::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState; - use crate::clients::ics07_tendermint::header::test_util::get_dummy_tendermint_header; - use crate::core::ics02_client::msgs::create_client::MsgCreateClient; - use crate::test_utils::get_dummy_account_id; + use crate::{ + clients::ics07_tendermint::{ + client_state::test_util::get_dummy_tendermint_client_state, + consensus_state::ConsensusState as TmConsensusState, + header::test_util::get_dummy_tendermint_header, + }, + core::ics02_client::msgs::create_client::MsgCreateClient, + test_utils::get_dummy_account_id, + }; #[test] fn msg_create_client_serialization() { diff --git a/crates/relayer-types/src/core/ics02_client/msgs/misbehaviour.rs b/crates/relayer-types/src/core/ics02_client/msgs/misbehaviour.rs index ae7156a834..bd09549019 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/misbehaviour.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/misbehaviour.rs @@ -1,11 +1,13 @@ -use ibc_proto::google::protobuf::Any as ProtoAny; -use ibc_proto::ibc::core::client::v1::MsgSubmitMisbehaviour as RawMsgSubmitMisbehaviour; -use ibc_proto::Protobuf; +use ibc_proto::{ + google::protobuf::Any as ProtoAny, + ibc::core::client::v1::MsgSubmitMisbehaviour as RawMsgSubmitMisbehaviour, Protobuf, +}; -use crate::core::ics02_client::error::Error; -use crate::core::ics24_host::identifier::ClientId; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use crate::{ + core::{ics02_client::error::Error, ics24_host::identifier::ClientId}, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.client.v1.MsgSubmitMisbehaviour"; diff --git a/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs index e5966b7b7c..e8ad51e1ef 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs @@ -1,14 +1,17 @@ //! Definition of domain type message `MsgUpdateAnyClient`. -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::core::client::v1::MsgUpdateClient as RawMsgUpdateClient; -use ibc_proto::Protobuf; - -use crate::core::ics02_client::error::Error; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::ClientId; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use ibc_proto::{ + google::protobuf::Any, ibc::core::client::v1::MsgUpdateClient as RawMsgUpdateClient, Protobuf, +}; + +use crate::{ + core::{ + ics02_client::error::Error, + ics24_host::{error::ValidationError, identifier::ClientId}, + }, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.client.v1.MsgUpdateClient"; @@ -73,14 +76,14 @@ impl From for RawMsgUpdateClient { #[cfg(test)] mod tests { - use test_log::test; - use ibc_proto::ibc::core::client::v1::MsgUpdateClient as RawMsgUpdateClient; + use test_log::test; - use crate::clients::ics07_tendermint::header::test_util::get_dummy_ics07_header; - use crate::core::ics02_client::msgs::MsgUpdateClient; - use crate::core::ics24_host::identifier::ClientId; - use crate::test_utils::get_dummy_account_id; + use crate::{ + clients::ics07_tendermint::header::test_util::get_dummy_ics07_header, + core::{ics02_client::msgs::MsgUpdateClient, ics24_host::identifier::ClientId}, + test_utils::get_dummy_account_id, + }; #[test] fn msg_update_client_serialization() { diff --git a/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs index 20fcf6ccc3..b0b50a0f0f 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs @@ -2,17 +2,24 @@ use std::str::FromStr; -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::core::client::v1::MsgUpgradeClient as RawMsgUpgradeClient; -use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof; -use ibc_proto::Protobuf; - -use crate::core::ics02_client::error::Error; -use crate::core::ics23_commitment::commitment::CommitmentProofBytes; -use crate::core::ics23_commitment::error::Error as Ics23Error; -use crate::core::ics24_host::identifier::ClientId; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use ibc_proto::{ + google::protobuf::Any, + ibc::core::{ + client::v1::MsgUpgradeClient as RawMsgUpgradeClient, + commitment::v1::MerkleProof as RawMerkleProof, + }, + Protobuf, +}; + +use crate::{ + core::{ + ics02_client::error::Error, + ics23_commitment::{commitment::CommitmentProofBytes, error::Error as Ics23Error}, + ics24_host::identifier::ClientId, + }, + signer::Signer, + tx_msg::Msg, +}; pub(crate) const TYPE_URL: &str = "/ibc.core.client.v1.MsgUpgradeClient"; @@ -117,6 +124,7 @@ impl TryFrom for MsgUpgradeClient { pub mod test_util { use ibc_proto::ibc::core::client::v1::MsgUpgradeClient as RawMsgUpgradeClient; + use super::MsgUpgradeClient; use crate::{ core::{ics02_client::height::Height, ics24_host::identifier::ClientId}, mock::{ @@ -125,8 +133,6 @@ pub mod test_util { test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; - use super::MsgUpgradeClient; - /// Extends the implementation with additional helper methods. impl MsgUpgradeClient { /// Setter for `client_id`. Amenable to chaining, since it consumes the input message. diff --git a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs index 8f249b820f..682c8669a7 100644 --- a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs +++ b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs @@ -2,15 +2,15 @@ //! represented as a fraction with valid values in the //! range `[0, 1)`. -use std::convert::TryFrom; -use std::fmt::{Display, Error as FmtError, Formatter}; -use std::str::FromStr; +use std::{ + convert::TryFrom, + fmt::{Display, Error as FmtError, Formatter}, + str::FromStr, +}; -use ibc_proto::Protobuf; +use ibc_proto::{ibc::lightclients::tendermint::v1::Fraction, Protobuf}; use num_rational::Ratio; use serde::{Deserialize, Serialize}; - -use ibc_proto::ibc::lightclients::tendermint::v1::Fraction; use tendermint::trust_threshold::TrustThresholdFraction; use crate::core::ics02_client::error::Error; @@ -161,9 +161,10 @@ impl<'de> Deserialize<'de> for TrustThreshold { where D: serde::Deserializer<'de>, { - use serde::de::{self, Visitor}; use std::fmt; + use serde::de::{self, Visitor}; + // This is a Visitor that forwards string types to T's `FromStr` impl and // forwards map types to T's `Deserialize` impl. The `PhantomData` is to // keep the compiler from complaining about T being an unused generic type @@ -213,9 +214,10 @@ fn string_or_int<'de, D>(deserializer: D) -> Result where D: serde::Deserializer<'de>, { - use serde::de::{self, Visitor}; use std::fmt; + use serde::de::{self, Visitor}; + struct StringOrInt; impl<'de> Visitor<'de> for StringOrInt { diff --git a/crates/relayer-types/src/core/ics03_connection/connection.rs b/crates/relayer-types/src/core/ics03_connection/connection.rs index d240eaf905..e6856efadc 100644 --- a/crates/relayer-types/src/core/ics03_connection/connection.rs +++ b/crates/relayer-types/src/core/ics03_connection/connection.rs @@ -1,26 +1,32 @@ -use std::str::FromStr; -use std::time::Duration; use std::{ fmt::{Display, Error as FmtError, Formatter}, + str::FromStr, + time::Duration, u64, }; -use ibc_proto::Protobuf; +use ibc_proto::{ + ibc::core::connection::v1::{ + ConnectionEnd as RawConnectionEnd, Counterparty as RawCounterparty, + IdentifiedConnection as RawIdentifiedConnection, + }, + Protobuf, +}; use serde::{Deserialize, Serialize}; -use ibc_proto::ibc::core::connection::v1::{ - ConnectionEnd as RawConnectionEnd, Counterparty as RawCounterparty, - IdentifiedConnection as RawIdentifiedConnection, +use crate::{ + core::{ + ics02_client::error::Error as ClientError, + ics03_connection::{error::Error, version::Version}, + ics23_commitment::commitment::CommitmentPrefix, + ics24_host::{ + error::ValidationError, + identifier::{ClientId, ConnectionId}, + }, + }, + timestamp::ZERO_DURATION, }; -use crate::core::ics02_client::error::Error as ClientError; -use crate::core::ics03_connection::error::Error; -use crate::core::ics03_connection::version::Version; -use crate::core::ics23_commitment::commitment::CommitmentPrefix; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; -use crate::timestamp::ZERO_DURATION; - #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct IdentifiedConnectionEnd { pub connection_id: ConnectionId, diff --git a/crates/relayer-types/src/core/ics03_connection/error.rs b/crates/relayer-types/src/core/ics03_connection/error.rs index 068b3ee30a..f5bb0590a5 100644 --- a/crates/relayer-types/src/core/ics03_connection/error.rs +++ b/crates/relayer-types/src/core/ics03_connection/error.rs @@ -1,13 +1,19 @@ -use crate::core::ics02_client::error as client_error; -use crate::core::ics03_connection::version::Version; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; -use crate::proofs::ProofError; -use crate::signer::SignerError; -use crate::Height; - use flex_error::define_error; +use crate::{ + core::{ + ics02_client::error as client_error, + ics03_connection::version::Version, + ics24_host::{ + error::ValidationError, + identifier::{ClientId, ConnectionId}, + }, + }, + proofs::ProofError, + signer::SignerError, + Height, +}; + define_error! { #[derive(Debug, PartialEq, Eq)] Error { diff --git a/crates/relayer-types/src/core/ics03_connection/events.rs b/crates/relayer-types/src/core/ics03_connection/events.rs index 5fddc6cfad..06d5e21910 100644 --- a/crates/relayer-types/src/core/ics03_connection/events.rs +++ b/crates/relayer-types/src/core/ics03_connection/events.rs @@ -1,11 +1,14 @@ //! Types for the IBC events emitted from Tendermint Websocket by the connection module. -use serde_derive::{Deserialize, Serialize}; use std::fmt::{Display, Error as FmtError, Formatter}; + +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; -use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; -use crate::events::{IbcEvent, IbcEventType}; +use crate::{ + core::ics24_host::identifier::{ClientId, ConnectionId}, + events::{IbcEvent, IbcEventType}, +}; /// The content of the `key` field for the attribute containing the connection identifier. pub const CONN_ID_ATTRIBUTE_KEY: &str = "connection_id"; diff --git a/crates/relayer-types/src/core/ics03_connection/msgs.rs b/crates/relayer-types/src/core/ics03_connection/msgs.rs index 74a6af44b9..c811278091 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs.rs @@ -12,10 +12,10 @@ //! Another difference to ICS3 specs is that each message comprises an additional field called //! `signer` which is specific to Cosmos-SDK. -use crate::core::ics03_connection::msgs::conn_open_ack::MsgConnectionOpenAck; -use crate::core::ics03_connection::msgs::conn_open_confirm::MsgConnectionOpenConfirm; -use crate::core::ics03_connection::msgs::conn_open_init::MsgConnectionOpenInit; -use crate::core::ics03_connection::msgs::conn_open_try::MsgConnectionOpenTry; +use crate::core::ics03_connection::msgs::{ + conn_open_ack::MsgConnectionOpenAck, conn_open_confirm::MsgConnectionOpenConfirm, + conn_open_init::MsgConnectionOpenInit, conn_open_try::MsgConnectionOpenTry, +}; pub mod conn_open_ack; pub mod conn_open_confirm; @@ -34,10 +34,11 @@ pub enum ConnectionMsg { #[cfg(test)] pub mod test_util { - use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; + use ibc_proto::ibc::core::{ + commitment::v1::MerklePrefix, connection::v1::Counterparty as RawCounterparty, + }; - use ibc_proto::ibc::core::commitment::v1::MerklePrefix; - use ibc_proto::ibc::core::connection::v1::Counterparty as RawCounterparty; + use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; pub fn get_dummy_raw_counterparty() -> RawCounterparty { RawCounterparty { diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_ack.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_ack.rs index ff8f03028b..2d602a7375 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_ack.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_ack.rs @@ -1,15 +1,19 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck; -use ibc_proto::Protobuf; +use ibc_proto::{ + google::protobuf::Any, + ibc::core::connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, Protobuf, +}; -use crate::core::ics03_connection::error::Error; -use crate::core::ics03_connection::version::Version; -use crate::core::ics23_commitment::commitment::CommitmentProofBytes; -use crate::core::ics24_host::identifier::ConnectionId; -use crate::proofs::{ConsensusProof, Proofs}; -use crate::signer::Signer; -use crate::tx_msg::Msg; -use crate::Height; +use crate::{ + core::{ + ics03_connection::{error::Error, version::Version}, + ics23_commitment::commitment::CommitmentProofBytes, + ics24_host::identifier::ConnectionId, + }, + proofs::{ConsensusProof, Proofs}, + signer::Signer, + tx_msg::Msg, + Height, +}; pub const TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionOpenAck"; @@ -134,12 +138,14 @@ impl From for RawMsgConnectionOpenAck { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::client::v1::Height; - use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck; + use ibc_proto::ibc::core::{ + client::v1::Height, connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, + }; - use crate::core::ics03_connection::version::Version; - use crate::core::ics24_host::identifier::ConnectionId; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + use crate::{ + core::{ics03_connection::version::Version, ics24_host::identifier::ConnectionId}, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; pub fn get_dummy_raw_msg_conn_open_ack( proof_height: u64, @@ -170,13 +176,14 @@ pub mod test_util { #[cfg(test)] mod tests { + use ibc_proto::ibc::core::{ + client::v1::Height, connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, + }; use test_log::test; - use ibc_proto::ibc::core::client::v1::Height; - use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck; - - use crate::core::ics03_connection::msgs::conn_open_ack::test_util::get_dummy_raw_msg_conn_open_ack; - use crate::core::ics03_connection::msgs::conn_open_ack::MsgConnectionOpenAck; + use crate::core::ics03_connection::msgs::conn_open_ack::{ + test_util::get_dummy_raw_msg_conn_open_ack, MsgConnectionOpenAck, + }; #[test] fn parse_connection_open_ack_msg() { diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_confirm.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_confirm.rs index c7b86b4b43..f6f98b2d18 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_confirm.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_confirm.rs @@ -1,12 +1,13 @@ -use ibc_proto::Protobuf; +use ibc_proto::{ + ibc::core::connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, Protobuf, +}; -use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm; - -use crate::core::ics03_connection::error::Error; -use crate::core::ics24_host::identifier::ConnectionId; -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use crate::{ + core::{ics03_connection::error::Error, ics24_host::identifier::ConnectionId}, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionOpenConfirm"; @@ -77,8 +78,9 @@ impl From for RawMsgConnectionOpenConfirm { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::client::v1::Height; - use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm; + use ibc_proto::ibc::core::{ + client::v1::Height, connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, + }; use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; @@ -98,13 +100,14 @@ pub mod test_util { #[cfg(test)] mod tests { + use ibc_proto::ibc::core::{ + client::v1::Height, connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, + }; use test_log::test; - use ibc_proto::ibc::core::client::v1::Height; - use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm; - - use crate::core::ics03_connection::msgs::conn_open_confirm::test_util::get_dummy_raw_msg_conn_open_confirm; - use crate::core::ics03_connection::msgs::conn_open_confirm::MsgConnectionOpenConfirm; + use crate::core::ics03_connection::msgs::conn_open_confirm::{ + test_util::get_dummy_raw_msg_conn_open_confirm, MsgConnectionOpenConfirm, + }; #[test] fn parse_connection_open_confirm_msg() { diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_init.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_init.rs index 4bdc6db6c2..6e069f4c0e 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_init.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_init.rs @@ -1,14 +1,17 @@ use std::time::Duration; -use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenInit as RawMsgConnectionOpenInit; -use ibc_proto::Protobuf; - -use crate::core::ics03_connection::connection::Counterparty; -use crate::core::ics03_connection::error::Error; -use crate::core::ics03_connection::version::Version; -use crate::core::ics24_host::identifier::ClientId; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use ibc_proto::{ + ibc::core::connection::v1::MsgConnectionOpenInit as RawMsgConnectionOpenInit, Protobuf, +}; + +use crate::{ + core::{ + ics03_connection::{connection::Counterparty, error::Error, version::Version}, + ics24_host::identifier::ClientId, + }, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionOpenInit"; @@ -73,11 +76,18 @@ pub mod test_util { use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenInit as RawMsgConnectionOpenInit; - use crate::core::ics03_connection::msgs::conn_open_init::MsgConnectionOpenInit; - use crate::core::ics03_connection::msgs::test_util::get_dummy_raw_counterparty; - use crate::core::ics03_connection::version::Version; - use crate::core::ics24_host::identifier::ClientId; - use crate::test_utils::get_dummy_bech32_account; + use crate::{ + core::{ + ics03_connection::{ + msgs::{ + conn_open_init::MsgConnectionOpenInit, test_util::get_dummy_raw_counterparty, + }, + version::Version, + }, + ics24_host::identifier::ClientId, + }, + test_utils::get_dummy_bech32_account, + }; /// Extends the implementation with additional helper methods. impl MsgConnectionOpenInit { @@ -103,14 +113,16 @@ pub mod test_util { #[cfg(test)] mod tests { + use ibc_proto::ibc::core::connection::v1::{ + Counterparty as RawCounterparty, MsgConnectionOpenInit as RawMsgConnectionOpenInit, + }; use test_log::test; - use ibc_proto::ibc::core::connection::v1::Counterparty as RawCounterparty; - use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenInit as RawMsgConnectionOpenInit; - use super::MsgConnectionOpenInit; - use crate::core::ics03_connection::msgs::conn_open_init::test_util::get_dummy_raw_msg_conn_open_init; - use crate::core::ics03_connection::msgs::test_util::get_dummy_raw_counterparty; + use crate::core::ics03_connection::msgs::{ + conn_open_init::test_util::get_dummy_raw_msg_conn_open_init, + test_util::get_dummy_raw_counterparty, + }; #[test] fn parse_connection_open_init_msg() { diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs index 8cebee431b..bc9bc3a3e4 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs @@ -4,19 +4,22 @@ use std::{ time::Duration, }; -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry; -use ibc_proto::Protobuf; - -use crate::core::ics03_connection::connection::Counterparty; -use crate::core::ics03_connection::error::Error; -use crate::core::ics03_connection::version::Version; -use crate::core::ics23_commitment::commitment::CommitmentProofBytes; -use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; -use crate::proofs::{ConsensusProof, Proofs}; -use crate::signer::Signer; -use crate::tx_msg::Msg; -use crate::Height; +use ibc_proto::{ + google::protobuf::Any, + ibc::core::connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry, Protobuf, +}; + +use crate::{ + core::{ + ics03_connection::{connection::Counterparty, error::Error, version::Version}, + ics23_commitment::commitment::CommitmentProofBytes, + ics24_host::identifier::{ClientId, ConnectionId}, + }, + proofs::{ConsensusProof, Proofs}, + signer::Signer, + tx_msg::Msg, + Height, +}; pub const TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionOpenTry"; @@ -170,14 +173,22 @@ impl From for RawMsgConnectionOpenTry { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::client::v1::Height; - use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry; + use ibc_proto::ibc::core::{ + client::v1::Height, connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry, + }; - use crate::core::ics03_connection::msgs::conn_open_try::MsgConnectionOpenTry; - use crate::core::ics03_connection::msgs::test_util::get_dummy_raw_counterparty; - use crate::core::ics03_connection::version::get_compatible_versions; - use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + use crate::{ + core::{ + ics03_connection::{ + msgs::{ + conn_open_try::MsgConnectionOpenTry, test_util::get_dummy_raw_counterparty, + }, + version::get_compatible_versions, + }, + ics24_host::identifier::{ClientId, ConnectionId}, + }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; /// Testing-specific helper methods. impl MsgConnectionOpenTry { @@ -237,15 +248,18 @@ pub mod test_util { #[cfg(test)] mod tests { + use ibc_proto::ibc::core::{ + client::v1::Height, + connection::v1::{ + Counterparty as RawCounterparty, MsgConnectionOpenTry as RawMsgConnectionOpenTry, + }, + }; use test_log::test; - use ibc_proto::ibc::core::client::v1::Height; - use ibc_proto::ibc::core::connection::v1::Counterparty as RawCounterparty; - use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry; - - use crate::core::ics03_connection::msgs::conn_open_try::test_util::get_dummy_raw_msg_conn_open_try; - use crate::core::ics03_connection::msgs::conn_open_try::MsgConnectionOpenTry; - use crate::core::ics03_connection::msgs::test_util::get_dummy_raw_counterparty; + use crate::core::ics03_connection::msgs::{ + conn_open_try::{test_util::get_dummy_raw_msg_conn_open_try, MsgConnectionOpenTry}, + test_util::get_dummy_raw_counterparty, + }; #[test] fn parse_connection_open_try_msg() { diff --git a/crates/relayer-types/src/core/ics03_connection/version.rs b/crates/relayer-types/src/core/ics03_connection/version.rs index 108665d80e..c1bed7e360 100644 --- a/crates/relayer-types/src/core/ics03_connection/version.rs +++ b/crates/relayer-types/src/core/ics03_connection/version.rs @@ -1,13 +1,12 @@ use std::fmt::Display; -use crate::utils::pretty::PrettySlice; - -use ibc_proto::ibc::core::connection::v1::Version as RawVersion; -use ibc_proto::Protobuf; +use ibc_proto::{ibc::core::connection::v1::Version as RawVersion, Protobuf}; use serde::{Deserialize, Serialize}; -use crate::core::ics03_connection::error::Error; -use crate::core::ics04_channel::channel::Ordering; +use crate::{ + core::{ics03_connection::error::Error, ics04_channel::channel::Ordering}, + utils::pretty::PrettySlice, +}; /// Stores the identifier and the features supported by a version #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -111,12 +110,13 @@ pub fn pick_version( #[cfg(test)] mod tests { - use test_log::test; - use ibc_proto::ibc::core::connection::v1::Version as RawVersion; + use test_log::test; - use crate::core::ics03_connection::error::Error; - use crate::core::ics03_connection::version::{get_compatible_versions, pick_version, Version}; + use crate::core::ics03_connection::{ + error::Error, + version::{get_compatible_versions, pick_version, Version}, + }; fn good_versions() -> Vec { vec![ diff --git a/crates/relayer-types/src/core/ics04_channel/channel.rs b/crates/relayer-types/src/core/ics04_channel/channel.rs index 0205e2998a..e0a46ccaf9 100644 --- a/crates/relayer-types/src/core/ics04_channel/channel.rs +++ b/crates/relayer-types/src/core/ics04_channel/channel.rs @@ -1,19 +1,25 @@ -use crate::utils::pretty::PrettySlice; - -use std::fmt::{Display, Error as FmtError, Formatter}; -use std::str::FromStr; +use std::{ + fmt::{Display, Error as FmtError, Formatter}, + str::FromStr, +}; -use ibc_proto::Protobuf; +use ibc_proto::{ + ibc::core::channel::v1::{ + Channel as RawChannel, Counterparty as RawCounterparty, + IdentifiedChannel as RawIdentifiedChannel, + }, + Protobuf, +}; use serde::{Deserialize, Serialize}; -use ibc_proto::ibc::core::channel::v1::{ - Channel as RawChannel, Counterparty as RawCounterparty, - IdentifiedChannel as RawIdentifiedChannel, +use crate::{ + core::{ + ics04_channel::{error::Error, version::Version}, + ics24_host::identifier::{ChannelId, ConnectionId, PortId}, + }, + utils::pretty::PrettySlice, }; -use crate::core::ics04_channel::{error::Error, version::Version}; -use crate::core::ics24_host::identifier::{ChannelId, ConnectionId, PortId}; - #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct IdentifiedChannelEnd { pub port_id: PortId, @@ -437,10 +443,11 @@ impl Display for State { #[cfg(test)] pub mod test_util { - use crate::core::ics24_host::identifier::{ChannelId, ConnectionId, PortId}; + use ibc_proto::ibc::core::channel::v1::{ + Channel as RawChannel, Counterparty as RawCounterparty, + }; - use ibc_proto::ibc::core::channel::v1::Channel as RawChannel; - use ibc_proto::ibc::core::channel::v1::Counterparty as RawCounterparty; + use crate::core::ics24_host::identifier::{ChannelId, ConnectionId, PortId}; /// Returns a dummy `RawCounterparty`, for testing only! /// Can be optionally parametrized with a specific channel identifier. @@ -467,12 +474,11 @@ pub mod test_util { mod tests { use core::str::FromStr; - use test_log::test; use ibc_proto::ibc::core::channel::v1::Channel as RawChannel; + use test_log::test; - use crate::core::ics04_channel::channel::test_util::get_dummy_raw_channel_end; - use crate::core::ics04_channel::channel::ChannelEnd; + use crate::core::ics04_channel::channel::{test_util::get_dummy_raw_channel_end, ChannelEnd}; #[test] fn channel_end_try_from_raw() { diff --git a/crates/relayer-types/src/core/ics04_channel/error.rs b/crates/relayer-types/src/core/ics04_channel/error.rs index 817f0337f8..961131302a 100644 --- a/crates/relayer-types/src/core/ics04_channel/error.rs +++ b/crates/relayer-types/src/core/ics04_channel/error.rs @@ -1,19 +1,23 @@ -use super::packet::Sequence; -use super::timeout::TimeoutHeight; -use crate::core::ics02_client::error as client_error; -use crate::core::ics03_connection::error as connection_error; -use crate::core::ics04_channel::channel::State; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; - -use crate::proofs::ProofError; -use crate::signer::SignerError; -use crate::timestamp::Timestamp; -use crate::Height; - use flex_error::{define_error, TraceError}; use tendermint_proto::Error as TendermintError; +use super::{packet::Sequence, timeout::TimeoutHeight}; +use crate::{ + core::{ + ics02_client::error as client_error, + ics03_connection::error as connection_error, + ics04_channel::channel::State, + ics24_host::{ + error::ValidationError, + identifier::{ChannelId, ClientId, ConnectionId, PortId}, + }, + }, + proofs::ProofError, + signer::SignerError, + timestamp::Timestamp, + Height, +}; + define_error! { #[derive(Debug, PartialEq, Eq)] Error { diff --git a/crates/relayer-types/src/core/ics04_channel/events.rs b/crates/relayer-types/src/core/ics04_channel/events.rs index 3f6d7c4382..d67ae0c51f 100644 --- a/crates/relayer-types/src/core/ics04_channel/events.rs +++ b/crates/relayer-types/src/core/ics04_channel/events.rs @@ -1,16 +1,21 @@ //! Types for the IBC events emitted from Tendermint Websocket by the channels module. +use std::{ + fmt::{Display, Error as FmtError, Formatter}, + str, +}; + use serde_derive::{Deserialize, Serialize}; -use std::fmt::{Display, Error as FmtError, Formatter}; -use std::str; use tendermint::abci; -use crate::core::ics04_channel::error::Error; -use crate::core::ics04_channel::packet::Packet; -use crate::core::ics24_host::identifier::{ChannelId, ConnectionId, PortId}; -use crate::events::{Error as EventError, IbcEvent, IbcEventType}; - -use crate::utils::pretty::PrettySlice; +use crate::{ + core::{ + ics04_channel::{error::Error, packet::Packet}, + ics24_host::identifier::{ChannelId, ConnectionId, PortId}, + }, + events::{Error as EventError, IbcEvent, IbcEventType}, + utils::pretty::PrettySlice, +}; /// Channel event attribute keys pub const CONNECTION_ID_ATTRIBUTE_KEY: &str = "connection_id"; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs.rs b/crates/relayer-types/src/core/ics04_channel/msgs.rs index c69f2e267f..a4d0b97222 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs.rs @@ -1,16 +1,13 @@ //! Message definitions for all ICS4 domain types: channel open & close handshake datagrams, as well //! as packets. -use crate::core::ics04_channel::msgs::acknowledgement::MsgAcknowledgement; -use crate::core::ics04_channel::msgs::chan_close_confirm::MsgChannelCloseConfirm; -use crate::core::ics04_channel::msgs::chan_close_init::MsgChannelCloseInit; -use crate::core::ics04_channel::msgs::chan_open_ack::MsgChannelOpenAck; -use crate::core::ics04_channel::msgs::chan_open_confirm::MsgChannelOpenConfirm; -use crate::core::ics04_channel::msgs::chan_open_init::MsgChannelOpenInit; -use crate::core::ics04_channel::msgs::chan_open_try::MsgChannelOpenTry; -use crate::core::ics04_channel::msgs::recv_packet::MsgRecvPacket; -use crate::core::ics04_channel::msgs::timeout::MsgTimeout; -use crate::core::ics04_channel::msgs::timeout_on_close::MsgTimeoutOnClose; +use crate::core::ics04_channel::msgs::{ + acknowledgement::MsgAcknowledgement, chan_close_confirm::MsgChannelCloseConfirm, + chan_close_init::MsgChannelCloseInit, chan_open_ack::MsgChannelOpenAck, + chan_open_confirm::MsgChannelOpenConfirm, chan_open_init::MsgChannelOpenInit, + chan_open_try::MsgChannelOpenTry, recv_packet::MsgRecvPacket, timeout::MsgTimeout, + timeout_on_close::MsgTimeoutOnClose, +}; // Opening handshake messages. pub mod chan_open_ack; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/acknowledgement.rs b/crates/relayer-types/src/core/ics04_channel/msgs/acknowledgement.rs index 421342837d..7d81455c33 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/acknowledgement.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/acknowledgement.rs @@ -1,12 +1,12 @@ use derive_more::{From, Into}; -use ibc_proto::ibc::core::channel::v1::MsgAcknowledgement as RawMsgAcknowledgement; -use ibc_proto::Protobuf; +use ibc_proto::{ibc::core::channel::v1::MsgAcknowledgement as RawMsgAcknowledgement, Protobuf}; -use crate::core::ics04_channel::error::Error; -use crate::core::ics04_channel::packet::Packet; -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use crate::{ + core::ics04_channel::{error::Error, packet::Packet}, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgAcknowledgement"; @@ -122,12 +122,15 @@ impl From for RawMsgAcknowledgement { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::channel::v1::MsgAcknowledgement as RawMsgAcknowledgement; - use ibc_proto::ibc::core::channel::v1::Packet as RawPacket; - use ibc_proto::ibc::core::client::v1::Height as RawHeight; + use ibc_proto::ibc::core::{ + channel::v1::{MsgAcknowledgement as RawMsgAcknowledgement, Packet as RawPacket}, + client::v1::Height as RawHeight, + }; - use crate::core::ics04_channel::packet::test_utils::get_dummy_raw_packet; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + use crate::{ + core::ics04_channel::packet::test_utils::get_dummy_raw_packet, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; /// Returns a dummy `RawMsgAcknowledgement`, for testing only! /// The `height` parametrizes both the proof height as well as the timeout height. @@ -155,14 +158,18 @@ pub mod test_util { #[cfg(test)] mod test { - use test_log::test; - use ibc_proto::ibc::core::channel::v1::MsgAcknowledgement as RawMsgAcknowledgement; + use test_log::test; - use crate::core::ics04_channel::error::Error; - use crate::core::ics04_channel::msgs::acknowledgement::test_util::get_dummy_raw_msg_acknowledgement; - use crate::core::ics04_channel::msgs::acknowledgement::MsgAcknowledgement; - use crate::test_utils::get_dummy_bech32_account; + use crate::{ + core::ics04_channel::{ + error::Error, + msgs::acknowledgement::{ + test_util::get_dummy_raw_msg_acknowledgement, MsgAcknowledgement, + }, + }, + test_utils::get_dummy_bech32_account, + }; #[test] fn msg_acknowledgment_try_from_raw() { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs index e29872320d..ee7c52ec7b 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs @@ -1,12 +1,16 @@ -use ibc_proto::Protobuf; - -use ibc_proto::ibc::core::channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm; - -use crate::core::ics04_channel::error::Error; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use ibc_proto::{ + ibc::core::channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, Protobuf, +}; + +use crate::{ + core::{ + ics04_channel::error::Error, + ics24_host::identifier::{ChannelId, PortId}, + }, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelCloseConfirm"; @@ -92,11 +96,14 @@ impl From for RawMsgChannelCloseConfirm { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm; - use ibc_proto::ibc::core::client::v1::Height; + use ibc_proto::ibc::core::{ + channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, client::v1::Height, + }; - use crate::core::ics24_host::identifier::{ChannelId, PortId}; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + use crate::{ + core::ics24_host::identifier::{ChannelId, PortId}, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; /// Returns a dummy `RawMsgChannelCloseConfirm`, for testing only! pub fn get_dummy_raw_msg_chan_close_confirm(proof_height: u64) -> RawMsgChannelCloseConfirm { @@ -116,11 +123,13 @@ pub mod test_util { #[cfg(test)] mod tests { - use ibc_proto::ibc::core::channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm; - use ibc_proto::ibc::core::client::v1::Height; + use ibc_proto::ibc::core::{ + channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, client::v1::Height, + }; - use crate::core::ics04_channel::msgs::chan_close_confirm::test_util::get_dummy_raw_msg_chan_close_confirm; - use crate::core::ics04_channel::msgs::chan_close_confirm::MsgChannelCloseConfirm; + use crate::core::ics04_channel::msgs::chan_close_confirm::{ + test_util::get_dummy_raw_msg_chan_close_confirm, MsgChannelCloseConfirm, + }; #[test] fn parse_channel_close_confirm_msg() { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs index 9e249d6137..f432e5d8fc 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs @@ -1,11 +1,13 @@ -use ibc_proto::Protobuf; +use ibc_proto::{ibc::core::channel::v1::MsgChannelCloseInit as RawMsgChannelCloseInit, Protobuf}; -use ibc_proto::ibc::core::channel::v1::MsgChannelCloseInit as RawMsgChannelCloseInit; - -use crate::core::ics04_channel::error::Error; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use crate::{ + core::{ + ics04_channel::error::Error, + ics24_host::identifier::{ChannelId, PortId}, + }, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelCloseInit"; @@ -71,8 +73,10 @@ pub mod test_util { use ibc_proto::ibc::core::channel::v1::MsgChannelCloseInit as RawMsgChannelCloseInit; - use crate::core::ics24_host::identifier::{ChannelId, PortId}; - use crate::test_utils::get_dummy_bech32_account; + use crate::{ + core::ics24_host::identifier::{ChannelId, PortId}, + test_utils::get_dummy_bech32_account, + }; /// Returns a dummy `RawMsgChannelCloseInit`, for testing only! pub fn get_dummy_raw_msg_chan_close_init() -> RawMsgChannelCloseInit { @@ -87,12 +91,12 @@ pub mod test_util { #[cfg(test)] mod tests { - use test_log::test; - use ibc_proto::ibc::core::channel::v1::MsgChannelCloseInit as RawMsgChannelCloseInit; + use test_log::test; - use crate::core::ics04_channel::msgs::chan_close_init::test_util::get_dummy_raw_msg_chan_close_init; - use crate::core::ics04_channel::msgs::chan_close_init::MsgChannelCloseInit; + use crate::core::ics04_channel::msgs::chan_close_init::{ + test_util::get_dummy_raw_msg_chan_close_init, MsgChannelCloseInit, + }; #[test] fn parse_channel_close_init_msg() { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_ack.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_ack.rs index 895ff7d204..e160657bd1 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_ack.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_ack.rs @@ -1,13 +1,14 @@ -use crate::core::ics04_channel::error::Error; -use crate::core::ics04_channel::version::Version; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; +use ibc_proto::{ibc::core::channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, Protobuf}; -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; - -use ibc_proto::ibc::core::channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck; -use ibc_proto::Protobuf; +use crate::{ + core::{ + ics04_channel::{error::Error, version::Version}, + ics24_host::identifier::{ChannelId, PortId}, + }, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenAck"; @@ -107,11 +108,14 @@ impl From for RawMsgChannelOpenAck { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck; + use ibc_proto::ibc::core::{ + channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, client::v1::Height, + }; - use crate::core::ics24_host::identifier::{ChannelId, PortId}; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; - use ibc_proto::ibc::core::client::v1::Height; + use crate::{ + core::ics24_host::identifier::{ChannelId, PortId}, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; /// Returns a dummy `RawMsgChannelOpenAck`, for testing only! pub fn get_dummy_raw_msg_chan_open_ack(proof_height: u64) -> RawMsgChannelOpenAck { @@ -133,13 +137,14 @@ pub mod test_util { #[cfg(test)] mod tests { - use ibc_proto::ibc::core::channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck; + use ibc_proto::ibc::core::{ + channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, client::v1::Height, + }; use test_log::test; - use crate::core::ics04_channel::msgs::chan_open_ack::test_util::get_dummy_raw_msg_chan_open_ack; - use crate::core::ics04_channel::msgs::chan_open_ack::MsgChannelOpenAck; - - use ibc_proto::ibc::core::client::v1::Height; + use crate::core::ics04_channel::msgs::chan_open_ack::{ + test_util::get_dummy_raw_msg_chan_open_ack, MsgChannelOpenAck, + }; #[test] fn parse_channel_open_ack_msg() { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_confirm.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_confirm.rs index 627f320698..733a50808f 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_confirm.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_confirm.rs @@ -1,12 +1,16 @@ -use crate::core::ics04_channel::error::Error; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; - -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; - -use ibc_proto::ibc::core::channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm; -use ibc_proto::Protobuf; +use ibc_proto::{ + ibc::core::channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, Protobuf, +}; + +use crate::{ + core::{ + ics04_channel::error::Error, + ics24_host::identifier::{ChannelId, PortId}, + }, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenConfirm"; @@ -89,11 +93,14 @@ impl From for RawMsgChannelOpenConfirm { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm; + use ibc_proto::ibc::core::{ + channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, client::v1::Height, + }; - use crate::core::ics24_host::identifier::{ChannelId, PortId}; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; - use ibc_proto::ibc::core::client::v1::Height; + use crate::{ + core::ics24_host::identifier::{ChannelId, PortId}, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; /// Returns a dummy `RawMsgChannelOpenConfirm`, for testing only! pub fn get_dummy_raw_msg_chan_open_confirm(proof_height: u64) -> RawMsgChannelOpenConfirm { @@ -113,13 +120,14 @@ pub mod test_util { #[cfg(test)] mod tests { - use ibc_proto::ibc::core::channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm; + use ibc_proto::ibc::core::{ + channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, client::v1::Height, + }; use test_log::test; - use crate::core::ics04_channel::msgs::chan_open_confirm::test_util::get_dummy_raw_msg_chan_open_confirm; - use crate::core::ics04_channel::msgs::chan_open_confirm::MsgChannelOpenConfirm; - - use ibc_proto::ibc::core::client::v1::Height; + use crate::core::ics04_channel::msgs::chan_open_confirm::{ + test_util::get_dummy_raw_msg_chan_open_confirm, MsgChannelOpenConfirm, + }; #[test] fn parse_channel_open_confirm_msg() { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs index 8128674f24..479152bba2 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs @@ -1,12 +1,13 @@ -use crate::core::ics04_channel::channel::ChannelEnd; -use crate::core::ics04_channel::error::Error; -use crate::core::ics24_host::identifier::PortId; +use ibc_proto::{ibc::core::channel::v1::MsgChannelOpenInit as RawMsgChannelOpenInit, Protobuf}; -use crate::signer::Signer; -use crate::tx_msg::Msg; - -use ibc_proto::ibc::core::channel::v1::MsgChannelOpenInit as RawMsgChannelOpenInit; -use ibc_proto::Protobuf; +use crate::{ + core::{ + ics04_channel::{channel::ChannelEnd, error::Error}, + ics24_host::identifier::PortId, + }, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenInit"; @@ -75,9 +76,13 @@ pub mod test_util { use ibc_proto::ibc::core::channel::v1::MsgChannelOpenInit as RawMsgChannelOpenInit; - use crate::core::ics04_channel::channel::test_util::get_dummy_raw_channel_end; - use crate::core::ics24_host::identifier::PortId; - use crate::test_utils::get_dummy_bech32_account; + use crate::{ + core::{ + ics04_channel::channel::test_util::get_dummy_raw_channel_end, + ics24_host::identifier::PortId, + }, + test_utils::get_dummy_bech32_account, + }; /// Returns a dummy `RawMsgChannelOpenInit`, for testing only! pub fn get_dummy_raw_msg_chan_open_init() -> RawMsgChannelOpenInit { @@ -91,12 +96,13 @@ pub mod test_util { #[cfg(test)] mod tests { - use crate::core::ics04_channel::msgs::chan_open_init::test_util::get_dummy_raw_msg_chan_open_init; - use crate::core::ics04_channel::msgs::chan_open_init::MsgChannelOpenInit; - use ibc_proto::ibc::core::channel::v1::MsgChannelOpenInit as RawMsgChannelOpenInit; use test_log::test; + use crate::core::ics04_channel::msgs::chan_open_init::{ + test_util::get_dummy_raw_msg_chan_open_init, MsgChannelOpenInit, + }; + #[test] fn channel_open_init_from_raw() { struct Test { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs index 597204e5ec..db1d394a28 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs @@ -1,17 +1,19 @@ -use crate::core::ics04_channel::channel::ChannelEnd; -use crate::core::ics04_channel::error::Error as ChannelError; -use crate::core::ics04_channel::version::Version; -use crate::core::ics24_host::error::ValidationError; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; - -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use core::str::FromStr; -use ibc_proto::ibc::core::channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry; -use ibc_proto::Protobuf; +use ibc_proto::{ibc::core::channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, Protobuf}; -use core::str::FromStr; +use crate::{ + core::{ + ics04_channel::{channel::ChannelEnd, error::Error as ChannelError, version::Version}, + ics24_host::{ + error::ValidationError, + identifier::{ChannelId, PortId}, + }, + }, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenTry"; @@ -136,12 +138,17 @@ impl From for RawMsgChannelOpenTry { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry; + use ibc_proto::ibc::core::{ + channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, client::v1::Height, + }; - use crate::core::ics04_channel::channel::test_util::get_dummy_raw_channel_end; - use crate::core::ics24_host::identifier::{ChannelId, PortId}; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; - use ibc_proto::ibc::core::client::v1::Height; + use crate::{ + core::{ + ics04_channel::channel::test_util::get_dummy_raw_channel_end, + ics24_host::identifier::{ChannelId, PortId}, + }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; /// Returns a dummy `RawMsgChannelOpenTry`, for testing only! #[allow(deprecated)] @@ -163,13 +170,15 @@ pub mod test_util { #[cfg(test)] mod tests { - use crate::core::ics04_channel::msgs::chan_open_try::test_util::get_dummy_raw_msg_chan_open_try; - use crate::core::ics04_channel::msgs::chan_open_try::MsgChannelOpenTry; - - use ibc_proto::ibc::core::channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry; - use ibc_proto::ibc::core::client::v1::Height; + use ibc_proto::ibc::core::{ + channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, client::v1::Height, + }; use test_log::test; + use crate::core::ics04_channel::msgs::chan_open_try::{ + test_util::get_dummy_raw_msg_chan_open_try, MsgChannelOpenTry, + }; + #[test] #[allow(deprecated)] fn channel_open_try_from_raw() { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/recv_packet.rs b/crates/relayer-types/src/core/ics04_channel/msgs/recv_packet.rs index 6d3472c4ef..e3b595cf76 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/recv_packet.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/recv_packet.rs @@ -1,12 +1,11 @@ -use ibc_proto::Protobuf; +use ibc_proto::{ibc::core::channel::v1::MsgRecvPacket as RawMsgRecvPacket, Protobuf}; -use ibc_proto::ibc::core::channel::v1::MsgRecvPacket as RawMsgRecvPacket; - -use crate::core::ics04_channel::error::Error; -use crate::core::ics04_channel::packet::Packet; -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use crate::{ + core::ics04_channel::{error::Error, packet::Packet}, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgRecvPacket"; @@ -89,14 +88,17 @@ impl From for RawMsgRecvPacket { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::channel::v1::MsgRecvPacket as RawMsgRecvPacket; - use ibc_proto::ibc::core::client::v1::Height as RawHeight; + use core::{ops::Add, time::Duration}; + + use ibc_proto::ibc::core::{ + channel::v1::MsgRecvPacket as RawMsgRecvPacket, client::v1::Height as RawHeight, + }; - use crate::core::ics04_channel::packet::test_utils::get_dummy_raw_packet; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; - use crate::timestamp::Timestamp; - use core::ops::Add; - use core::time::Duration; + use crate::{ + core::ics04_channel::packet::test_utils::get_dummy_raw_packet, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + timestamp::Timestamp, + }; /// Returns a dummy `RawMsgRecvPacket`, for testing only! The `height` parametrizes both the /// proof height as well as the timeout height. @@ -120,14 +122,16 @@ pub mod test_util { #[cfg(test)] mod test { - use test_log::test; - use ibc_proto::ibc::core::channel::v1::MsgRecvPacket as RawMsgRecvPacket; + use test_log::test; - use crate::core::ics04_channel::error::Error; - use crate::core::ics04_channel::msgs::recv_packet::test_util::get_dummy_raw_msg_recv_packet; - use crate::core::ics04_channel::msgs::recv_packet::MsgRecvPacket; - use crate::test_utils::get_dummy_bech32_account; + use crate::{ + core::ics04_channel::{ + error::Error, + msgs::recv_packet::{test_util::get_dummy_raw_msg_recv_packet, MsgRecvPacket}, + }, + test_utils::get_dummy_bech32_account, + }; #[test] fn msg_recv_packet_try_from_raw() { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/timeout.rs b/crates/relayer-types/src/core/ics04_channel/msgs/timeout.rs index 7407bb9908..56348b1f23 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/timeout.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/timeout.rs @@ -1,12 +1,14 @@ -use ibc_proto::Protobuf; - -use ibc_proto::ibc::core::channel::v1::MsgTimeout as RawMsgTimeout; - -use crate::core::ics04_channel::error::Error; -use crate::core::ics04_channel::packet::{Packet, Sequence}; -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use ibc_proto::{ibc::core::channel::v1::MsgTimeout as RawMsgTimeout, Protobuf}; + +use crate::{ + core::ics04_channel::{ + error::Error, + packet::{Packet, Sequence}, + }, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgTimeout"; @@ -100,11 +102,14 @@ impl From for RawMsgTimeout { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::channel::v1::MsgTimeout as RawMsgTimeout; - use ibc_proto::ibc::core::client::v1::Height as RawHeight; + use ibc_proto::ibc::core::{ + channel::v1::MsgTimeout as RawMsgTimeout, client::v1::Height as RawHeight, + }; - use crate::core::ics04_channel::packet::test_utils::get_dummy_raw_packet; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + use crate::{ + core::ics04_channel::packet::test_utils::get_dummy_raw_packet, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; /// Returns a dummy `RawMsgTimeout`, for testing only! /// The `height` parametrizes both the proof height as well as the timeout height. @@ -129,14 +134,16 @@ pub mod test_util { #[cfg(test)] mod test { - use test_log::test; - use ibc_proto::ibc::core::channel::v1::MsgTimeout as RawMsgTimeout; + use test_log::test; - use crate::core::ics04_channel::error::Error; - use crate::core::ics04_channel::msgs::timeout::test_util::get_dummy_raw_msg_timeout; - use crate::core::ics04_channel::msgs::timeout::MsgTimeout; - use crate::test_utils::get_dummy_bech32_account; + use crate::{ + core::ics04_channel::{ + error::Error, + msgs::timeout::{test_util::get_dummy_raw_msg_timeout, MsgTimeout}, + }, + test_utils::get_dummy_bech32_account, + }; #[test] fn msg_timeout_try_from_raw() { diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs b/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs index 8d6fc5e970..ccc0ce13a0 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs @@ -1,11 +1,14 @@ -use ibc_proto::ibc::core::channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose; -use ibc_proto::Protobuf; - -use crate::core::ics04_channel::error::Error; -use crate::core::ics04_channel::packet::{Packet, Sequence}; -use crate::proofs::Proofs; -use crate::signer::Signer; -use crate::tx_msg::Msg; +use ibc_proto::{ibc::core::channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose, Protobuf}; + +use crate::{ + core::ics04_channel::{ + error::Error, + packet::{Packet, Sequence}, + }, + proofs::Proofs, + signer::Signer, + tx_msg::Msg, +}; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgTimeoutOnClose"; @@ -112,8 +115,9 @@ mod tests { use ibc_proto::ibc::core::channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose; use test_log::test; - use crate::core::ics04_channel::msgs::timeout_on_close::test_util::get_dummy_raw_msg_timeout_on_close; - use crate::core::ics04_channel::msgs::timeout_on_close::MsgTimeoutOnClose; + use crate::core::ics04_channel::msgs::timeout_on_close::{ + test_util::get_dummy_raw_msg_timeout_on_close, MsgTimeoutOnClose, + }; #[test] fn msg_timeout_on_close_try_from_raw() { @@ -195,11 +199,14 @@ mod tests { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose; - use ibc_proto::ibc::core::client::v1::Height as RawHeight; - - use crate::core::ics04_channel::packet::test_utils::get_dummy_raw_packet; - use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + use ibc_proto::ibc::core::{ + channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose, client::v1::Height as RawHeight, + }; + + use crate::{ + core::ics04_channel::packet::test_utils::get_dummy_raw_packet, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, + }; /// Returns a dummy `RawMsgTimeoutOnClose`, for testing only! /// The `height` parametrizes both the proof height as well as the timeout height. diff --git a/crates/relayer-types/src/core/ics04_channel/packet.rs b/crates/relayer-types/src/core/ics04_channel/packet.rs index 316227c08f..bb3fad0869 100644 --- a/crates/relayer-types/src/core/ics04_channel/packet.rs +++ b/crates/relayer-types/src/core/ics04_channel/packet.rs @@ -1,14 +1,17 @@ use std::str::FromStr; -use serde_derive::{Deserialize, Serialize}; - use ibc_proto::ibc::core::channel::v1::Packet as RawPacket; +use serde_derive::{Deserialize, Serialize}; use super::timeout::TimeoutHeight; -use crate::core::ics04_channel::error::Error; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; -use crate::timestamp::{Expiry::Expired, Timestamp}; -use crate::Height; +use crate::{ + core::{ + ics04_channel::error::Error, + ics24_host::identifier::{ChannelId, PortId}, + }, + timestamp::{Expiry::Expired, Timestamp}, + Height, +}; /// Enumeration of proof carrying ICS4 message, helper for relayer. #[derive(Clone, Debug, PartialEq, Eq)] @@ -273,8 +276,7 @@ impl From for RawPacket { #[cfg(test)] pub mod test_utils { - use ibc_proto::ibc::core::channel::v1::Packet as RawPacket; - use ibc_proto::ibc::core::client::v1::Height as RawHeight; + use ibc_proto::ibc::core::{channel::v1::Packet as RawPacket, client::v1::Height as RawHeight}; use crate::core::ics24_host::identifier::{ChannelId, PortId}; @@ -299,13 +301,10 @@ pub mod test_utils { #[cfg(test)] mod tests { + use ibc_proto::ibc::core::{channel::v1::Packet as RawPacket, client::v1::Height as RawHeight}; use test_log::test; - use ibc_proto::ibc::core::channel::v1::Packet as RawPacket; - use ibc_proto::ibc::core::client::v1::Height as RawHeight; - - use crate::core::ics04_channel::packet::test_utils::get_dummy_raw_packet; - use crate::core::ics04_channel::packet::Packet; + use crate::core::ics04_channel::packet::{test_utils::get_dummy_raw_packet, Packet}; #[test] fn packet_try_from_raw() { diff --git a/crates/relayer-types/src/core/ics04_channel/packet_id.rs b/crates/relayer-types/src/core/ics04_channel/packet_id.rs index d492d0a80a..e998811cdf 100644 --- a/crates/relayer-types/src/core/ics04_channel/packet_id.rs +++ b/crates/relayer-types/src/core/ics04_channel/packet_id.rs @@ -1,10 +1,11 @@ +use std::{convert::TryFrom, str::FromStr}; + use ibc_proto::ibc::core::channel::v1::PacketId as ProtoPacketId; -use std::convert::TryFrom; -use std::str::FromStr; -use crate::core::ics04_channel::error::Error; -use crate::core::ics04_channel::packet::Sequence; -use crate::core::ics24_host::identifier::{ChannelId, PortId}; +use crate::core::{ + ics04_channel::{error::Error, packet::Sequence}, + ics24_host::identifier::{ChannelId, PortId}, +}; #[derive(Debug, Clone)] pub struct PacketId { diff --git a/crates/relayer-types/src/core/ics04_channel/timeout.rs b/crates/relayer-types/src/core/ics04_channel/timeout.rs index aa33ec23b1..d1579ca828 100644 --- a/crates/relayer-types/src/core/ics04_channel/timeout.rs +++ b/crates/relayer-types/src/core/ics04_channel/timeout.rs @@ -1,8 +1,7 @@ use std::fmt::{Display, Error as FmtError, Formatter}; -use serde::{Deserialize, Serialize}; - use ibc_proto::ibc::core::client::v1::Height as RawHeight; +use serde::{Deserialize, Serialize}; use crate::core::ics02_client::{error::Error as ICS2Error, height::Height}; diff --git a/crates/relayer-types/src/core/ics04_channel/version.rs b/crates/relayer-types/src/core/ics04_channel/version.rs index 4d15ae3d4b..e584f2bec9 100644 --- a/crates/relayer-types/src/core/ics04_channel/version.rs +++ b/crates/relayer-types/src/core/ics04_channel/version.rs @@ -2,11 +2,14 @@ //! version field of a channel end. //! +use std::{ + convert::Infallible, + fmt::{Display, Error as FmtError, Formatter}, + str::FromStr, +}; + use serde_derive::{Deserialize, Serialize}; use serde_json as json; -use std::convert::Infallible; -use std::fmt::{Display, Error as FmtError, Formatter}; -use std::str::FromStr; use crate::applications::transfer; diff --git a/crates/relayer-types/src/core/ics23_commitment/commitment.rs b/crates/relayer-types/src/core/ics23_commitment/commitment.rs index 978f126df0..9fe5d555e2 100644 --- a/crates/relayer-types/src/core/ics23_commitment/commitment.rs +++ b/crates/relayer-types/src/core/ics23_commitment/commitment.rs @@ -1,14 +1,11 @@ -use serde::{Deserialize, Serialize}; use std::{convert::TryFrom, fmt}; -use subtle_encoding::{Encoding, Hex}; use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof; +use serde::{Deserialize, Serialize}; +use subtle_encoding::{Encoding, Hex}; -use crate::proofs::ProofError; -use crate::tx_msg::encode_message; - -use super::error::Error; -use super::merkle::MerkleProof; +use super::{error::Error, merkle::MerkleProof}; +use crate::{proofs::ProofError, tx_msg::encode_message}; #[derive(Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(transparent)] @@ -173,8 +170,9 @@ impl Serialize for CommitmentPrefix { #[cfg(test)] pub mod test_util { - use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof; - use ibc_proto::ics23::CommitmentProof; + use ibc_proto::{ + ibc::core::commitment::v1::MerkleProof as RawMerkleProof, ics23::CommitmentProof, + }; /// Returns a dummy `RawMerkleProof`, for testing only! pub fn get_dummy_merkle_proof() -> RawMerkleProof { diff --git a/crates/relayer-types/src/core/ics23_commitment/merkle.rs b/crates/relayer-types/src/core/ics23_commitment/merkle.rs index 64704c8bb2..5fdafa12c4 100644 --- a/crates/relayer-types/src/core/ics23_commitment/merkle.rs +++ b/crates/relayer-types/src/core/ics23_commitment/merkle.rs @@ -1,17 +1,15 @@ -use tendermint::merkle::proof::ProofOps as TendermintProof; - -use ibc_proto::ibc::core::commitment::v1::MerklePath; -use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof; -use ibc_proto::ibc::core::commitment::v1::MerkleRoot; -use ics23::commitment_proof::Proof; +use ibc_proto::ibc::core::commitment::v1::{MerklePath, MerkleProof as RawMerkleProof, MerkleRoot}; use ics23::{ - calculate_existence_root, verify_membership, verify_non_membership, CommitmentProof, - NonExistenceProof, + calculate_existence_root, commitment_proof::Proof, verify_membership, verify_non_membership, + CommitmentProof, NonExistenceProof, }; +use tendermint::merkle::proof::ProofOps as TendermintProof; -use crate::core::ics23_commitment::commitment::{CommitmentPrefix, CommitmentRoot}; -use crate::core::ics23_commitment::error::Error; -use crate::core::ics23_commitment::specs::ProofSpecs; +use crate::core::ics23_commitment::{ + commitment::{CommitmentPrefix, CommitmentRoot}, + error::Error, + specs::ProofSpecs, +}; pub fn apply_prefix(prefix: &CommitmentPrefix, mut path: Vec) -> MerklePath { let mut key_path: Vec = vec![format!("{prefix:?}")]; diff --git a/crates/relayer-types/src/core/ics24_host/identifier.rs b/crates/relayer-types/src/core/ics24_host/identifier.rs index e96bebfb01..e1ab7113d3 100644 --- a/crates/relayer-types/src/core/ics24_host/identifier.rs +++ b/crates/relayer-types/src/core/ics24_host/identifier.rs @@ -1,14 +1,14 @@ -use std::convert::{From, Infallible}; -use std::fmt::{Debug, Display, Error as FmtError, Formatter}; -use std::str::FromStr; +use std::{ + convert::{From, Infallible}, + fmt::{Debug, Display, Error as FmtError, Formatter}, + str::FromStr, +}; use regex::Regex; use serde::{Deserialize, Serialize}; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics24_host::error::ValidationError; - use super::validate::*; +use crate::core::{ics02_client::client_type::ClientType, ics24_host::error::ValidationError}; /// This type is subject to future changes. /// diff --git a/crates/relayer-types/src/core/ics24_host/path.rs b/crates/relayer-types/src/core/ics24_host/path.rs index 300982d929..492f9cd8d1 100644 --- a/crates/relayer-types/src/core/ics24_host/path.rs +++ b/crates/relayer-types/src/core/ics24_host/path.rs @@ -4,12 +4,14 @@ /// use std::str::FromStr; -use crate::core::ics04_channel::packet::Sequence; -use crate::core::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; - use derive_more::{Display, From}; use flex_error::define_error; +use crate::core::{ + ics04_channel::packet::Sequence, + ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}, +}; + /// ABCI Query path for the IBC sub-store pub const IBC_QUERY_PATH: &str = "store/ibc/key"; @@ -578,9 +580,10 @@ fn parse_upgrades(components: &[&str]) -> Option { #[cfg(test)] mod tests { - use super::*; use core::str::FromStr; + use super::*; + #[test] fn invalid_path_doesnt_parse() { let invalid_path = Path::from_str("clients/clientType"); diff --git a/crates/relayer-types/src/core/ics24_host/validate.rs b/crates/relayer-types/src/core/ics24_host/validate.rs index 347bd379a9..8c8fc446ae 100644 --- a/crates/relayer-types/src/core/ics24_host/validate.rs +++ b/crates/relayer-types/src/core/ics24_host/validate.rs @@ -75,11 +75,12 @@ pub fn validate_channel_identifier(id: &str) -> Result<(), Error> { #[cfg(test)] mod tests { + use test_log::test; + use crate::core::ics24_host::validate::{ validate_channel_identifier, validate_client_identifier, validate_connection_identifier, validate_identifier, validate_port_identifier, }; - use test_log::test; #[test] fn parse_invalid_port_id_min() { diff --git a/crates/relayer-types/src/core/ics26_routing/error.rs b/crates/relayer-types/src/core/ics26_routing/error.rs index f51581b6e0..12020f405c 100644 --- a/crates/relayer-types/src/core/ics26_routing/error.rs +++ b/crates/relayer-types/src/core/ics26_routing/error.rs @@ -1,9 +1,9 @@ use flex_error::{define_error, TraceError}; -use crate::applications::transfer; -use crate::core::ics02_client; -use crate::core::ics03_connection; -use crate::core::ics04_channel; +use crate::{ + applications::transfer, + core::{ics02_client, ics03_connection, ics04_channel}, +}; define_error! { #[derive(Debug, PartialEq, Eq)] diff --git a/crates/relayer-types/src/core/ics26_routing/msgs.rs b/crates/relayer-types/src/core/ics26_routing/msgs.rs index 68864ce23e..71d7536c4a 100644 --- a/crates/relayer-types/src/core/ics26_routing/msgs.rs +++ b/crates/relayer-types/src/core/ics26_routing/msgs.rs @@ -1,15 +1,17 @@ -use ibc_proto::google::protobuf::Any; +use ibc_proto::{google::protobuf::Any, Protobuf}; -use crate::core::ics02_client::msgs::{create_client, update_client, upgrade_client, ClientMsg}; -use crate::core::ics03_connection::msgs::{ - conn_open_ack, conn_open_confirm, conn_open_init, conn_open_try, ConnectionMsg, +use crate::core::{ + ics02_client::msgs::{create_client, update_client, upgrade_client, ClientMsg}, + ics03_connection::msgs::{ + conn_open_ack, conn_open_confirm, conn_open_init, conn_open_try, ConnectionMsg, + }, + ics04_channel::msgs::{ + acknowledgement, chan_close_confirm, chan_close_init, chan_open_ack, chan_open_confirm, + chan_open_init, chan_open_try, recv_packet, timeout, timeout_on_close, ChannelMsg, + PacketMsg, + }, + ics26_routing::error::Error, }; -use crate::core::ics04_channel::msgs::{ - acknowledgement, chan_close_confirm, chan_close_init, chan_open_ack, chan_open_confirm, - chan_open_init, chan_open_try, recv_packet, timeout, timeout_on_close, ChannelMsg, PacketMsg, -}; -use crate::core::ics26_routing::error::Error; -use ibc_proto::Protobuf; /// Enumeration of all messages that the local ICS26 module is capable of routing. #[derive(Clone, Debug)] diff --git a/crates/relayer-types/src/events.rs b/crates/relayer-types/src/events.rs index d1f85ea7fb..dd7ec33dd2 100644 --- a/crates/relayer-types/src/events.rs +++ b/crates/relayer-types/src/events.rs @@ -1,29 +1,37 @@ -use std::borrow::Cow; -use std::convert::TryFrom; -use std::fmt::{Display, Error as FmtError, Formatter}; -use std::str::FromStr; +use std::{ + borrow::Cow, + convert::TryFrom, + fmt::{Display, Error as FmtError, Formatter}, + str::FromStr, +}; use flex_error::{define_error, TraceError}; use serde_derive::{Deserialize, Serialize}; use tendermint::abci; -use crate::applications::ics29_fee::error::Error as FeeError; -use crate::applications::ics29_fee::events::{DistributeFeePacket, IncentivizedPacket}; -use crate::applications::ics31_icq::error::Error as QueryPacketError; -use crate::applications::ics31_icq::events::CrossChainQueryPacket; -use crate::core::ics02_client::error as client_error; -use crate::core::ics02_client::events as ClientEvents; -use crate::core::ics02_client::events::NewBlock; -use crate::core::ics03_connection::error as connection_error; -use crate::core::ics03_connection::events as ConnectionEvents; -use crate::core::ics03_connection::events::Attributes as ConnectionAttributes; -use crate::core::ics04_channel::error as channel_error; -use crate::core::ics04_channel::events as ChannelEvents; -use crate::core::ics04_channel::events::Attributes as ChannelAttributes; -use crate::core::ics04_channel::packet::Packet; -use crate::core::ics24_host::error::ValidationError; -use crate::timestamp::ParseTimestampError; -use crate::utils::pretty::PrettySlice; +use crate::{ + applications::{ + ics29_fee::{ + error::Error as FeeError, + events::{DistributeFeePacket, IncentivizedPacket}, + }, + ics31_icq::{error::Error as QueryPacketError, events::CrossChainQueryPacket}, + }, + core::{ + ics02_client::{error as client_error, events as ClientEvents, events::NewBlock}, + ics03_connection::{ + error as connection_error, events as ConnectionEvents, + events::Attributes as ConnectionAttributes, + }, + ics04_channel::{ + error as channel_error, events as ChannelEvents, + events::Attributes as ChannelAttributes, packet::Packet, + }, + ics24_host::error::ValidationError, + }, + timestamp::ParseTimestampError, + utils::pretty::PrettySlice, +}; define_error! { Error { diff --git a/crates/relayer-types/src/handler.rs b/crates/relayer-types/src/handler.rs index 781201912c..cc64b307e1 100644 --- a/crates/relayer-types/src/handler.rs +++ b/crates/relayer-types/src/handler.rs @@ -1,7 +1,7 @@ -use crate::events::IbcEvent; - use std::marker::PhantomData; +use crate::events::IbcEvent; + pub type HandlerResult = Result, E>; #[derive(Clone, Debug)] diff --git a/crates/relayer-types/src/mock/client_state.rs b/crates/relayer-types/src/mock/client_state.rs index c4081ab3bf..ab36271537 100644 --- a/crates/relayer-types/src/mock/client_state.rs +++ b/crates/relayer-types/src/mock/client_state.rs @@ -1,21 +1,16 @@ use std::time::Duration; +use ibc_proto::{google::protobuf::Any, ibc::mock::ClientState as RawMockClientState, Protobuf}; use serde::{Deserialize, Serialize}; -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::mock::ClientState as RawMockClientState; -use ibc_proto::Protobuf; - -use crate::core::ics02_client::client_state::ClientState; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::error::Error; - -use crate::core::ics24_host::identifier::ChainId; - -use crate::mock::consensus_state::MockConsensusState; -use crate::mock::header::MockHeader; - -use crate::Height; +use crate::{ + core::{ + ics02_client::{client_state::ClientState, client_type::ClientType, error::Error}, + ics24_host::identifier::ChainId, + }, + mock::{consensus_state::MockConsensusState, header::MockHeader}, + Height, +}; pub const MOCK_CLIENT_STATE_TYPE_URL: &str = "/ibc.mock.ClientState"; @@ -67,8 +62,9 @@ impl TryFrom for MockClientState { type Error = Error; fn try_from(raw: Any) -> Result { - use bytes::Buf; use core::ops::Deref; + + use bytes::Buf; use prost::Message; fn decode_client_state(buf: B) -> Result { diff --git a/crates/relayer-types/src/mock/consensus_state.rs b/crates/relayer-types/src/mock/consensus_state.rs index 0237d50074..cf3347338c 100644 --- a/crates/relayer-types/src/mock/consensus_state.rs +++ b/crates/relayer-types/src/mock/consensus_state.rs @@ -1,14 +1,16 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::mock::ConsensusState as RawMockConsensusState; -use ibc_proto::Protobuf; +use ibc_proto::{ + google::protobuf::Any, ibc::mock::ConsensusState as RawMockConsensusState, Protobuf, +}; use serde::{Deserialize, Serialize}; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::consensus_state::ConsensusState; -use crate::core::ics02_client::error::Error; -use crate::core::ics23_commitment::commitment::CommitmentRoot; -use crate::mock::header::MockHeader; -use crate::timestamp::Timestamp; +use crate::{ + core::{ + ics02_client::{client_type::ClientType, consensus_state::ConsensusState, error::Error}, + ics23_commitment::commitment::CommitmentRoot, + }, + mock::header::MockHeader, + timestamp::Timestamp, +}; pub const MOCK_CONSENSUS_STATE_TYPE_URL: &str = "/ibc.mock.ConsensusState"; @@ -63,8 +65,9 @@ impl TryFrom for MockConsensusState { type Error = Error; fn try_from(raw: Any) -> Result { - use bytes::Buf; use core::ops::Deref; + + use bytes::Buf; use prost::Message; fn decode_consensus_state(buf: B) -> Result { diff --git a/crates/relayer-types/src/mock/header.rs b/crates/relayer-types/src/mock/header.rs index 2f5c931201..700fb168f7 100644 --- a/crates/relayer-types/src/mock/header.rs +++ b/crates/relayer-types/src/mock/header.rs @@ -1,15 +1,13 @@ use std::fmt::{Display, Error as FmtError, Formatter}; -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::mock::Header as RawMockHeader; -use ibc_proto::Protobuf; +use ibc_proto::{google::protobuf::Any, ibc::mock::Header as RawMockHeader, Protobuf}; use serde_derive::{Deserialize, Serialize}; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::error::Error; -use crate::core::ics02_client::header::Header; -use crate::timestamp::Timestamp; -use crate::Height; +use crate::{ + core::ics02_client::{client_type::ClientType, error::Error, header::Header}, + timestamp::Timestamp, + Height, +}; pub const MOCK_HEADER_TYPE_URL: &str = "/ibc.mock.Header"; @@ -121,9 +119,10 @@ impl From for Any { #[cfg(test)] mod tests { - use super::*; use ibc_proto::Protobuf; + use super::*; + #[test] fn encode_any() { let header = MockHeader::new(Height::new(1, 10).unwrap()).with_timestamp(Timestamp::none()); diff --git a/crates/relayer-types/src/mock/misbehaviour.rs b/crates/relayer-types/src/mock/misbehaviour.rs index 17e303940c..b53cfd667d 100644 --- a/crates/relayer-types/src/mock/misbehaviour.rs +++ b/crates/relayer-types/src/mock/misbehaviour.rs @@ -1,11 +1,11 @@ -use ibc_proto::ibc::mock::Misbehaviour as RawMisbehaviour; -use ibc_proto::Protobuf; +use ibc_proto::{ibc::mock::Misbehaviour as RawMisbehaviour, Protobuf}; use serde::{Deserialize, Serialize}; -use crate::core::ics02_client::error::Error; -use crate::core::ics24_host::identifier::ClientId; -use crate::mock::header::MockHeader; -use crate::Height; +use crate::{ + core::{ics02_client::error::Error, ics24_host::identifier::ClientId}, + mock::header::MockHeader, + Height, +}; pub const MOCK_MISBEHAVIOUR_TYPE_URL: &str = "/ibc.mock.Misbehavior"; diff --git a/crates/relayer-types/src/proofs.rs b/crates/relayer-types/src/proofs.rs index 945cafbd6e..97a8795771 100644 --- a/crates/relayer-types/src/proofs.rs +++ b/crates/relayer-types/src/proofs.rs @@ -2,8 +2,7 @@ use flex_error::{define_error, TraceError}; use prost::EncodeError; use serde::Serialize; -use crate::core::ics23_commitment::commitment::CommitmentProofBytes; -use crate::Height; +use crate::{core::ics23_commitment::commitment::CommitmentProofBytes, Height}; define_error! { #[derive(Debug, PartialEq, Eq)] diff --git a/crates/relayer-types/src/serializers.rs b/crates/relayer-types/src/serializers.rs index da3cce68d1..e1eaea366c 100644 --- a/crates/relayer-types/src/serializers.rs +++ b/crates/relayer-types/src/serializers.rs @@ -12,8 +12,7 @@ where pub mod serde_string { - use core::fmt::Display; - use core::str::FromStr; + use core::{fmt::Display, str::FromStr}; use serde::{de, Deserialize, Deserializer, Serializer}; diff --git a/crates/relayer-types/src/test.rs b/crates/relayer-types/src/test.rs index b6a9cb1f34..373a052929 100644 --- a/crates/relayer-types/src/test.rs +++ b/crates/relayer-types/src/test.rs @@ -1,4 +1,5 @@ use core::fmt::Debug; + use serde::{de::DeserializeOwned, Serialize}; /// Test that a struct `T` can be: diff --git a/crates/relayer-types/src/timestamp.rs b/crates/relayer-types/src/timestamp.rs index 0b137368ff..a3f2950167 100644 --- a/crates/relayer-types/src/timestamp.rs +++ b/crates/relayer-types/src/timestamp.rs @@ -1,9 +1,11 @@ -use std::fmt::{Display, Error as FmtError, Formatter}; -use std::hash::Hash; -use std::num::ParseIntError; -use std::ops::{Add, Sub}; -use std::str::FromStr; -use std::time::Duration; +use std::{ + fmt::{Display, Error as FmtError, Formatter}, + hash::Hash, + num::ParseIntError, + ops::{Add, Sub}, + str::FromStr, + time::Duration, +}; use flex_error::{define_error, TraceError}; use serde_derive::{Deserialize, Serialize}; @@ -233,11 +235,11 @@ impl From