-
Notifications
You must be signed in to change notification settings - Fork 6
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
192f30d
commit 8be3a1f
Showing
8 changed files
with
98 additions
and
53 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.
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,43 @@ | ||
use thiserror::Error; | ||
use url::ParseError; | ||
use ethers::contract::ContractError; | ||
use ethers::providers::ProviderError; | ||
use ethers::providers::{Http, Provider}; | ||
use rustc_hex::FromHexError; | ||
use ethers::middleware::signer::SignerMiddlewareError; | ||
use ethers::signers::Ledger; | ||
|
||
|
||
/// RainOrderbookError | ||
/// Enum representing errors thrown by the crate | ||
#[derive(Error, Debug)] | ||
pub enum RainOrderbookError{ | ||
#[error("Invalid RPC URL")] | ||
InvalidRPC{ | ||
#[from] | ||
source: ParseError | ||
}, | ||
#[error("Invalid Contract Function Call")] | ||
InvalidContractFunctionCall{ | ||
#[from] | ||
source: ContractError<Provider<Http>> | ||
}, | ||
#[error("Invalid Address")] | ||
InvalidAddress{ | ||
#[from] | ||
source: FromHexError | ||
}, | ||
#[error("Failed to confirm transaction")] | ||
TransactionConfirmationError{ | ||
#[from] | ||
source: ProviderError | ||
}, | ||
#[error("Error in Transaction")] | ||
TransactionError{ | ||
#[from] | ||
source: SignerMiddlewareError<Provider<Http>, Ledger> | ||
}, | ||
#[error("Failed to fetch Transaction Receipt")] | ||
TransactionReceiptError, | ||
|
||
} |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ pub mod interpreter; | |
pub mod orderbook; | ||
pub mod registry; | ||
pub mod transaction; | ||
pub mod errors; |
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