Skip to content

Commit

Permalink
Merge pull request #971 from eqlabs/testnet_version
Browse files Browse the repository at this point in the history
chore: bump testnet version_check
  • Loading branch information
Mirko-von-Leipzig authored Mar 21, 2023
2 parents 8b1dfb0 + 443c917 commit d6c6851
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions crates/common/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ macro_rules! version_check {
#[allow(dead_code)]
const NETWORK: (u64, u64, u64) = match pathfinder_common::Chain::$network {
pathfinder_common::Chain::Mainnet => (0, 10, 3),
pathfinder_common::Chain::Testnet => (0, 10, 3),
pathfinder_common::Chain::Testnet2 => (0, 10, 3),
pathfinder_common::Chain::Testnet => (0, 11, 0),
pathfinder_common::Chain::Testnet2 => (0, 11, 0),
pathfinder_common::Chain::Integration => (0, 11, 0),
pathfinder_common::Chain::Custom => panic!("Custom networks are not supported"),
};
Expand Down
16 changes: 6 additions & 10 deletions crates/gateway-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ mod tests {

mod compiled_class {
use super::*;
use pathfinder_common::{felt, version_check};
use pathfinder_common::felt;
use pretty_assertions::assert_eq;

#[test_log::test(tokio::test)]
Expand All @@ -849,11 +849,7 @@ mod tests {

#[tokio::test]
async fn success() {
version_check!(
Testnet < 0 - 11 - 0,
"Update class 2 hash (sierra) for testnet, current value is from integration"
);

// FIXME: replace with a class from testnet; this is an integration class.
const VALID_HASH: SierraHash = SierraHash(felt!(
"0x4e70b19333ae94bd958625f7b61ce9eec631653597e68645e13780061b2136c"
));
Expand Down Expand Up @@ -1903,22 +1899,22 @@ mod tests {

#[tokio::test]
async fn testnet() {
version_check!(Testnet == 0 - 10 - 3);
version_check!(Testnet == 0 - 11 - 0);
let actual = get_latest_version(&Client::testnet()).await.unwrap();
assert_eq!(
actual,
(0, 10, 3),
(0, 11, 0),
"Testnet gateway version has changed, update version_check"
);
}

#[tokio::test]
async fn testnet2() {
version_check!(Testnet2 == 0 - 10 - 3);
version_check!(Testnet2 == 0 - 11 - 0);
let actual = get_latest_version(&Client::testnet2()).await.unwrap();
assert_eq!(
actual,
(0, 10, 3),
(0, 11, 0),
"Testnet gateway version has changed, update version_check"
);
}
Expand Down

0 comments on commit d6c6851

Please sign in to comment.