From 42f5eb9464650bc1e7a16b5931c2b4affdbb88f6 Mon Sep 17 00:00:00 2001 From: zerosnacks <95942363+zerosnacks@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:08:14 +0100 Subject: [PATCH 1/2] chore(deps): prefer soft pinning on minor version for dependencies (#9269) * soft-pin on minor version, prefer workspace * use workspace * prefer workspace --- Cargo.lock | 68 +++++++++++++++---------------- Cargo.toml | 34 ++++++++-------- crates/anvil/Cargo.toml | 4 +- crates/anvil/core/Cargo.toml | 4 +- crates/anvil/server/Cargo.toml | 2 +- crates/cast/Cargo.toml | 2 +- crates/cheatcodes/Cargo.toml | 6 +-- crates/cheatcodes/spec/Cargo.toml | 2 +- crates/chisel/Cargo.toml | 2 +- crates/cli/Cargo.toml | 2 +- crates/config/Cargo.toml | 8 ++-- crates/doc/Cargo.toml | 2 +- crates/forge/Cargo.toml | 8 ++-- crates/macros/Cargo.toml | 6 +-- crates/script/Cargo.toml | 2 +- crates/test-utils/Cargo.toml | 6 +-- crates/verify/Cargo.toml | 2 +- crates/wallets/Cargo.toml | 4 +- 18 files changed, 83 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73a15ac8c..2bfdbb92f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,9 +123,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5228b189b18b85761340dc9eaac0141148a8503657b36f9bc3a869413d987ca" +checksum = "85132f2698b520fab3f54beed55a44389f7006a7b557a0261e1e69439dcc1572" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -201,9 +201,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a0f0d51db8a1a30a4d98a9f90e090a94c8f44cb4d9eafc7e03aa6d00aae984" +checksum = "ded610181f3dad5810f6ff12d1a99994cf9b42d2fcb7709029352398a5da5ae6" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -261,9 +261,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8edae627382349b56cd6a7a2106f4fd69b243a9233e560c55c2e03cabb7e1d3c" +checksum = "fd58d377699e6cfeab52c4a9d28bdc4ef37e2bd235ff2db525071fe37a2e9af5" dependencies = [ "alloy-rlp", "arbitrary", @@ -274,7 +274,7 @@ dependencies = [ "derive_more", "foldhash", "getrandom", - "hashbrown 0.15.0", + "hashbrown 0.15.1", "hex-literal", "indexmap 2.6.0", "itoa", @@ -611,9 +611,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841eabaa4710f719fddbc24c95d386eae313f07e6da4babc25830ee37945be0c" +checksum = "8a1b42ac8f45e2f49f4bcdd72cbfde0bb148f5481d403774ffa546e48b83efc1" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -625,9 +625,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6672337f19d837b9f7073c45853aeb528ed9f7dd6a4154ce683e9e5cb7794014" +checksum = "06318f1778e57f36333e850aa71bd1bb5e560c10279e236622faae0470c50412" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", @@ -644,9 +644,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dff37dd20bfb118b777c96eda83b2067f4226d2644c5cfa00187b3bc01770ba" +checksum = "eaebb9b0ad61a41345a22c9279975c0cdd231b97947b10d7aad1cf0a7181e4a5" dependencies = [ "alloy-json-abi", "const-hex", @@ -661,9 +661,9 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b853d42292dbb159671a3edae3b2750277ff130f32b726fe07dc2b17aa6f2b5" +checksum = "12c71028bfbfec210e24106a542aad3def7caf1a70e2c05710e92a98481980d3" dependencies = [ "serde", "winnow", @@ -671,9 +671,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa828bb1b9a6dc52208fbb18084fb9ce2c30facc2bfda6a5d922349b4990354f" +checksum = "374d7fb042d68ddfe79ccb23359de3007f6d4d53c13f703b64fb0db422132111" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -801,9 +801,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.17" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -1998,9 +1998,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.34" +version = "1.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b9470d453346108f93a59222a9a1a5724db32d0a4727b7ab7ace4b4d822dc9" +checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" dependencies = [ "shlex", ] @@ -4707,9 +4707,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" dependencies = [ "allocator-api2", "equivalent", @@ -5148,7 +5148,7 @@ checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "arbitrary", "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.1", "serde", ] @@ -5551,7 +5551,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.0", + "hashbrown 0.15.1", ] [[package]] @@ -7449,9 +7449,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.38" +version = "0.38.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" +checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" dependencies = [ "bitflags 2.6.0", "errno", @@ -8409,9 +8409,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16320d4a2021ba1a32470b3759676114a918885e9800e68ad60f2c67969fba62" +checksum = "edf42e81491fb8871b74df3d222c64ae8cbc1269ea509fa768a3ed3e1b0ac8cb" dependencies = [ "paste", "proc-macro2", @@ -8517,18 +8517,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" +checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" +checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", @@ -9529,7 +9529,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 80e7945d5..937419325 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -205,17 +205,17 @@ alloy-transport-ipc = { version = "0.5.4", default-features = false } alloy-transport-ws = { version = "0.5.4", default-features = false } ## alloy-core -alloy-dyn-abi = "0.8.9" -alloy-json-abi = "0.8.9" -alloy-primitives = { version = "0.8.9", features = [ +alloy-dyn-abi = "0.8.11" +alloy-json-abi = "0.8.11" +alloy-primitives = { version = "0.8.11", features = [ "getrandom", "rand", "map-foldhash", ] } -alloy-sol-macro-expander = "0.8.9" -alloy-sol-macro-input = "0.8.9" -alloy-sol-types = "0.8.9" -syn-solidity = "0.8.9" +alloy-sol-macro-expander = "0.8.11" +alloy-sol-macro-input = "0.8.11" +alloy-sol-types = "0.8.11" +syn-solidity = "0.8.11" alloy-chains = "0.1" alloy-rlp = "0.3" @@ -226,12 +226,12 @@ op-alloy-rpc-types = "0.5.0" op-alloy-consensus = "0.5.0" ## cli -anstream = "0.6.15" -anstyle = "1.0.8" +anstream = "0.6" +anstyle = "1.0" terminal_size = "0.4" # macros -proc-macro2 = "1.0.82" +proc-macro2 = "1.0" quote = "1.0" syn = "2.0" async-trait = "0.1" @@ -243,8 +243,9 @@ divan = "0.1" # misc auto_impl = "1" +bytes = "1.8" walkdir = "2" -prettyplease = "0.2.20" +prettyplease = "0.2" ahash = "0.8" base64 = "0.22" chrono = { version = "0.4", default-features = false, features = [ @@ -260,25 +261,26 @@ evmole = "0.5" eyre = "0.6" figment = "0.10" futures = "0.3" -hyper = "1.0" -indexmap = "2.2" +hyper = "1.5" +indexmap = "2.6" itertools = "0.13" jsonpath_lib = "0.3" k256 = "0.13" mesc = "0.3" -num-format = "0.4.4" +num-format = "0.4" parking_lot = "0.12" proptest = "1" rand = "0.8" rayon = "1" +regex = { version = "1", default-features = false } reqwest = { version = "0.12", default-features = false } semver = "1" serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["arbitrary_precision"] } -similar-asserts = "1.5" +similar-asserts = "1.6" soldeer-commands = "=0.4.1" strum = "0.26" -tempfile = "3.10" +tempfile = "3.13" tikv-jemallocator = "0.6" tokio = "1" toml = "0.8" diff --git a/crates/anvil/Cargo.toml b/crates/anvil/Cargo.toml index 922cb6efc..4c3cbc4f7 100644 --- a/crates/anvil/Cargo.toml +++ b/crates/anvil/Cargo.toml @@ -36,7 +36,7 @@ foundry-config.workspace = true foundry-evm.workspace = true # evm support -bytes = "1.4.0" +bytes.workspace = true k256.workspace = true revm = { workspace = true, features = [ "std", @@ -93,7 +93,7 @@ thiserror.workspace = true yansi.workspace = true tempfile.workspace = true itertools.workspace = true -rand = "0.8" +rand.workspace = true eyre.workspace = true # cli diff --git a/crates/anvil/core/Cargo.toml b/crates/anvil/core/Cargo.toml index da337c62d..dcf8bf508 100644 --- a/crates/anvil/core/Cargo.toml +++ b/crates/anvil/core/Cargo.toml @@ -34,10 +34,10 @@ op-alloy-consensus.workspace = true serde = { workspace = true, optional = true } serde_json.workspace = true -bytes = "1.4" +bytes.workspace = true # misc -rand = "0.8" +rand.workspace = true thiserror.workspace = true [features] diff --git a/crates/anvil/server/Cargo.toml b/crates/anvil/server/Cargo.toml index 282e09013..c8856939c 100644 --- a/crates/anvil/server/Cargo.toml +++ b/crates/anvil/server/Cargo.toml @@ -29,7 +29,7 @@ futures.workspace = true # ipc interprocess = { version = "2", optional = true, features = ["tokio"] } -bytes = { version = "1.4", optional = true } +bytes = { workspace = true, optional = true } tokio-util = { version = "0.7", features = ["codec"], optional = true } # misc diff --git a/crates/cast/Cargo.toml b/crates/cast/Cargo.toml index 4e6b001ec..0887649e5 100644 --- a/crates/cast/Cargo.toml +++ b/crates/cast/Cargo.toml @@ -79,7 +79,7 @@ comfy-table.workspace = true dunce.workspace = true indicatif = "0.17" itertools.workspace = true -regex = { version = "1", default-features = false } +regex = { workspace = true, default-features = false } rpassword = "7" semver.workspace = true tempfile.workspace = true diff --git a/crates/cheatcodes/Cargo.toml b/crates/cheatcodes/Cargo.toml index 00d73ec4d..97b22b16f 100644 --- a/crates/cheatcodes/Cargo.toml +++ b/crates/cheatcodes/Cargo.toml @@ -49,15 +49,15 @@ alloy-rlp.workspace = true base64.workspace = true chrono.workspace = true -dialoguer = "0.11.0" +dialoguer = "0.11" eyre.workspace = true itertools.workspace = true jsonpath_lib.workspace = true k256.workspace = true memchr = "2.7" -p256 = "0.13.2" +p256 = "0.13" ecdsa = "0.16" -rand = "0.8" +rand.workspace = true revm.workspace = true revm-inspectors.workspace = true semver.workspace = true diff --git a/crates/cheatcodes/spec/Cargo.toml b/crates/cheatcodes/spec/Cargo.toml index 738bb62b7..458f6b730 100644 --- a/crates/cheatcodes/spec/Cargo.toml +++ b/crates/cheatcodes/spec/Cargo.toml @@ -20,7 +20,7 @@ alloy-sol-types = { workspace = true, features = ["json"] } serde.workspace = true # schema -schemars = { version = "0.8.15", optional = true } +schemars = { version = "0.8", optional = true } [dev-dependencies] serde_json.workspace = true diff --git a/crates/chisel/Cargo.toml b/crates/chisel/Cargo.toml index 7868137d8..65b3c9748 100644 --- a/crates/chisel/Cargo.toml +++ b/crates/chisel/Cargo.toml @@ -50,7 +50,7 @@ alloy-rpc-types.workspace = true clap = { version = "4", features = ["derive", "env", "wrap_help"] } dirs = "5" eyre.workspace = true -regex = "1" +regex.workspace = true reqwest.workspace = true revm.workspace = true rustyline = "14" diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index bab56495a..9fa867db3 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -37,7 +37,7 @@ dotenvy = "0.15" eyre.workspace = true futures.workspace = true indicatif = "0.17" -regex = { version = "1", default-features = false } +regex = { workspace = true, default-features = false } serde.workspace = true strsim = "0.11" strum = { workspace = true, features = ["derive"] } diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index ec1894fb2..3e6815d78 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -32,21 +32,21 @@ glob = "0.3" Inflector = "0.11" number_prefix = "0.4" mesc.workspace = true -regex = "1" +regex.workspace = true reqwest.workspace = true semver = { workspace = true, features = ["serde"] } serde_json.workspace = true serde_regex = "1" serde.workspace = true thiserror.workspace = true -toml = { version = "0.8", features = ["preserve_order"] } -toml_edit = "0.22.4" +toml = { workspace = true, features = ["preserve_order"] } +toml_edit = "0.22" tracing.workspace = true walkdir.workspace = true yansi.workspace = true [target.'cfg(target_os = "windows")'.dependencies] -path-slash = "0.2.1" +path-slash = "0.2" [dev-dependencies] similar-asserts.workspace = true diff --git a/crates/doc/Cargo.toml b/crates/doc/Cargo.toml index 3ebc7f8da..00223eb27 100644 --- a/crates/doc/Cargo.toml +++ b/crates/doc/Cargo.toml @@ -31,4 +31,4 @@ solang-parser.workspace = true thiserror.workspace = true toml.workspace = true tracing.workspace = true -regex = "1.10.2" +regex.workspace = true diff --git a/crates/forge/Cargo.toml b/crates/forge/Cargo.toml index f85a08d69..b32a9bd41 100644 --- a/crates/forge/Cargo.toml +++ b/crates/forge/Cargo.toml @@ -80,10 +80,10 @@ dialoguer = { version = "0.11", default-features = false } dunce.workspace = true futures.workspace = true indicatif = "0.17" -inferno = { version = "0.11.19", default-features = false } +inferno = { version = "0.11", default-features = false } itertools.workspace = true parking_lot.workspace = true -regex = { version = "1", default-features = false } +regex = { workspace = true, default-features = false } reqwest = { workspace = true, features = ["json"] } semver.workspace = true serde_json.workspace = true @@ -92,8 +92,8 @@ solang-parser.workspace = true strum = { workspace = true, features = ["derive"] } thiserror.workspace = true tokio = { workspace = true, features = ["time"] } -toml = { version = "0.8", features = ["preserve_order"] } -toml_edit = "0.22.4" +toml = { workspace = true, features = ["preserve_order"] } +toml_edit = "0.22" watchexec = "4.1" watchexec-events = "3.0" watchexec-signals = "3.0" diff --git a/crates/macros/Cargo.toml b/crates/macros/Cargo.toml index 671d37be8..98dc669f1 100644 --- a/crates/macros/Cargo.toml +++ b/crates/macros/Cargo.toml @@ -19,7 +19,7 @@ test = false doc = false [dependencies] -proc-macro2 = "1.0" -quote = "1.0" -syn = "2.0" +proc-macro2.workspace = true +quote.workspace = true +syn.workspace = true proc-macro-error = "1" diff --git a/crates/script/Cargo.toml b/crates/script/Cargo.toml index 0d4810da6..e1a6428d9 100644 --- a/crates/script/Cargo.toml +++ b/crates/script/Cargo.toml @@ -35,7 +35,7 @@ clap = { version = "4", features = ["derive", "env", "unicode", "wrap_help"] } semver.workspace = true futures.workspace = true tokio.workspace = true -async-recursion = "1.0.5" +async-recursion = "1.1" itertools.workspace = true parking_lot.workspace = true diff --git a/crates/test-utils/Cargo.toml b/crates/test-utils/Cargo.toml index 6e5e900ce..11b7800e6 100644 --- a/crates/test-utils/Cargo.toml +++ b/crates/test-utils/Cargo.toml @@ -23,14 +23,14 @@ alloy-primitives.workspace = true alloy-provider.workspace = true eyre.workspace = true -fd-lock = "4.0.0" +fd-lock = "4.0" parking_lot.workspace = true -regex = "1" +regex.workspace = true serde_json.workspace = true tracing.workspace = true tracing-subscriber = { workspace = true, features = ["env-filter"] } rand.workspace = true -snapbox = { version = "0.6.9", features = ["json", "regex"] } +snapbox = { version = "0.6", features = ["json", "regex"] } [dev-dependencies] tokio.workspace = true diff --git a/crates/verify/Cargo.toml b/crates/verify/Cargo.toml index 4512d7801..443d44cc1 100644 --- a/crates/verify/Cargo.toml +++ b/crates/verify/Cargo.toml @@ -36,7 +36,7 @@ reqwest = { workspace = true, features = ["json"] } async-trait.workspace = true futures.workspace = true semver.workspace = true -regex = { version = "1", default-features = false } +regex = { workspace = true, default-features = false } yansi.workspace = true itertools.workspace = true diff --git a/crates/wallets/Cargo.toml b/crates/wallets/Cargo.toml index 8f6b606b4..0de57f095 100644 --- a/crates/wallets/Cargo.toml +++ b/crates/wallets/Cargo.toml @@ -27,7 +27,7 @@ alloy-dyn-abi.workspace = true # aws-kms alloy-signer-aws = { workspace = true, features = ["eip712"], optional = true } -aws-config = { version = "1", optional = true } # default-features are necessary +aws-config = { version = "1", optional = true } # default-features are necessary aws-sdk-kms = { version = "1", default-features = false, optional = true } # gcp-kms @@ -39,7 +39,7 @@ gcloud-sdk = { version = "0.25", features = [ async-trait.workspace = true clap = { version = "4", features = ["derive", "env", "unicode", "wrap_help"] } -derive_builder = "0.20.0" +derive_builder = "0.20" eyre.workspace = true rpassword = "7" serde.workspace = true From 58bf161bc9dd6e74de8cb61e3ae23f701feb5512 Mon Sep 17 00:00:00 2001 From: grandizzy <38490174+grandizzy@users.noreply.github.com> Date: Wed, 6 Nov 2024 18:08:19 +0200 Subject: [PATCH 2/2] Revert "fix(remappings): check if remapping to add starts with existing remapping name (#9246)" (#9274) This reverts commit 455ba9b1b736766232d84ba1790ac9ba6ca944de. --- crates/config/src/providers/remappings.rs | 10 +++--- crates/forge/tests/cli/config.rs | 38 ----------------------- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/crates/config/src/providers/remappings.rs b/crates/config/src/providers/remappings.rs index 48e9c875f..2e849bea4 100644 --- a/crates/config/src/providers/remappings.rs +++ b/crates/config/src/providers/remappings.rs @@ -46,16 +46,14 @@ impl Remappings { } /// Push an element to the remappings vector, but only if it's not already present. - fn push(&mut self, remapping: Remapping) { + pub fn push(&mut self, remapping: Remapping) { if !self.remappings.iter().any(|existing| { // What we're doing here is filtering for ambiguous paths. For example, if we have - // @prb/=node_modules/@prb/ as existing, and - // @prb/math/=node_modules/@prb/math/src/ as the one being checked, + // @prb/math/=node_modules/@prb/math/src/ as existing, and + // @prb/=node_modules/@prb/ as the one being checked, // we want to keep the already existing one, which is the first one. This way we avoid // having to deal with ambiguous paths which is unwanted when autodetecting remappings. - // Remappings are added from root of the project down to libraries, so - // we want to exclude any conflicting remappings added from libraries. - remapping.name.starts_with(&existing.name) && existing.context == remapping.context + existing.name.starts_with(&remapping.name) && existing.context == remapping.context }) { self.remappings.push(remapping) } diff --git a/crates/forge/tests/cli/config.rs b/crates/forge/tests/cli/config.rs index f38dcf414..f6ec7c88e 100644 --- a/crates/forge/tests/cli/config.rs +++ b/crates/forge/tests/cli/config.rs @@ -595,44 +595,6 @@ forgetest_init!(can_prioritise_closer_lib_remappings, |prj, cmd| { ); }); -// Test that remappings within root of the project have priority over remappings of sub-projects. -// E.g. `@utils/libraries` mapping from library shouldn't be added if project already has `@utils` -// remapping. -// See -forgetest_init!(test_root_remappings_priority, |prj, cmd| { - let mut config = cmd.config(); - // Add `@utils/` remapping in project config. - config.remappings = vec![ - Remapping::from_str("@utils/=src/").unwrap().into(), - Remapping::from_str("@another-utils/libraries/=src/").unwrap().into(), - ]; - let proj_toml_file = prj.paths().root.join("foundry.toml"); - pretty_err(&proj_toml_file, fs::write(&proj_toml_file, config.to_string_pretty().unwrap())); - - // Create a new lib in the `lib` folder with conflicting `@utils/libraries` remapping. - // This should be filtered out from final remappings as root project already has `@utils/`. - let nested = prj.paths().libraries[0].join("dep1"); - pretty_err(&nested, fs::create_dir_all(&nested)); - let mut lib_config = Config::load_with_root(&nested); - lib_config.remappings = vec![ - Remapping::from_str("@utils/libraries/=src/").unwrap().into(), - Remapping::from_str("@another-utils/=src/").unwrap().into(), - ]; - let lib_toml_file = nested.join("foundry.toml"); - pretty_err(&lib_toml_file, fs::write(&lib_toml_file, lib_config.to_string_pretty().unwrap())); - - cmd.args(["remappings", "--pretty"]).assert_success().stdout_eq(str![[r#" -Global: -- @utils/=src/ -- @another-utils/libraries/=src/ -- @another-utils/=lib/dep1/src/ -- dep1/=lib/dep1/src/ -- forge-std/=lib/forge-std/src/ - - -"#]]); -}); - // test to check that foundry.toml libs section updates on install forgetest!(can_update_libs_section, |prj, cmd| { cmd.git_init();