-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getTokenAccount rpc method, showFungible and showZeroBalance options #224
Closed
AhzamAkhtar
wants to merge
12
commits into
metaplex-foundation:main
from
rpcpool:das-54-show-zero-balance-filter-rebase
Closed
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5663708
feat: add getTokenAccount rpc method and implement logic
Nagaprasadvr 5beadaa
add tests for token_accounts indexing
Nagaprasadvr 2b3a482
chore: cleanup
Nagaprasadvr ab179cd
WIP : showFungible
Nagaprasadvr 2de5bc0
chore: cleanup
Nagaprasadvr 45cefbc
add integration tests for showFungible
Nagaprasadvr 8626d98
Added token_info in rpcResponce ,showFungible and showZeroBalance opt…
AhzamAkhtar b226a1a
removed balance and ata from token_info and restored showFungible logic
AhzamAkhtar 4762848
update
AhzamAkhtar e72dcdc
Merge remote-tracking branch 'origin/das-39-add-gettokenaccounts-supp…
AhzamAkhtar 92ddeb5
showZeroBalance filter and tests added
AhzamAkhtar e517b4f
Refined stuff based on suggestions
AhzamAkhtar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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::{token_accounts, tokens}; | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter)] | ||
pub enum Relation { | ||
Tokens, | ||
} | ||
|
||
impl RelationTrait for Relation { | ||
fn def(&self) -> RelationDef { | ||
match self { | ||
Self::Tokens => token_accounts::Entity::belongs_to(tokens::Entity) | ||
.from(token_accounts::Column::Mint) | ||
.to(tokens::Column::Mint) | ||
.into(), | ||
} | ||
} | ||
} | ||
|
||
impl Related<tokens::Entity> for token_accounts::Entity { | ||
fn to() -> RelationDef { | ||
Relation::Tokens.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use sea_orm::{EntityTrait, EnumIter, Related, RelationDef, RelationTrait}; | ||
|
||
use crate::dao::{asset, token_accounts, tokens}; | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter)] | ||
pub enum Relation { | ||
TokenAccounts, | ||
Asset, | ||
} | ||
|
||
impl RelationTrait for Relation { | ||
fn def(&self) -> RelationDef { | ||
match self { | ||
Self::TokenAccounts => tokens::Entity::belongs_to(token_accounts::Entity) | ||
.from(tokens::Column::Mint) | ||
.to(token_accounts::Column::Mint) | ||
.into(), | ||
Self::Asset => tokens::Entity::belongs_to(asset::Entity) | ||
.from(tokens::Column::Mint) | ||
.to(asset::Column::Id) | ||
.into(), | ||
} | ||
} | ||
} | ||
|
||
impl Related<token_accounts::Entity> for tokens::Entity { | ||
fn to() -> RelationDef { | ||
Relation::TokenAccounts.def() | ||
} | ||
} | ||
|
||
impl Related<asset::Entity> for tokens::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
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
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
...unts/get_asset_with_show_fungible_scenario_1/7z6b5TE4WX4mgcQjuNBTDxK4SE75sbgEg5WWJwoUeie8
Binary file not shown.
Binary file added
BIN
+224 Bytes
...unts/get_asset_with_show_fungible_scenario_1/Ca84nWhQu41DMRnjdhRrLZty1i9txepMhAhz5qLLGcBw
Binary file not shown.
Binary file added
BIN
+824 Bytes
...unts/get_asset_with_show_fungible_scenario_2/7fXKY9tPpvYsdbSNyesUqo27WYC6ZsBEULdtngGHqLCK
Binary file not shown.
Binary file added
BIN
+224 Bytes
...unts/get_asset_with_show_fungible_scenario_2/AH6wj7T8Ke5nbukjtcobjjs1CDWUcQxndtnLkKAdrSrM
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ mod common; | |
mod general_scenario_tests; | ||
mod mpl_core_tests; | ||
mod regular_nft_tests; | ||
mod show_fungible_flag_tests; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.