Skip to content

Commit

Permalink
fix(get_events) block_range / ContinuationToken::parse (#71)
Browse files Browse the repository at this point in the history
Co-authored-by: Noa Moulin <[email protected]>
  • Loading branch information
noamoulin and Noa Moulin authored Apr 23, 2024
1 parent 32336e0 commit 45e72f7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ git # Deoxys Changelog

## Next release

- fix: fix get_events minor issues
- fix: l1HandlerTx computed for commit
- refactor: optimise get_events RPC
- fix(root): fixed state commitments broken due to genesis loader
Expand Down
2 changes: 1 addition & 1 deletion crates/client/rpc/src/methods/read/get_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ where
let to = if to_block == Some(BlockId::Tag(BlockTag::Pending)) {
latest + 1
} else {
starknet.substrate_block_number_from_starknet_block(from_block.unwrap_or(BlockId::Number(0))).map_err(|e| {
starknet.substrate_block_number_from_starknet_block(to_block.unwrap_or(BlockId::Number(0))).map_err(|e| {
log::error!("'{e}'");
StarknetRpcApiError::BlockNotFound
})?
Expand Down
2 changes: 1 addition & 1 deletion crates/client/rpc/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl ContinuationToken {
return Err(ParseTokenError::WrongToken);
}
let block_n = arr[0].parse::<u64>().map_err(ParseTokenError::ParseFailed)?;
let event_n = arr[0].parse::<u64>().map_err(ParseTokenError::ParseFailed)?;
let event_n = arr[1].parse::<u64>().map_err(ParseTokenError::ParseFailed)?;

Ok(ContinuationToken { block_n, event_n })
}
Expand Down

0 comments on commit 45e72f7

Please sign in to comment.