From a102297dc60b47d35518ab006a23b4e4b6a68324 Mon Sep 17 00:00:00 2001 From: Sammy Date: Mon, 9 Dec 2024 21:52:07 -0500 Subject: [PATCH] fix fmt --- Cargo.toml | 2 ++ ampd/Cargo.toml | 4 ++-- contracts/gateway/Cargo.toml | 2 +- contracts/multisig-prover/Cargo.toml | 2 +- contracts/multisig-prover/src/encoding/bcs.rs | 3 ++- .../multisig-prover/src/test/test_utils.rs | 5 ++--- contracts/multisig/Cargo.toml | 6 +++--- contracts/rewards/src/contract/execute.rs | 20 +++++++++++++++---- integration-tests/tests/bond_unbond.rs | 3 ++- .../tests/chain_freeze_unfreeze.rs | 3 ++- integration-tests/tests/message_routing.rs | 3 ++- packages/axelar-wasm-std/src/snapshot.rs | 3 ++- packages/axelar-wasm-std/src/voting.rs | 3 ++- packages/evm-gateway/src/lib.rs | 3 ++- 14 files changed, 41 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 48a85615f..95e51e6b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,10 +24,12 @@ bcs = "0.1.5" bech32 = "0.11.0" client = { version = "^1.0.0", path = "packages/client" } coordinator = { version = "^1.1.0", path = "contracts/coordinator" } +cosmwasm-crypto = "2.1.4" cosmwasm-schema = "2.1.4" cosmwasm-std = "2.1.4" cw-multi-test = "2.2.0" cw-storage-plus = { version = "2.0.0", features = ["iterator", "macro"] } +cw-utils = "2.0.0" cw2 = "2.0.0" ed25519-dalek = { version = "2.1.1", default-features = false } error-stack = { version = "0.4.0", features = ["eyre"] } diff --git a/ampd/Cargo.toml b/ampd/Cargo.toml index 2eab635b5..901ea24b4 100644 --- a/ampd/Cargo.toml +++ b/ampd/Cargo.toml @@ -83,16 +83,16 @@ valuable-serde = { version = "0.1.0", features = ["std"] } voting-verifier = { workspace = true } [dev-dependencies] +assert_ok = { workspace = true } ed25519-dalek = { workspace = true, features = ["rand_core"] } elliptic-curve = "0.13.5" faux = "0.1.10" generic-array = "0.14.7" +goldie = { workspace = true } multisig = { workspace = true, features = ["test", "library"] } rand = { workspace = true } random-string = "1.0.0" tokio = { workspace = true, features = ["test-util"] } -goldie = { workspace = true } -assert_ok = { workspace = true } [build-dependencies] tonic-build = "0.8.3" diff --git a/contracts/gateway/Cargo.toml b/contracts/gateway/Cargo.toml index 007f3f8c3..0f2f89f8f 100644 --- a/contracts/gateway/Cargo.toml +++ b/contracts/gateway/Cargo.toml @@ -50,8 +50,8 @@ voting-verifier = { workspace = true, features = ["library"] } [dev-dependencies] cw-multi-test = { workspace = true } -rand = { workspace = true } goldie = { workspace = true } +rand = { workspace = true } [lints] workspace = true diff --git a/contracts/multisig-prover/Cargo.toml b/contracts/multisig-prover/Cargo.toml index e95b222a4..58aa80646 100644 --- a/contracts/multisig-prover/Cargo.toml +++ b/contracts/multisig-prover/Cargo.toml @@ -37,7 +37,7 @@ coordinator = { workspace = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-storage-plus = { workspace = true } -cw-utils = "2.0.0" +cw-utils = { workspace = true } cw2 = { workspace = true } error-stack = { workspace = true } ethers-contract = { workspace = true } diff --git a/contracts/multisig-prover/src/encoding/bcs.rs b/contracts/multisig-prover/src/encoding/bcs.rs index 9ef24dcc1..d650548e6 100644 --- a/contracts/multisig-prover/src/encoding/bcs.rs +++ b/contracts/multisig-prover/src/encoding/bcs.rs @@ -107,7 +107,8 @@ where #[cfg(test)] mod tests { use axelar_wasm_std::hash::Hash; - use cosmwasm_std::{testing::MockApi, HexBinary, Uint128}; + use cosmwasm_std::testing::MockApi; + use cosmwasm_std::{HexBinary, Uint128}; use multisig::key::KeyType; use multisig::msg::Signer; use multisig::verifier_set::VerifierSet; diff --git a/contracts/multisig-prover/src/test/test_utils.rs b/contracts/multisig-prover/src/test/test_utils.rs index 9a8f21fb9..f5933d325 100644 --- a/contracts/multisig-prover/src/test/test_utils.rs +++ b/contracts/multisig-prover/src/test/test_utils.rs @@ -1,7 +1,6 @@ use axelar_wasm_std::VerificationStatus; -use cosmwasm_std::{ - from_json, testing::MockApi, to_json_binary, QuerierResult, Uint128, WasmQuery, -}; +use cosmwasm_std::testing::MockApi; +use cosmwasm_std::{from_json, to_json_binary, QuerierResult, Uint128, WasmQuery}; use multisig::msg::Signer; use multisig::multisig::Multisig; use multisig::types::MultisigState; diff --git a/contracts/multisig/Cargo.toml b/contracts/multisig/Cargo.toml index cc4091925..f54e40ee2 100644 --- a/contracts/multisig/Cargo.toml +++ b/contracts/multisig/Cargo.toml @@ -39,11 +39,11 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] axelar-wasm-std = { workspace = true, features = ["derive"] } client = { workspace = true } -cosmwasm-crypto = "2.1.4" +cosmwasm-crypto = { workspace = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-storage-plus = { workspace = true } -cw-utils = "2.0.0" +cw-utils = { workspace = true } cw2 = { workspace = true } ed25519-dalek = { workspace = true } enum-display-derive = "0.1.1" @@ -63,8 +63,8 @@ thiserror = { workspace = true } [dev-dependencies] curve25519-dalek = "4.1.3" -ed25519-dalek = { workspace = true, features = ["digest", "rand_core"] } cw-multi-test = { workspace = true } +ed25519-dalek = { workspace = true, features = ["digest", "rand_core"] } goldie = { workspace = true } hex = "0.4" diff --git a/contracts/rewards/src/contract/execute.rs b/contracts/rewards/src/contract/execute.rs index ac6d0bcb0..11351c2fc 100644 --- a/contracts/rewards/src/contract/execute.rs +++ b/contracts/rewards/src/contract/execute.rs @@ -926,9 +926,18 @@ mod test { ); // a vector of (contract, rewards amounts) pairs let test_data = vec![ - (MockApi::default().addr_make("contract_1"), vec![100, 200, 50]), - (MockApi::default().addr_make("contract_2"), vec![25, 500, 70]), - (MockApi::default().addr_make("contract_3"), vec![1000, 500, 2000]), + ( + MockApi::default().addr_make("contract_1"), + vec![100, 200, 50], + ), + ( + MockApi::default().addr_make("contract_2"), + vec![25, 500, 70], + ), + ( + MockApi::default().addr_make("contract_3"), + vec![1000, 500, 2000], + ), ]; let chain_name: ChainName = "mock-chain".parse().unwrap(); @@ -1088,7 +1097,10 @@ mod test { }, ]; - let verifiers = [MockApi::default().addr_make("verifier-1"), MockApi::default().addr_make("verifier-2")]; + let verifiers = [ + MockApi::default().addr_make("verifier-1"), + MockApi::default().addr_make("verifier-2"), + ]; // simulate two verifiers each participating in two pools // the first verifier participates in 2 events, and the second in 3 events (out of a total of 3 events) diff --git a/integration-tests/tests/bond_unbond.rs b/integration-tests/tests/bond_unbond.rs index bc8646731..54ad87f00 100644 --- a/integration-tests/tests/bond_unbond.rs +++ b/integration-tests/tests/bond_unbond.rs @@ -1,4 +1,5 @@ -use cosmwasm_std::{testing::MockApi, BlockInfo}; +use cosmwasm_std::testing::MockApi; +use cosmwasm_std::BlockInfo; use integration_tests::contract::Contract; use service_registry_api::msg::ExecuteMsg; diff --git a/integration-tests/tests/chain_freeze_unfreeze.rs b/integration-tests/tests/chain_freeze_unfreeze.rs index f3717c3a3..d2987c410 100644 --- a/integration-tests/tests/chain_freeze_unfreeze.rs +++ b/integration-tests/tests/chain_freeze_unfreeze.rs @@ -1,4 +1,5 @@ -use cosmwasm_std::{testing::MockApi, HexBinary}; +use cosmwasm_std::testing::MockApi; +use cosmwasm_std::HexBinary; use integration_tests::contract::Contract; use router_api::{CrossChainId, Message}; diff --git a/integration-tests/tests/message_routing.rs b/integration-tests/tests/message_routing.rs index e170a22f2..f242870a5 100644 --- a/integration-tests/tests/message_routing.rs +++ b/integration-tests/tests/message_routing.rs @@ -1,4 +1,5 @@ -use cosmwasm_std::{testing::MockApi, HexBinary, Uint128}; +use cosmwasm_std::testing::MockApi; +use cosmwasm_std::{HexBinary, Uint128}; use integration_tests::contract::Contract; use router_api::{CrossChainId, Message}; diff --git a/packages/axelar-wasm-std/src/snapshot.rs b/packages/axelar-wasm-std/src/snapshot.rs index ec7413753..7a729ca77 100644 --- a/packages/axelar-wasm-std/src/snapshot.rs +++ b/packages/axelar-wasm-std/src/snapshot.rs @@ -60,7 +60,8 @@ impl Snapshot { #[cfg(test)] mod tests { - use cosmwasm_std::{from_json, testing::MockApi, to_json_binary, Uint64}; + use cosmwasm_std::testing::MockApi; + use cosmwasm_std::{from_json, to_json_binary, Uint64}; use super::*; use crate::Threshold; diff --git a/packages/axelar-wasm-std/src/voting.rs b/packages/axelar-wasm-std/src/voting.rs index 8fb29a74d..5c63b0a65 100644 --- a/packages/axelar-wasm-std/src/voting.rs +++ b/packages/axelar-wasm-std/src/voting.rs @@ -400,7 +400,8 @@ impl WeightedPoll { #[cfg(test)] mod tests { - use cosmwasm_std::{testing::MockApi, Addr, Uint64}; + use cosmwasm_std::testing::MockApi; + use cosmwasm_std::{Addr, Uint64}; use rand::distributions::Alphanumeric; use rand::Rng; diff --git a/packages/evm-gateway/src/lib.rs b/packages/evm-gateway/src/lib.rs index 6cf36fd28..4a8ab5788 100644 --- a/packages/evm-gateway/src/lib.rs +++ b/packages/evm-gateway/src/lib.rs @@ -147,7 +147,8 @@ mod test { use axelar_wasm_std::nonempty; use axelar_wasm_std::snapshot::Participant; - use cosmwasm_std::{testing::MockApi, HexBinary, Uint128}; + use cosmwasm_std::testing::MockApi; + use cosmwasm_std::{HexBinary, Uint128}; use multisig::key::PublicKey; use multisig::verifier_set::VerifierSet; use router_api::{CrossChainId, Message as RouterMessage};