Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/cli/src/opts/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl TypedValueParser for ChainValueParser {
Ok(Chain::from_id(id))
} else {
// NamedChain::VARIANTS is a subset of all possible variants, since there are aliases:
// mumbai instead of polygon-mumbai etc
// amoy instead of polygon-amoy etc
//
// Parse first as NamedChain, if it fails parse with NamedChain::VARIANTS for displaying
// the error to the user
Expand Down
1 change: 0 additions & 1 deletion crates/cli/src/utils/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ pub fn has_different_gas_calc(chain_id: u64) -> bool {
| NamedChain::KaruraTestnet
| NamedChain::Mantle
| NamedChain::MantleSepolia
| NamedChain::MantleTestnet
| NamedChain::Moonbase
| NamedChain::Moonbeam
| NamedChain::MoonbeamDev
Expand Down
4 changes: 2 additions & 2 deletions crates/config/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ mod tests {
block_explorer: 4230000,
},
ChainCache {
name: "mumbai".to_string(),
name: "amoy".to_string(),
blocks: vec![("1".to_string(), 1), ("2".to_string(), 2)],
block_explorer: 0,
},
Expand All @@ -301,7 +301,7 @@ mod tests {
- Block Explorer (4.2 MB)\n\n\t\
- Block 1 (1.0 kB)\n\t\
- Block 2 (2.0 MB)\n\
- mumbai (3.0 B)\n\t\
- amoy (3.0 B)\n\t\
- Block Explorer (0.0 B)\n\n\t\
- Block 1 (1.0 B)\n\t\
- Block 2 (2.0 B)\n";
Expand Down
48 changes: 24 additions & 24 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3288,19 +3288,19 @@ mod tests {
r#"
[profile.default]
[rpc_endpoints]
polygonMumbai = "https://polygon-mumbai.g.alchemy.com/v2/${_RESOLVE_RPC_ALIAS}"
polygonAmoy = "https://polygon-amoy.g.alchemy.com/v2/${_RESOLVE_RPC_ALIAS}"
"#,
)?;
let mut config = Config::load().unwrap();
config.eth_rpc_url = Some("polygonMumbai".to_string());
config.eth_rpc_url = Some("polygonAmoy".to_string());
assert!(config.get_rpc_url().unwrap().is_err());

jail.set_env("_RESOLVE_RPC_ALIAS", "123455");

let mut config = Config::load().unwrap();
config.eth_rpc_url = Some("polygonMumbai".to_string());
config.eth_rpc_url = Some("polygonAmoy".to_string());
assert_eq!(
"https://polygon-mumbai.g.alchemy.com/v2/123455",
"https://polygon-amoy.g.alchemy.com/v2/123455",
config.get_rpc_url().unwrap().unwrap()
);

Expand Down Expand Up @@ -3550,7 +3550,7 @@ mod tests {

[etherscan]
optimism = { key = "https://etherscan-optimism.com/" }
mumbai = { key = "https://etherscan-mumbai.com/" }
amoy = { key = "https://etherscan-amoy.com/" }
"#,
)?;

Expand All @@ -3559,10 +3559,10 @@ mod tests {
let optimism = config.get_etherscan_api_key(Some(NamedChain::Optimism.into()));
assert_eq!(optimism, Some("https://etherscan-optimism.com/".to_string()));

config.etherscan_api_key = Some("mumbai".to_string());
config.etherscan_api_key = Some("amoy".to_string());

let mumbai = config.get_etherscan_api_key(Some(NamedChain::PolygonMumbai.into()));
assert_eq!(mumbai, Some("https://etherscan-mumbai.com/".to_string()));
let amoy = config.get_etherscan_api_key(Some(NamedChain::PolygonAmoy.into()));
assert_eq!(amoy, Some("https://etherscan-amoy.com/".to_string()));

Ok(())
});
Expand All @@ -3577,17 +3577,17 @@ mod tests {
[profile.default]

[etherscan]
mumbai = { key = "https://etherscan-mumbai.com/", chain = 80001 }
amoy = { key = "https://etherscan-amoy.com/", chain = 80002 }
"#,
)?;

let config = Config::load().unwrap();

let mumbai = config
.get_etherscan_config_with_chain(Some(NamedChain::PolygonMumbai.into()))
let amoy = config
.get_etherscan_config_with_chain(Some(NamedChain::PolygonAmoy.into()))
.unwrap()
.unwrap();
assert_eq!(mumbai.key, "https://etherscan-mumbai.com/".to_string());
assert_eq!(amoy.key, "https://etherscan-amoy.com/".to_string());

Ok(())
});
Expand All @@ -3602,18 +3602,18 @@ mod tests {
[profile.default]

[etherscan]
mumbai = { key = "https://etherscan-mumbai.com/", chain = 80001 , url = "https://verifier-url.com/"}
amoy = { key = "https://etherscan-amoy.com/", chain = 80002 , url = "https://verifier-url.com/"}
"#,
)?;

