Skip to content

Commit

Permalink
Merge pull request #65 from KasarLabs/refacto/const
Browse files Browse the repository at this point in the history
refacto consts
  • Loading branch information
antiyro authored Jun 17, 2024
2 parents a0462ab + ce555b7 commit b87aa31
Show file tree
Hide file tree
Showing 37 changed files with 423 additions and 335 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ use starknet_providers::{jsonrpc::{HttpTransport, JsonRpcClient}, Provider};
#[rstest]
#[tokio::test]
async fn work_existing_block(clients: HashMap<String, JsonRpcClient<HttpTransport>>) {
let deoxys = &clients[DEOXYS];
let pathfinder = &clients[PATHFINDER];
let deoxys = &clients[mainnet::network::DEOXYS];
let pathfinder = &clients[mainnet::network::PATHFINDER];

let response_deoxys = deoxys.block_number().await.expect("Deoxys : Error while getting the block number");
let response_pathfinder = pathfinder.block_number().await.expect("RPC : Error while getting the block number");
Expand Down
89 changes: 89 additions & 0 deletions rustc-ice-2024-06-17T15_15_44-57848.txt

Large diffs are not rendered by default.

187 changes: 0 additions & 187 deletions unit_tests/src/constants.rs

This file was deleted.

19 changes: 19 additions & 0 deletions unit_tests/src/constants/mainnet/block.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
///
/// Starknet Mainnet block number versions.
///
pub const BLOCK_0: u64 = 0;
pub const BLOCK_0_9_1: u64 = 3799;
pub const BLOCK_0_10_0: u64 = 4883;
pub const BLOCK_0_10_1: u64 = 6570;
pub const BLOCK_0_10_2: u64 = 12268;
pub const BLOCK_0_10_3: u64 = 16575;
pub const BLOCK_0_11_0: u64 = 28613;
pub const BLOCK_0_11_0_2: u64 = 43851;
pub const BLOCK_0_11_1: u64 = 61394;
pub const BLOCK_0_11_2: u64 = 68096;
pub const BLOCK_0_12_0: u64 = 103129;
pub const BLOCK_0_12_1: u64 = 164901;
pub const BLOCK_0_12_2: u64 = 194410;
pub const BLOCK_0_12_3: u64 = 472644;
pub const BLOCK_0_13_0: u64 = 501514;
pub const BLOCK_0_13_1: u64 = 607878;
102 changes: 102 additions & 0 deletions unit_tests/src/constants/mainnet/contract.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
///
/// Contract address for StarkGate ETH starknet bridge.
///
/// Details concerning available methods can be found on [StarkScan](https://starkscan.co/contract/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7#read-write-contract)
///
pub const STARKGATE_ETH_BRIDGE_ADDR: &str =
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";

///
/// Contract address for Jediswap exchange.
///
/// Details concerning available methods can be found on [StarkScan](https://starkscan.co/contract/0x041fd22b238fa21cfcf5dd45a8548974d8263b3a531a60388411c5e230f97023#read-write-contract):
///
pub const JEDI_SWAP_ADDR: &str =
"0x041fd22b238fa21cfcf5dd45a8548974d8263b3a531a60388411c5e230f97023";

///
/// Contract address for Starkgate USDC on Starknet.
///
/// Details concerning this coin can be found on [StarkScan](https://starkscan.co/token/0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8):
///
pub const STARKGATE_USDC: &str =
"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8";

///
/// Contract address fpr Starkgate Ether on Starknet.
///
/// Detail concerning this coin can be found on [StarkScan](https://starkscan.co/token/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7):
///
pub const STARKGATE_ETHER: &str =
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";

///
/// Random ERC721 Starknet contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x07fa9a8eacb89fb6cd0c7fe557e71c42a4b181ba328a9a04958136e6469c4e00)
///
pub const CONTRACT_ERC721: &str =
"0x07fa9a8eacb89fb6cd0c7fe557e71c42a4b181ba328a9a04958136e6469c4e00";

///
/// Random ERC20 Starknet contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x04a5fdce70877b77f03aea8a29259176f88d5bea9d0ad8c0118f5316425e6ba0)
///
pub const CONTRACT_ERC20: &str =
"0x04a5fdce70877b77f03aea8a29259176f88d5bea9d0ad8c0118f5316425e6ba0";

///
/// Random ACCOUNT Starknet contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x046ef77bd47ba7b1424ba2b2b1442d14168ac3dc6897032bf491ecbafd5f5c32)
pub const CONTRACT_ACCOUNT: &str =
"0x046ef77bd47ba7b1424ba2b2b1442d14168ac3dc6897032bf491ecbafd5f5c32";

///
/// Random Cairo 0 contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x03cdabdf2ea700a667c63024523ccb04a22d18104da826ac10984a18eddadbbe)
///
pub const CONTRACT_CAIRO_0: &str =
"0x03cdabdf2ea700a667c63024523ccb04a22d18104da826ac10984a18eddadbbe";

///
/// Random Braavos account Cairo 0 contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x0179d67854d1b9429d276ed7c59010be187af15d2e6ede31a513bdfbfa3e1af7)
///
pub const CONTRACT_BRAAVOS_ACCOUNT_CAIRO_0: &str =
"0x0179d67854d1b9429d276ed7c59010be187af15d2e6ede31a513bdfbfa3e1af7";

///
/// Random Braavos account Cairo 1 contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x017de82f930be1caec165b9501197046ecc7d2d86d9721cd57f0cb16c2a99b2e)
///
pub const CONTRACT_BRAAVOS_ACCOUNT_CAIRO_1: &str =
"0x017de82f930be1caec165b9501197046ecc7d2d86d9721cd57f0cb16c2a99b2e";

///
/// Random Argent account Cairo 0 contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x0314a5cbf7f368446d38ed4d0de19f5ca16546c1a519e8994c07590ecff803c0)
///
pub const CONTRACT_ARGENT_ACCOUNT_CAIRO_0: &str =
"0x0314a5cbf7f368446d38ed4d0de19f5ca16546c1a519e8994c07590ecff803c0";

///
/// Random Argent account Cairo 1 contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x017317d13c8278d38720d2d70d7adcf6a3cf9ef3abb5422ad60ea4f98f8d6eba)
///
pub const CONTRACT_ARGENT_ACCOUNT_CAIRO_1: &str =
"0x017317d13c8278d38720d2d70d7adcf6a3cf9ef3abb5422ad60ea4f98f8d6eba";

///
/// Random ERC721 Cairo 0 contract address.
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/contract/0x0717e6b64e3c48c016ffec829963696480bf40ad8ca1d5303902c1b23347ff57)
///
pub const CONTRACT_ERC721_CAIRO_0: &str =
"0x0717e6b64e3c48c016ffec829963696480bf40ad8ca1d5303902c1b23347ff57";
4 changes: 4 additions & 0 deletions unit_tests/src/constants/mainnet/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub mod block;
pub mod contract;
pub mod network;
pub mod transaction;
3 changes: 3 additions & 0 deletions unit_tests/src/constants/mainnet/network.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub const DEOXYS: &str = "deoxys";
pub const PATHFINDER: &str = "pathfinder";
pub const JUNO: &str = "juno";
42 changes: 42 additions & 0 deletions unit_tests/src/constants/mainnet/transaction.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
///
/// Random INVOKE_V0 transaction
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/tx/0x02c02d6f0d75bc71b1c629cde038199ccfb6e18343a76943275405817727f76c)
///
pub const TX_INVOKE_V0: &str = "0x02c02d6f0d75bc71b1c629cde038199ccfb6e18343a76943275405817727f76c";

