Add From for SanitizeError > TransactionError
This commit is contained in:
committed by
mergify[bot]
parent
e25846e1ad
commit
3f73affb2e
@ -613,8 +613,7 @@ impl Accounts {
|
|||||||
use solana_sdk::sanitize::Sanitize;
|
use solana_sdk::sanitize::Sanitize;
|
||||||
let keys: Vec<Result<_>> = OrderedIterator::new(txs, txs_iteration_order)
|
let keys: Vec<Result<_>> = OrderedIterator::new(txs, txs_iteration_order)
|
||||||
.map(|tx| {
|
.map(|tx| {
|
||||||
tx.sanitize()
|
tx.sanitize().map_err(TransactionError::from)?;
|
||||||
.map_err(|_| TransactionError::SanitizeFailure)?;
|
|
||||||
|
|
||||||
if Self::has_duplicates(&tx.message.account_keys) {
|
if Self::has_duplicates(&tx.message.account_keys) {
|
||||||
return Err(TransactionError::AccountLoadedTwice);
|
return Err(TransactionError::AccountLoadedTwice);
|
||||||
|
@ -90,6 +90,12 @@ pub enum TransactionError {
|
|||||||
|
|
||||||
pub type Result<T> = result::Result<T, TransactionError>;
|
pub type Result<T> = result::Result<T, TransactionError>;
|
||||||
|
|
||||||
|
impl From<SanitizeError> for TransactionError {
|
||||||
|
fn from(_: SanitizeError) -> Self {
|
||||||
|
Self::SanitizeFailure
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// An atomic transaction
|
/// An atomic transaction
|
||||||
#[frozen_abi(digest = "GoxM5ZMMjM2FSuY1VtuMhs1j8u9kMuYsH3dpYcSVVnTe")]
|
#[frozen_abi(digest = "GoxM5ZMMjM2FSuY1VtuMhs1j8u9kMuYsH3dpYcSVVnTe")]
|
||||||
#[derive(Debug, PartialEq, Default, Eq, Clone, Serialize, Deserialize, AbiExample)]
|
#[derive(Debug, PartialEq, Default, Eq, Clone, Serialize, Deserialize, AbiExample)]
|
||||||
|
Reference in New Issue
Block a user