Skip to content

Commit

Permalink
chore: bump testnet version_check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko-von-Leipzig committed Mar 21, 2023
1 parent b3e80b6 commit 443c917
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 @@ -807,7 +807,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 @@ -829,11 +829,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 @@ -1883,22 +1879,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 443c917

Please sign in to comment.