Skip to content

Commit

Permalink
fix: ingore empty events for block interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wanyvic committed Apr 10, 2024
1 parent 7f94a7b commit 806c49e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/subcommand/server/brc20/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ pub(crate) async fn brc20_block_events(
txid: txid.to_string(),
events: events.into_iter().map(|e| e.into()).collect(),
})
.filter(|e| !e.events.is_empty())
.collect(),
})))
}
10 changes: 6 additions & 4 deletions src/subcommand/server/ord/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,12 @@ pub(crate) async fn ord_block_inscriptions(
)?;
api_tx_operations.push(tx_inscription);
}
api_block_operations.push(ApiTxInscriptions {
inscriptions: api_tx_operations,
txid: txid.to_string(),
});
if !api_tx_operations.is_empty() {
api_block_operations.push(ApiTxInscriptions {
inscriptions: api_tx_operations,
txid: txid.to_string(),
});
}
}

Ok(Json(ApiResponse::ok(ApiBlockInscriptions {
Expand Down

0 comments on commit 806c49e

Please sign in to comment.