Skip to content

Commit

Permalink
update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdud007 committed Sep 9, 2024
1 parent 624247d commit 08be0c4
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 166 deletions.
66 changes: 33 additions & 33 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ pub enum SnTrieError {
GatewayError(u16),
#[error("Trie not found")]
TrieNotFound,

#[error("Invalid transaction index")]
InvalidTxIndex,
}

#[derive(Error, Debug)]
Expand Down
82 changes: 0 additions & 82 deletions src/starknet/block.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/starknet/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod block;
pub mod rpc;
pub mod tx_hash;
pub mod tx_trie;
39 changes: 0 additions & 39 deletions src/starknet/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use starknet_types_rpc::BlockWithTxs;

use crate::SnTrieError;

use super::block::StarknetBlock;

pub struct RpcProvider<'a> {
url: &'a str,
gateway_url: &'a str,
Expand Down Expand Up @@ -77,40 +75,3 @@ impl GatewayProvider {
}
}
}

#[cfg(test)]
mod tests {
use super::*;

const PATHFINDER_URL: &str = "https://pathfinder.sepolia.iosis.tech/";
const GATEWAY_URL: &str = "https://alpha-sepolia.starknet.io";

#[tokio::test]
async fn test_get_block_with_txs() {
let provider = RpcProvider::new(PATHFINDER_URL, GATEWAY_URL);

let block_number = 56400;
let block = provider.get_block_transactions(block_number).await.unwrap();

// 0.13.2 - invoke, declare,deploy_account
// provider.get_block_with_txs(124358).await;
// // 0.13.2 - invoke, l1_handler
// provider.get_block_with_txs(124015).await;
// // 0.13.2 - invoke
// provider.get_block_with_txs(99708).await;

// provider.get_block_with_txs(71224).await;

// provider.get_block_with_txs(71311).await;

// provider.get_block_with_txs(70015).await;

// provider.get_block_with_txs(50304).await;
// provider.get_block_with_txs(51190).await;

// provider.get_block_with_txs(34999).await;

// provider.get_block_with_txs(35000).await;
// provider.get_block_transactions(56400).await;
}
}
Loading

0 comments on commit 08be0c4

Please sign in to comment.