-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GetAssetByOwner skipping fungible-assets when using show_fungible opt…
…ion bug fixed (#197) * fungible tokens skipped when using showFungible option bug fixed in getAssetByOwner * test-case and test-snapshot added * cleanup
- Loading branch information
1 parent
18f446b
commit fe3d4f8
Showing
9 changed files
with
160 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use sea_orm::{EntityTrait, EnumIter, Related, RelationDef, RelationTrait}; | ||
|
||
use crate::dao::{asset, token_accounts}; | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter)] | ||
pub enum Relation { | ||
Asset, | ||
} | ||
|
||
impl RelationTrait for Relation { | ||
fn def(&self) -> RelationDef { | ||
match self { | ||
Self::Asset => token_accounts::Entity::belongs_to(asset::Entity) | ||
.from(token_accounts::Column::Mint) | ||
.to(asset::Column::Id) | ||
.into(), | ||
} | ||
} | ||
} | ||
|
||
impl Related<asset::Entity> for token_accounts::Entity { | ||
fn to() -> RelationDef { | ||
Relation::Asset.def() | ||
} | ||
} |
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
+312 Bytes
...t_asset_by_owner_with_show_fungible_scenario/6BRNfDfdq1nKyU1TQiCEQLWyPtD8EwUH9Kt2ahsbidUx
Binary file not shown.
Binary file added
BIN
+824 Bytes
...t_asset_by_owner_with_show_fungible_scenario/7BajpcYgnxmWK91RhrfsdB3Tm83PcDwPvMC8ZinvtTY6
Binary file not shown.
Binary file added
BIN
+224 Bytes
...t_asset_by_owner_with_show_fungible_scenario/7EYnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs
Binary file not shown.
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
65 changes: 65 additions & 0 deletions
65
...tion_tests__show_fungible_flag_tests__get_asset_by_owner_with_show_fungible_scenario.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,65 @@ | ||
--- | ||
source: integration_tests/tests/integration_tests/show_fungible_flag_tests.rs | ||
expression: response | ||
snapshot_kind: text | ||
--- | ||
{ | ||
"total": 1, | ||
"limit": 1000, | ||
"cursor": "7EYnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs", | ||
"items": [ | ||
{ | ||
"interface": "Custom", | ||
"id": "7EYnhQoR9YM3N7UoaKRoA44Uy8JeaZV3qyouov87awMs", | ||
"content": { | ||
"$schema": "https://schema.metaplex.com/nft1.0.json", | ||
"json_uri": "https://gateway.irys.xyz/P8X64pGutyX5eyTpQmqZr3H4_Lqhm0IYxr5SyzFFNek", | ||
"files": [], | ||
"metadata": { | ||
"name": "Silly Dragon", | ||
"symbol": "SILLY", | ||
"token_standard": "Fungible" | ||
}, | ||
"links": {} | ||
}, | ||
"authorities": [ | ||
{ | ||
"address": "38qZKCqcphT5wDrVNJGHYcuenjEtEFPitvrqvMFQkPu7", | ||
"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": true, | ||
"locked": false | ||
}, | ||
"creators": [], | ||
"ownership": { | ||
"frozen": false, | ||
"delegated": false, | ||
"delegate": null, | ||
"ownership_model": "token", | ||
"owner": "" | ||
}, | ||
"supply": null, | ||
"mutable": true, | ||
"burnt": false | ||
} | ||
] | ||
} |