-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove token-2022 dep from rpc-client-api (#941)
* move RpcFilterType::allows to solana-rpc as `filter_allows` * update imports * restore and deprecate allows() method * use Account::valid_account_data from solana_inline_spl * remove old import * fix: use inline token_2022 * fix inline_spl import * fix: another place where inline token_2022 is needed
- Loading branch information
1 parent
79ae84e
commit 61a6f36
Showing
8 changed files
with
26 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,13 @@ | ||
use { | ||
solana_inline_spl::{token::GenericTokenAccount, token_2022::Account}, | ||
solana_rpc_client_api::filter::RpcFilterType, | ||
solana_sdk::account::{AccountSharedData, ReadableAccount}, | ||
}; | ||
|
||
pub fn filter_allows(filter: &RpcFilterType, account: &AccountSharedData) -> bool { | ||
match filter { | ||
RpcFilterType::DataSize(size) => account.data().len() as u64 == *size, | ||
RpcFilterType::Memcmp(compare) => compare.bytes_match(account.data()), | ||
RpcFilterType::TokenAccountState => Account::valid_account_data(account.data()), | ||
} | ||
} |
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