Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box ClientError #878

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions solana/src/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl SolanaNetwork for SolanaRpc {
self.min_priority_fee,
)
.await
.map_err(SolanaRpcError::RpcClientError)?;
.map_err(|e| SolanaRpcError::RpcClientError(Box::new(e)))?;

tracing::info!(%priority_fee);

Expand Down Expand Up @@ -277,7 +277,7 @@ impl SolanaNetwork for SolanaRpc {
transaction = %signature,
"Data credit burn failed: {err:?}"
);
Err(SolanaRpcError::RpcClientError(err))
Err(SolanaRpcError::RpcClientError(Box::new(err)))
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion solana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub(crate) use send_with_retry;
#[derive(thiserror::Error, Debug)]
pub enum SolanaRpcError {
#[error("Solana rpc error: {0}")]
RpcClientError(#[from] ClientError),
RpcClientError(Box<ClientError>),
#[error("Anchor error: {0}")]
AnchorError(Box<helium_anchor_gen::anchor_lang::error::Error>),
#[error("Solana program error: {0}")]
Expand All @@ -57,6 +57,12 @@ impl From<helium_anchor_gen::anchor_lang::error::Error> for SolanaRpcError {
}
}

impl From<ClientError> for SolanaRpcError {
fn from(err: ClientError) -> Self {
Self::RpcClientError(Box::new(err))
}
}

pub trait GetSignature {
fn get_signature(&self) -> &Signature;
}
Expand Down
2 changes: 1 addition & 1 deletion solana/src/start_boost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl SolanaNetwork for SolanaRpc {
transaction = %signature,
"hex start boost failed: {err:?}"
);
Err(SolanaRpcError::RpcClientError(err))
Err(SolanaRpcError::RpcClientError(Box::new(err)))
}
}
}
Expand Down