-
Notifications
You must be signed in to change notification settings - Fork 41
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
a9e5340
commit 5ff6ccc
Showing
10 changed files
with
241 additions
and
29 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
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
133 changes: 133 additions & 0 deletions
133
...ts/snapshots/integration_tests__mpl_core_tests__mpl_core_get_assets_by_authority.snap.new
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,133 @@ | ||
--- | ||
source: integration_tests/tests/integration_tests/mpl_core_tests.rs | ||
assertion_line: 108 | ||
expression: response | ||
--- | ||
{ | ||
"total": 2, | ||
"limit": 50, | ||
"page": 1, | ||
"items": [ | ||
{ | ||
"interface": "MplCoreCollection", | ||
"id": "9CSyGBw1DCVZfx621nb7UBM9SpVDsX1m9MaN6APCf1Ci", | ||
"content": { | ||
"$schema": "https://schema.metaplex.com/nft1.0.json", | ||
"json_uri": "https://example.com/collection", | ||
"files": [], | ||
"metadata": { | ||
"name": "Test Collection", | ||
"symbol": "" | ||
}, | ||
"links": {} | ||
}, | ||
"authorities": [ | ||
{ | ||
"address": "APrZTeVysBJqAznfLXS71NAzjr2fCVTSF1A66MeErzM7", | ||
"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": "single", | ||
"owner": "APrZTeVysBJqAznfLXS71NAzjr2fCVTSF1A66MeErzM7" | ||
}, | ||
"supply": null, | ||
"mutable": true, | ||
"burnt": false, | ||
"plugins": {}, | ||
"mpl_core_info": { | ||
"num_minted": 1, | ||
"current_size": 1, | ||
"plugins_json_version": 1 | ||
}, | ||
"external_plugins": [] | ||
}, | ||
{ | ||
"interface": "MplCoreAsset", | ||
"id": "4FcFVJVPRsYoMjt8ewDGV5nipoK63SNrJzjrBHyXvhcz", | ||
"content": { | ||
"$schema": "https://schema.metaplex.com/nft1.0.json", | ||
"json_uri": "https://example.com/asset", | ||
"files": [], | ||
"metadata": { | ||
"name": "Test Asset", | ||
"symbol": "" | ||
}, | ||
"links": {} | ||
}, | ||
"authorities": [ | ||
{ | ||
"address": "APrZTeVysBJqAznfLXS71NAzjr2fCVTSF1A66MeErzM7", | ||
"scopes": [ | ||
"full" | ||
] | ||
} | ||
], | ||
"compression": { | ||
"eligible": false, | ||
"compressed": false, | ||
"data_hash": "", | ||
"creator_hash": "", | ||
"asset_hash": "", | ||
"tree": "", | ||
"seq": 0, | ||
"leaf_id": 0 | ||
}, | ||
"grouping": [ | ||
{ | ||
"group_key": "collection", | ||
"group_value": "9CSyGBw1DCVZfx621nb7UBM9SpVDsX1m9MaN6APCf1Ci" | ||
} | ||
], | ||
"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": "single", | ||
"owner": "GzYvuu9aUYXmnardj4svbAcCNmefiaGu2E3knGw9NJQQ" | ||
}, | ||
"supply": null, | ||
"mutable": true, | ||
"burnt": false, | ||
"plugins": {}, | ||
"mpl_core_info": { | ||
"plugins_json_version": 1 | ||
}, | ||
"external_plugins": [] | ||
} | ||
] | ||
} |
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
39 changes: 39 additions & 0 deletions
39
migration/src/m20241209_100813_add_unique_index_for_asset_owner_and_supply.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,39 @@ | ||
use sea_orm_migration::prelude::*; | ||
|
||
use crate::model::table::Asset; | ||
|
||
#[derive(DeriveMigrationName)] | ||
pub struct Migration; | ||
|
||
#[async_trait::async_trait] | ||
impl MigrationTrait for Migration { | ||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.create_index( | ||
Index::create() | ||
.name("idx_asset_owner_supply") | ||
.col(Asset::Owner) | ||
.col(Asset::Supply) | ||
.col(Asset::Burnt) | ||
.col(Asset::OwnerType) | ||
.table(Asset::Table) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
Ok(()) | ||
} | ||
|
||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.drop_index( | ||
Index::drop() | ||
.name("idx_asset_owner_supply") | ||
.table(Asset::Table) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
Ok(()) | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
migration/src/m20241209_111604_add_index_for_asset_id_group_value_verified.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,38 @@ | ||
use sea_orm_migration::prelude::*; | ||
|
||
use crate::model::table::AssetGrouping; | ||
|
||
#[derive(DeriveMigrationName)] | ||
pub struct Migration; | ||
|
||
#[async_trait::async_trait] | ||
impl MigrationTrait for Migration { | ||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.create_index( | ||
Index::create() | ||
.unique() | ||
.name("asset_grouping_id_value_verified_unique") | ||
.col(AssetGrouping::AssetId) | ||
.col(AssetGrouping::GroupValue) | ||
.col(AssetGrouping::Verified) | ||
.table(AssetGrouping::Table) | ||
.to_owned(), | ||
) | ||
.await?; | ||
Ok(()) | ||
} | ||
|
||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.drop_index( | ||
sea_query::Index::drop() | ||
.name("asset_grouping_id_value_verified_unique") | ||
.table(AssetGrouping::Table) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
Ok(()) | ||
} | ||
} |
Oops, something went wrong.