Skip to content

Commit

Permalink
chore: make clippy happy in advanced mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksuss committed Aug 22, 2024
1 parent eef4aa2 commit cba0ce3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/cli/advanced/near.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub enum WriteCommand {
#[clap(short, long)]
wasm_path: String,
/// Unique identifier for the chain. The default value is 1313161556 (Aurora localnet).
/// See https://chainlist.org/ for a list of taken chain IDs.
/// See `https://chainlist.org/` for a list of taken chain IDs.
#[clap(short, long)]
chain_id: Option<u64>,
/// Near account ID for the owner of the Engine contract.
Expand All @@ -167,7 +167,7 @@ pub enum WriteCommand {
eth_custodian_address: Option<String>,
/// The metadata for the ETH token the connector creates.
/// The value is expected to be a value JSON string
/// (see https://nomicon.io/Standards/Tokens/FungibleToken/Metadata for fields).
/// (see `https://nomicon.io/Standards/Tokens/FungibleToken/Metadata` for fields).
/// The default value is 18 decimals with name and symbol equal to "localETH".
#[clap(short, long)]
ft_metadata: Option<String>,
Expand Down
1 change: 1 addition & 0 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl Client {

#[cfg(feature = "advanced")]
#[derive(Debug)]
#[allow(dead_code)]
pub enum TransactionOutcome {
Result(SubmitResult),
Failure(near_primitives::errors::TxExecutionError),
Expand Down
2 changes: 1 addition & 1 deletion src/transaction_reader/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Aggregator for GroupByFlatStatus {
(FlatTxStatus::Reverted, 0),
(FlatTxStatus::GasLimit, 0),
(FlatTxStatus::IncorrectNonce, 0),
(FlatTxStatus::Other, 0),
(FlatTxStatus::Other(String::new()), 0),
];
init_data.into_iter().collect()
};
Expand Down
8 changes: 4 additions & 4 deletions src/transaction_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,25 @@ enum TxStatus {
Other(String),
}

#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub enum FlatTxStatus {
Succeeded,
Reverted,
GasLimit,
IncorrectNonce,
Other,
Other(String),
}

impl TxStatus {
const fn flatten(&self) -> FlatTxStatus {
fn flatten(&self) -> FlatTxStatus {
match self {
Self::Executed(result) => match result.status {
TransactionStatus::Succeed(_) => FlatTxStatus::Succeeded,
_ => FlatTxStatus::Reverted,
},
Self::GasLimit => FlatTxStatus::GasLimit,
Self::IncorrectNonce => FlatTxStatus::IncorrectNonce,
Self::Other(_) => FlatTxStatus::Other,
Self::Other(msg) => FlatTxStatus::Other(msg.clone()),
}
}
}

0 comments on commit cba0ce3

Please sign in to comment.