Skip to content

Commit

Permalink
fix: pattern matching for api call
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Oct 1, 2024
1 parent 4291cfa commit e97c3f9
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,13 @@ where
BlockCommitter: BlockCommitterApi,
{
async fn request_da_block_cost(&mut self) -> DaBlockCostsResult<DaBlockCosts> {
let raw_da_block_costs;

if let Some(last_value) = &self.last_raw_da_block_costs {
raw_da_block_costs = self
let raw_da_block_costs = match self.last_raw_da_block_costs {
Some(ref last_value) => self
.client
.get_costs_by_seqno(last_value.sequence_number + 1)
.await?;
} else {
// we have to error if we cannot find the first set of costs
raw_da_block_costs = self.client.get_latest_costs().await?;
.get_costs_by_seqno(last_value.sequence_number + 1),
_ => self.client.get_latest_costs(),
}
.await?;

let Some(ref raw_da_block_costs) = raw_da_block_costs else {
return Err(anyhow!("No response from block committer"))
Expand Down

0 comments on commit e97c3f9

Please sign in to comment.