-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MTG-1028 Add integration tests for freeze authorities & delegate auth…
…orities - add integration test with onchain data
- Loading branch information
Showing
8 changed files
with
140 additions
and
2 deletions.
There are no files selected for viewing
Binary file added
BIN
+824 Bytes
...ccounts/fungible_token_mint_freeze_authority/5x38Kp4hvdomTCnCrAny4UtMUt5rQBdB6px2K1Ui45Wq
Binary file not shown.
Binary file added
BIN
+224 Bytes
...ccounts/fungible_token_mint_freeze_authority/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Binary file not shown.
Binary file added
BIN
+312 Bytes
...ccounts/fungible_token_mint_freeze_authority/FGETo8T8wMcN2wCjav8VK6eh3dLk63evNDPxzLSJra8B
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
������� u\C��J]ٞ� �kU%78�� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ mod general_scenario_tests; | |
mod mpl_core_tests; | ||
mod regular_nft_tests; | ||
mod synchronizer_tests; | ||
mod token_tests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...s/src/snapshots/integration_tests__token_tests__fungible_token_mint_freeze_authority.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
source: integration_tests/src/token_tests.rs | ||
assertion_line: 38 | ||
expression: response | ||
snapshot_kind: text | ||
--- | ||
{ | ||
"interface": "Custom", | ||
"id": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", | ||
"content": { | ||
"$schema": "https://schema.metaplex.com/nft1.0.json", | ||
"json_uri": "", | ||
"files": [], | ||
"metadata": { | ||
"name": "USD Coin", | ||
"symbol": "USDC" | ||
}, | ||
"links": {} | ||
}, | ||
"authorities": [ | ||
{ | ||
"address": "2wmVCSfPxGPjrnMMn7rchp4uaeoTqN39mXFC2zhPdri9", | ||
"scopes": [ | ||
"full" | ||
] | ||
} | ||
], | ||
"compression": { | ||
"eligible": false, | ||
"compressed": false, | ||
"data_hash": "", | ||
"creator_hash": "", | ||
"asset_hash": "", | ||
"tree": "", | ||
"seq": 0, | ||
"leaf_id": 0 | ||
}, | ||
"grouping": [], | ||
"royalty": { | ||
"royalty_model": "creators", | ||
"target": null, | ||
"percent": 0.0, | ||
"basis_points": 0, | ||
"primary_sale_happened": false, | ||
"locked": false | ||
}, | ||
"creators": [], | ||
"ownership": { | ||
"frozen": false, | ||
"delegated": false, | ||
"delegate": null, | ||
"ownership_model": "token", | ||
"owner": "" | ||
}, | ||
"supply": { | ||
"print_max_supply": 0, | ||
"print_current_supply": 0, | ||
"edition_nonce": 252 | ||
}, | ||
"mutable": true, | ||
"burnt": false, | ||
"lamports": 5616720, | ||
"executable": false, | ||
"metadata_owner": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", | ||
"rent_epoch": 18446744073709551615, | ||
"token_info": { | ||
"supply": 9342137502207180, | ||
"decimals": 6, | ||
"token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
"mint_authority": "BJE5MMbqXjVwjAF7oxwPYXnTXDyspzZyt4vwenNw5ruG", | ||
"freeze_authority": "7dGbd2QZcCKcTndnHcTL8q7SMVXAkp688NTQYwrRCrar" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
use std::sync::Arc; | ||
|
||
use entities::{api_req_params::GetAsset, enums::AssetType}; | ||
use function_name::named; | ||
use itertools::Itertools; | ||
use nft_ingester::api::dapi::response::{AssetList, TokenAccountsList}; | ||
use serial_test::serial; | ||
use tokio::{ | ||
sync::{broadcast, Mutex}, | ||
task::JoinSet, | ||
}; | ||
|
||
use crate::common::{ | ||
index_seed_events, seed_token_mints, trim_test_name, Network, SeedEvent, TestSetup, | ||
TestSetupOptions, | ||
}; | ||
|
||
#[tokio::test] | ||
#[serial] | ||
#[named] | ||
async fn test_fungible_token_mint_freeze_authority() { | ||
let name = trim_test_name(function_name!()); | ||
let setup = TestSetup::new_with_options( | ||
name.clone(), | ||
TestSetupOptions { network: Some(Network::Mainnet), clear_db: true }, | ||
) | ||
.await; | ||
|
||
// USDC token | ||
let seeds: Vec<SeedEvent> = seed_token_mints(&["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]); | ||
|
||
index_seed_events(&setup, seeds.iter().collect_vec()).await; | ||
|
||
let request = r#" | ||
{ | ||
"id": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" | ||
} | ||
"#; | ||
|
||
let mutexed_tasks = Arc::new(Mutex::new(JoinSet::new())); | ||
|
||
let request: GetAsset = serde_json::from_str(request).unwrap(); | ||
let response_value = setup.das_api.get_asset(request, mutexed_tasks.clone()).await.unwrap(); | ||
let res: AssetList = serde_json::from_value(response_value.clone()).unwrap(); | ||
|
||
insta::assert_json_snapshot!(name, response_value.clone()); | ||
|
||
// assert_eq!( | ||
// res.items[0].clone().token_info.unwrap().mint_authority.unwrap(), | ||
// "BJE5MMbqXjVwjAF7oxwPYXnTXDyspzZyt4vwenNw5ruG".to_string() | ||
// ); | ||
// assert_eq!( | ||
// res.items[0].clone().token_info.unwrap().freeze_authority.unwrap(), | ||
// "7dGbd2QZcCKcTndnHcTL8q7SMVXAkp688NTQYwrRCrar".to_string() | ||
// ); | ||
} |