///
/// Random INVOKE_V1 transaction
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/tx/0x027ed707907aef09c39ece1b24540308eee8d74a14c77728604c3a2da546fd6d)
///
pub const TX_INVOKE_V1: &str = "0x027ed707907aef09c39ece1b24540308eee8d74a14c77728604c3a2da546fd6d";

///
/// Random DECLARE_V0 transaction
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/tx/0x5f430525084fe54a73e6f6de7d5d3ac20311ac4ba48002c665dade0c585af82)
///
pub const TX_DECLARE_V0: &str = "0x5f430525084fe54a73e6f6de7d5d3ac20311ac4ba48002c665dade0c585af82";

///
/// Random DECLARE_V1 transaction
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/tx/0x30fd34d7ffbe2aea6121f76c7c82a9edb7250a69a86eaf4ea55e9fb39237d71)
///
pub const TX_DECLARE_V1: &str = "0x30fd34d7ffbe2aea6121f76c7c82a9edb7250a69a86eaf4ea55e9fb39237d71";

///
/// Random DECLARE_V2 transaction
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/tx/0x62c6e41b306db3dd03fbbb14bd169e84819e5ac1058ffde93a924b3abe9b3c1)
///
pub const TX_DECLARE_V2: &str = "0x62c6e41b306db3dd03fbbb14bd169e84819e5ac1058ffde93a924b3abe9b3c1";

///
/// Random L1_HANDLER_V0 transaction
///
/// Details concerning this contract can be found on [StarkScan](https://starkscan.co/tx/0x006a555ac598673a215ef69815db1ebe89cb11eed9a489215c21c7d32d6e581a)
///
pub const TX_L1_HANDLER_V0: &str =
"0x006a555ac598673a215ef69815db1ebe89cb11eed9a489215c21c7d32d6e581a";
2 changes: 2 additions & 0 deletions unit_tests/src/constants/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod mainnet;
pub mod sepolia;
1 change: 1 addition & 0 deletions unit_tests/src/constants/sepolia/block.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file.
1 change: 1 addition & 0 deletions unit_tests/src/constants/sepolia/contract.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 4 additions & 0 deletions unit_tests/src/constants/sepolia/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub mod block;
pub mod contract;
pub mod network;
pub mod transaction;
1 change: 1 addition & 0 deletions unit_tests/src/constants/sepolia/network.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions unit_tests/src/constants/sepolia/transaction.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit b87aa31

Please sign in to comment.