Skip to content

Commit

Permalink
[helius] The 'asset_id' type in pub struct CompressedNftEvent is chan… (
Browse files Browse the repository at this point in the history
#24)

* [helius] The 'asset_id' type in pub struct CompressedNftEvent is changed to Option<String>,

* [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 <sxpp316@gmail.com>
  • Loading branch information
cpkt9762 and pingzi1314 committed Mar 4, 2024
1 parent fd21129 commit 2898b84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/types/enhanced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct CompressedNftEvent {
pub tree_id: String,
pub leaf_index: Option<i32>,
pub seq: Option<i32>,
pub asset_id: String,
pub asset_id: Option<String>,
pub instruction_index: Option<i32>,
pub inner_instruction_index: Option<i32>,
pub new_leaf_owner: Option<String>,
Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2898b84

Please sign in to comment.