let config = Config::load().unwrap();

let mumbai = config
.get_etherscan_config_with_chain(Some(NamedChain::PolygonMumbai.into()))
let amoy = config
.get_etherscan_config_with_chain(Some(NamedChain::PolygonAmoy.into()))
.unwrap()
.unwrap();
assert_eq!(mumbai.key, "https://etherscan-mumbai.com/".to_string());
assert_eq!(mumbai.api_url, "https://verifier-url.com/".to_string());
assert_eq!(amoy.key, "https://etherscan-amoy.com/".to_string());
assert_eq!(amoy.api_url, "https://verifier-url.com/".to_string());

Ok(())
});
Expand All @@ -3626,23 +3626,23 @@ mod tests {
"foundry.toml",
r#"
[profile.default]
eth_rpc_url = "mumbai"
eth_rpc_url = "amoy"

[etherscan]
mumbai = { key = "https://etherscan-mumbai.com/" }
amoy = { key = "https://etherscan-amoy.com/" }

[rpc_endpoints]
mumbai = "https://polygon-mumbai.g.alchemy.com/v2/mumbai"
amoy = "https://polygon-amoy.g.alchemy.com/v2/amoy"
"#,
)?;

let config = Config::load().unwrap();

let mumbai = config.get_etherscan_config_with_chain(None).unwrap().unwrap();
assert_eq!(mumbai.key, "https://etherscan-mumbai.com/".to_string());
let amoy = config.get_etherscan_config_with_chain(None).unwrap().unwrap();
assert_eq!(amoy.key, "https://etherscan-amoy.com/".to_string());

let mumbai_rpc = config.get_rpc_url().unwrap().unwrap();
assert_eq!(mumbai_rpc, "https://polygon-mumbai.g.alchemy.com/v2/mumbai");
let amoy_rpc = config.get_rpc_url().unwrap().unwrap();
assert_eq!(amoy_rpc, "https://polygon-amoy.g.alchemy.com/v2/amoy");
Ok(())
});
}
Expand Down
6 changes: 3 additions & 3 deletions crates/forge/tests/cli/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ forgetest!(can_create_oracle_on_goerli, |prj, cmd| {
create_on_chain(EnvExternalities::goerli(), prj, cmd, setup_oracle);
});

// tests `forge` create on mumbai if correct env vars are set
forgetest!(can_create_oracle_on_mumbai, |prj, cmd| {
create_on_chain(EnvExternalities::mumbai(), prj, cmd, setup_oracle);
// tests `forge` create on amoy if correct env vars are set
forgetest!(can_create_oracle_on_amoy, |prj, cmd| {
create_on_chain(EnvExternalities::amoy(), prj, cmd, setup_oracle);
});

// tests that we can deploy the template contract
Expand Down
10 changes: 5 additions & 5 deletions crates/forge/tests/cli/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ impl EnvExternalities {
})
}

pub fn mumbai() -> Option<Self> {
pub fn amoy() -> Option<Self> {
Some(Self {
chain: NamedChain::PolygonMumbai,
rpc: network_rpc_key("mumbai")?,
pk: network_private_key("mumbai")?,
etherscan: etherscan_key(NamedChain::PolygonMumbai)?,
chain: NamedChain::PolygonAmoy,
rpc: network_rpc_key("amoy")?,
pk: network_private_key("amoy")?,
etherscan: etherscan_key(NamedChain::PolygonAmoy)?,
verifier: "etherscan".to_string(),
})
}
Expand Down
Loading
Loading