Skip to content

Commit

Permalink
fallback for get_proposal_on_block to latest snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Tguntenaar committed Dec 3, 2024
1 parent da3af23 commit 4037248
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,21 @@ impl RpcService {

match result {
Ok(res) => Ok(res.data),
Err(e) => {
// After Block 122723375 & 122938305
// TODO caught error:
// Failed to get proposal on block: DeserializeError(Error("missing field `kyc_verified`", line: 0, column: 0))
eprintln!(
"Failed to get proposal on block: {:?}, Error: {:?}",
block_id, e
);
Err(Status::InternalServerError)
}
Err(on_block_error) => match self.get_proposal(proposal_id).await {
Ok(proposal) => Ok(proposal.data),
Err(rpc_error) => {
// After Block 122723375 & 122938305
// TODO caught error:
// Failed to get proposal on block: DeserializeError(Error("missing field `kyc_verified`", line: 0, column: 0))
eprintln!(
"Failed to get proposal from RPC on block height {} and id {}",
block_id, proposal_id,
);
eprintln!("{:?}", on_block_error);
eprintln!("{:?}", rpc_error);
Err(Status::InternalServerError)
}
},
}
}

Expand Down

0 comments on commit 4037248

Please sign in to comment.