Return a propoer error code for txpool is full error (#13245)

This commit is contained in:
angel-ding-cb
2024-12-09 12:43:10 -08:00
committed by GitHub
parent bf1688525e
commit af5dc60867

View File

@ -676,6 +676,9 @@ impl From<RpcPoolError> for jsonrpsee_types::error::ErrorObject<'static> {
fn from(error: RpcPoolError) -> Self {
match error {
RpcPoolError::Invalid(err) => err.into(),
RpcPoolError::TxPoolOverflow => {
rpc_error_with_code(EthRpcErrorCode::TransactionRejected.code(), error.to_string())
}
error => internal_rpc_err(error.to_string()),
}
}