test: account for offset for first subscription (#302)

This commit is contained in:
Matthias Seitz 2021-05-28 09:45:16 +02:00 committed by GitHub
parent b5a2ee9a3d
commit 4036cfb8ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -378,7 +378,14 @@ mod test {
let block = serde_json::from_value::<Block<TxHash>>(item).unwrap(); let block = serde_json::from_value::<Block<TxHash>>(item).unwrap();
blocks.push(block.number.unwrap_or_default().as_u64()); blocks.push(block.number.unwrap_or_default().as_u64());
} }
let offset = blocks[0] - block_num;
assert_eq!(blocks, &[block_num + 1, block_num + 2, block_num + 3]) assert_eq!(
blocks,
&[
block_num + offset,
block_num + offset + 1,
block_num + offset + 2
]
)
} }
} }