mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
client: fix decode block number as u32 (#3130)
* client: fix panic on decode block number as u32 * client: add test for number_index_key * client: add another test at client level * client: address review grumbles
This commit is contained in:
@@ -2633,4 +2633,14 @@ pub(crate) mod tests {
|
||||
b3.hash(),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_header_by_block_number_doesnt_panic() {
|
||||
let client = test_client::new();
|
||||
|
||||
// backend uses u32 for block numbers, make sure we don't panic when
|
||||
// trying to convert
|
||||
let id = BlockId::<Block>::Number(72340207214430721);
|
||||
client.header(&id).expect_err("invalid block number overflows u32");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user