Skip to content

Commit

Permalink
Update error.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Jun 22, 2024
1 parent 815cdba commit b7c6d26
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use alloy_dyn_abi::JsonAbiExt;
use alloy_json_abi::Error as AlloyError;
use alloy_primitives::hex::encode_prefixed;
use alloy_primitives::hex::{decode, hex::encode, FromHexError};
use alloy_primitives::hex::{decode, encode, encode_prefixed, FromHexError};
use alloy_primitives::U256;
use ethers::providers::RpcError;
use once_cell::sync::Lazy;
Expand All @@ -16,8 +15,8 @@ use thiserror::Error;
pub const SELECTOR_REGISTRY_URL: &str = "https://api.openchain.xyz/signature-database/v1/lookup";

// panic selector
pub const PANIC_SELECTOR: [u8; 4] = [0x4e, 0x48, 0x7b, 0x71]; // 0x4e487b71
pub const PANIC_SIG: &str = "Panic(uint256)";
pub const PANIC_SELECTOR: [u8; 4] = [0x4e, 0x48, 0x7b, 0x71]; // 0x4e487b71

/// hashmap of cached error selectors
pub static SELECTORS: Lazy<Mutex<HashMap<[u8; 4], AlloyError>>> =
Expand Down Expand Up @@ -216,12 +215,10 @@ impl<'a> From<PoisonError<MutexGuard<'a, HashMap<[u8; 4], AlloyError>>>> for Abi

#[cfg(test)]
mod tests {
use alloy_primitives::hex::encode;
use super::*;
use ethers::providers::{JsonRpcError, MockError};
use serde_json::json;

use super::*;

#[tokio::test]
async fn test_error_decoder() {
let data = vec![26, 198, 105, 8];
Expand Down

0 comments on commit b7c6d26

Please sign in to comment.