-
Notifications
You must be signed in to change notification settings - Fork 0
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
a31c001
commit 01301b1
Showing
4 changed files
with
142 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
use { | ||
alloy::{ | ||
contract, | ||
rpc::types::TransactionReceipt, | ||
transports::{RpcError, TransportErrorKind}, | ||
}, | ||
thiserror::Error, | ||
}; | ||
|
||
#[derive(Debug, Error)] | ||
#[cfg_attr(feature = "uniffi", derive(uniffi::Error))] | ||
pub enum PrepareError { | ||
#[error("Checking account code: {0}")] | ||
CheckingAccountCode(RpcError<TransportErrorKind>), | ||
|
||
#[error("Getting nonce: {0}")] | ||
GettingNonce(RpcError<TransportErrorKind>), | ||
|
||
#[error("Creating sponsored user operation: {0}")] | ||
CreatingSponsoredUserOp(CreateSponsoredUserOpError), | ||
} | ||
|
||
#[allow(clippy::large_enum_variant)] | ||
#[derive(Debug, Error)] | ||
#[cfg_attr(feature = "uniffi", derive(uniffi::Error))] | ||
pub enum PrepareDeployError { | ||
#[error("Sending delegation transaction: {0}")] | ||
SendingDelegationTransaction(contract::Error), | ||
|
||
#[error("Delegation transaction failed: {0:?}")] | ||
DelegationTransactionFailed(TransactionReceipt), | ||
|
||
#[error("Getting delegation transaction receipt: {0:?}")] | ||
GettingDelegationTransactionReceipt( | ||
alloy::providers::PendingTransactionError, | ||
), | ||
|
||
#[error("Creating sponsored user operation: {0}")] | ||
CreatingSponsoredUserOp(CreateSponsoredUserOpError), | ||
} | ||
|
||
#[derive(Debug, Error)] | ||
#[cfg_attr(feature = "uniffi", derive(uniffi::Error))] | ||
pub enum CreateSponsoredUserOpError { | ||
#[error("Getting nonce: {0}")] | ||
GettingNonce(contract::Error), | ||
|
||
#[error("Getting user operation gas price: {0}")] | ||
GettingUserOperationGasPrice(eyre::Report), | ||
|
||
#[error("Sponsoring user operation: {0}")] | ||
SponsoringUserOperation(eyre::Report), | ||
} | ||
|
||
#[derive(Debug, Error)] | ||
#[cfg_attr(feature = "uniffi", derive(uniffi::Error))] | ||
pub enum SendError { | ||
#[error("Checking account code: {0}")] | ||
SendingUserOperation(eyre::Report), | ||
|
||
#[error("Waiting for user operation receipt: {0}")] | ||
WaitingForUserOperationReceipt(eyre::Report), | ||
} |
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