Skip to content

Commit

Permalink
chain: remove TxStatusError::InvalidTx variant (#7915)
Browse files Browse the repository at this point in the history
The TxStatusError::InvalidTx variant is never constructed
so get rid of it.
  • Loading branch information
mina86 authored and nikurt committed Nov 7, 2022
1 parent 2a31f65 commit 9683b6f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions chain/client-primitives/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use chrono::DateTime;
use near_primitives::time::Utc;

use near_chain_configs::ProtocolConfigView;
use near_primitives::errors::InvalidTxError;
use near_primitives::hash::CryptoHash;
use near_primitives::merkle::{MerklePath, PartialMerkleTree};
use near_primitives::network::PeerId;
Expand Down Expand Up @@ -595,7 +594,6 @@ pub struct TxStatus {
pub enum TxStatusError {
ChainError(near_chain_primitives::Error),
MissingTransaction(CryptoHash),
InvalidTx(InvalidTxError),
InternalError(String),
TimeoutError,
}
Expand Down
1 change: 0 additions & 1 deletion chain/jsonrpc/src/api/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ impl RpcFrom<TxStatusError> for RpcTransactionError {
TxStatusError::MissingTransaction(requested_transaction_hash) => {
Self::UnknownTransaction { requested_transaction_hash }
}
TxStatusError::InvalidTx(context) => Self::InvalidTransaction { context },
TxStatusError::InternalError(debug_info) => Self::InternalError { debug_info },
TxStatusError::TimeoutError => Self::TimeoutError,
}
Expand Down
4 changes: 0 additions & 4 deletions chain/rosetta-rpc/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ impl From<near_client::TxStatusError> for ErrorKind {
near_client::TxStatusError::MissingTransaction(err) => {
Self::NotFound(format!("Transaction is missing: {:?}", err))
}
near_client::TxStatusError::InvalidTx(err) => Self::NotFound(format!(
"Transaction is invalid, so it will never be included to the chain: {:?}",
err
)),
near_client::TxStatusError::InternalError(_)
| near_client::TxStatusError::TimeoutError => {
// TODO: remove the statuses from TxStatusError since they are
Expand Down

0 comments on commit 9683b6f

Please sign in to comment.