Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-iohk committed Oct 10, 2024
1 parent a793980 commit fab8b5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/api/search_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl MinaMesh {
let original_offset = req.offset.unwrap_or(0);
let mut offset = original_offset;
let mut limit = req.limit.unwrap_or(100);
let mut transactions = Vec::new() as Vec<BlockTransaction>;
let mut transactions = Vec::new();
let mut txs_len = 0;
let mut total_count = 0;

Expand Down Expand Up @@ -52,10 +52,7 @@ impl MinaMesh {
let response = SearchTransactionsResponse {
transactions,
total_count,
next_offset: match next_offset {
offset if offset < total_count => Some(offset),
_ => None,
},
next_offset: if next_offset < total_count { Some(next_offset) } else { None },
};

Ok(response)
Expand Down Expand Up @@ -154,7 +151,7 @@ impl From<InternalCommand> for BlockTransaction {
internal_command.secondary_sequence_no,
internal_command.hash
);
let fee = internal_command.fee.unwrap_or_else(|| "0".to_string());
let fee = internal_command.fee.unwrap_or("0".to_string());
let status = &internal_command.status;

let mut operations = Vec::new();
Expand Down
3 changes: 1 addition & 2 deletions tests/search_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ async fn search_transactions_internal_command() -> Result<()> {
let request = SearchTransactionsRequest {
network_identifier: Box::new(NetworkIdentifier::new("mina".to_string(), "mainnet".to_string())),
max_block: Some(44),
// cspell:disable
transaction_identifier: Some(Box::new(TransactionIdentifier::new(
// cspell:disable-next-line
"CkpZZWqdA87JmPxHA5NmFEQ3qh7pUmqXi9GBWzf4pADtPEHQAeH7M".to_string(),
))),
// cspell:enable
limit: Some(5),
..Default::default()
};
Expand Down

0 comments on commit fab8b5f

Please sign in to comment.