From 2898b84be5b6b3d2764a0c4fbde1e5ddb0bc3002 Mon Sep 17 00:00:00 2001 From: cpkt9762 Date: Tue, 5 Mar 2024 00:53:12 +0800 Subject: [PATCH] =?UTF-8?q?[helius]=20The=20'asset=5Fid'=20type=20in=20pub?= =?UTF-8?q?=20struct=20CompressedNftEvent=20is=20chan=E2=80=A6=20(#24)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [helius] The 'asset_id' type in pub struct CompressedNftEvent is changed to Option, * [helius] 1 "Due to the limitation of Helius free version, which does not allow calling the API twice simultaneously, the test_enhanced_txn fails. Therefore, a new test_enhanced_history_txn is added." * [helius] 1 fix fmt Error --------- Co-authored-by: check520 --- src/api/types/enhanced.rs | 2 +- src/lib.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/api/types/enhanced.rs b/src/api/types/enhanced.rs index dcfff02..ac1df76 100644 --- a/src/api/types/enhanced.rs +++ b/src/api/types/enhanced.rs @@ -54,7 +54,7 @@ pub struct CompressedNftEvent { pub tree_id: String, pub leaf_index: Option, pub seq: Option, - pub asset_id: String, + pub asset_id: Option, pub instruction_index: Option, pub inner_instruction_index: Option, pub new_leaf_owner: Option, diff --git a/src/lib.rs b/src/lib.rs index d8900cc..6229d4f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -159,7 +159,17 @@ mod tests { let res = client.parse_transaction(&sigs[0]).await?; assert!(!res.is_empty()); assert!(res[0].timestamp > 0); + Ok(()) + } + #[rstest::rstest] + #[tokio::test] + #[allow(clippy::unwrap_used)] + async fn test_enhanced_history_txn(config: Config) -> color_eyre::Result<()> { + if config.client.is_none() { + return Ok(()); + } + let client = config.client(); let res = client.parsed_transaction_history("M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K").await?; assert!(!res.is_empty()); assert!(res[0].timestamp > 0);