-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6aa175d
commit bb2f67e
Showing
24 changed files
with
826 additions
and
145 deletions.
There are no files selected for viewing
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
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
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
Binary file added
BIN
+824 Bytes
...tests/data/accounts/fungible_token_get_asset/5x38Kp4hvdomTCnCrAny4UtMUt5rQBdB6px2K1Ui45Wq
Binary file not shown.
Binary file added
BIN
+224 Bytes
...tests/data/accounts/fungible_token_get_asset/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Binary file not shown.
Binary file added
BIN
+824 Bytes
...accounts/fungible_token_get_asset_scenario_1/5x38Kp4hvdomTCnCrAny4UtMUt5rQBdB6px2K1Ui45Wq
Binary file not shown.
Binary file added
BIN
+224 Bytes
...accounts/fungible_token_get_asset_scenario_1/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Binary file not shown.
Binary file added
BIN
+224 Bytes
.../accounts/fungible_token_get_asset_scenario_2/wKocBVvHQoVaiwWoCs9JYSVye4YZRrv5Cucf7fDqnz1
Binary file not shown.
Binary file added
BIN
+496 Bytes
...counts/token_extensions_get_asset_scenario_1/BPU5vrAHafRuVeK33CgfdwTKSsmC4p6t3aqyav3cFF7Y
Binary file not shown.
Binary file added
BIN
+760 Bytes
...counts/token_extensions_get_asset_scenario_2/HVbpJAQGNpkgBaYBZQBR1t7yFdvaYVp2vCQQfKKEN4tM
Binary file not shown.
Binary file added
BIN
+1008 Bytes
...counts/token_extensions_get_asset_scenario_3/2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo
Binary file not shown.
162 changes: 162 additions & 0 deletions
162
integration_tests/tests/integration_tests/fungibles_and_token_extensions_tests.rs
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,162 @@ | ||
use function_name::named; | ||
|
||
use das_api::api::{self, ApiContract}; | ||
|
||
use itertools::Itertools; | ||
|
||
use serial_test::serial; | ||
|
||
use super::common::*; | ||
|
||
#[tokio::test] | ||
#[serial] | ||
#[named] | ||
async fn test_token_extensions_get_asset_scenario_1() { | ||
let name = trim_test_name(function_name!()); | ||
let setup = TestSetup::new_with_options( | ||
name.clone(), | ||
TestSetupOptions { | ||
network: Some(Network::Devnet), | ||
}, | ||
) | ||
.await; | ||
|
||
let seeds: Vec<SeedEvent> = seed_accounts(["BPU5vrAHafRuVeK33CgfdwTKSsmC4p6t3aqyav3cFF7Y"]); | ||
|
||
apply_migrations_and_delete_data(setup.db.clone()).await; | ||
index_seed_events(&setup, seeds.iter().collect_vec()).await; | ||
|
||
let request = r#" | ||
{ | ||
"id": "BPU5vrAHafRuVeK33CgfdwTKSsmC4p6t3aqyav3cFF7Y" | ||
} | ||
"#; | ||
|
||
let request: api::GetAsset = serde_json::from_str(request).unwrap(); | ||
let response = setup.das_api.get_asset(request).await.unwrap(); | ||
|
||
insta::assert_json_snapshot!(name, response); | ||
} | ||
|
||
#[tokio::test] | ||
#[serial] | ||
#[named] | ||
async fn test_token_extensions_get_asset_scenario_2() { | ||
let name = trim_test_name(function_name!()); | ||
let setup = TestSetup::new_with_options( | ||
name.clone(), | ||
TestSetupOptions { | ||
network: Some(Network::Mainnet), | ||
}, | ||
) | ||
.await; | ||
|
||
let seeds: Vec<SeedEvent> = seed_accounts(["HVbpJAQGNpkgBaYBZQBR1t7yFdvaYVp2vCQQfKKEN4tM"]); | ||
|
||
apply_migrations_and_delete_data(setup.db.clone()).await; | ||
index_seed_events(&setup, seeds.iter().collect_vec()).await; | ||
|
||
let request = r#" | ||
{ | ||
"id": "HVbpJAQGNpkgBaYBZQBR1t7yFdvaYVp2vCQQfKKEN4tM" | ||
} | ||
"#; | ||
|
||
let request: api::GetAsset = serde_json::from_str(request).unwrap(); | ||
let response = setup.das_api.get_asset(request).await.unwrap(); | ||
|
||
insta::assert_json_snapshot!(name, response); | ||
} | ||
|
||
#[tokio::test] | ||
#[serial] | ||
#[named] | ||
async fn test_token_extensions_get_asset_scenario_3() { | ||
let name = trim_test_name(function_name!()); | ||
let setup = TestSetup::new_with_options( | ||
name.clone(), | ||
TestSetupOptions { | ||
network: Some(Network::Mainnet), | ||
}, | ||
) | ||
.await; | ||
|
||
let seeds: Vec<SeedEvent> = seed_accounts(["2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo"]); | ||
|
||
apply_migrations_and_delete_data(setup.db.clone()).await; | ||
index_seed_events(&setup, seeds.iter().collect_vec()).await; | ||
|
||
let request = r#" | ||
{ | ||
"id": "2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo" | ||
} | ||
"#; | ||
|
||
let request: api::GetAsset = serde_json::from_str(request).unwrap(); | ||
let response = setup.das_api.get_asset(request).await.unwrap(); | ||
|
||
insta::assert_json_snapshot!(name, response); | ||
} | ||
|
||
#[tokio::test] | ||
#[serial] | ||
#[named] | ||
async fn test_fungible_token_get_asset_scenario_1() { | ||
let name = trim_test_name(function_name!()); | ||
let setup = TestSetup::new_with_options( | ||
name.clone(), | ||
TestSetupOptions { | ||
network: Some(Network::Mainnet), | ||
}, | ||
) | ||
.await; | ||
|
||
let seeds: Vec<SeedEvent> = seed_accounts([ | ||
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", | ||
"5x38Kp4hvdomTCnCrAny4UtMUt5rQBdB6px2K1Ui45Wq", | ||
]); | ||
|
||
apply_migrations_and_delete_data(setup.db.clone()).await; | ||
index_seed_events(&setup, seeds.iter().collect_vec()).await; | ||
|
||
let request = r#" | ||
{ | ||
"id": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" | ||
} | ||
"#; | ||
|
||
let request: api::GetAsset = serde_json::from_str(request).unwrap(); | ||
let response = setup.das_api.get_asset(request).await.unwrap(); | ||
|
||
insta::assert_json_snapshot!(name, response); | ||
} | ||
|
||
#[tokio::test] | ||
#[serial] | ||
#[named] | ||
async fn test_fungible_token_get_asset_scenario_2() { | ||
let name = trim_test_name(function_name!()); | ||
let setup = TestSetup::new_with_options( | ||
name.clone(), | ||
TestSetupOptions { | ||
network: Some(Network::Devnet), | ||
}, | ||
) | ||
.await; | ||
|
||
let seeds: Vec<SeedEvent> = seed_accounts(["wKocBVvHQoVaiwWoCs9JYSVye4YZRrv5Cucf7fDqnz1"]); | ||
|
||
apply_migrations_and_delete_data(setup.db.clone()).await; | ||
index_seed_events(&setup, seeds.iter().collect_vec()).await; | ||
|
||
let request = r#" | ||
{ | ||
"id": "wKocBVvHQoVaiwWoCs9JYSVye4YZRrv5Cucf7fDqnz1" | ||
} | ||
"#; | ||
|
||
let request: api::GetAsset = serde_json::from_str(request).unwrap(); | ||
let response = setup.das_api.get_asset(request).await.unwrap(); | ||
|
||
insta::assert_json_snapshot!(name, response); | ||
} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
mod account_update_tests; | ||
mod cnft_tests; | ||
mod common; | ||
mod fungibles_and_token_extensions_tests; | ||
mod general_scenario_tests; | ||
mod mpl_core_tests; | ||
mod regular_nft_tests; | ||
mod token_extensions_tests; |
56 changes: 56 additions & 0 deletions
56
...ts/integration_tests__fungibles_and_token_extensions_tests__fungible_token_get_asset.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,56 @@ | ||
--- | ||
source: integration_tests/tests/integration_tests/fungibles_and_token_extensions_tests.rs | ||
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": "" | ||
}, | ||
"mutable": true, | ||
"burnt": false | ||
} |
Oops, something went wrong.