mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-24 03:45:38 +08:00
fix: add unit test and change log entry
This commit is contained in:
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Handle the case where a bitcoin node returns zero headers (#3588)
|
||||
|
||||
## [2.1]
|
||||
|
||||
This is a **consensus-breaking** release that introduces a _lot_ of new
|
||||
|
||||
@@ -1832,4 +1832,24 @@ mod test {
|
||||
|
||||
let deserialized: Vec<Vec<u8>> = deserialize(&encoded_tx).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_handle_headers_empty() {
|
||||
let headers_path = "/tmp/test-spv-handle_headers_empty.dat";
|
||||
if fs::metadata(headers_path).is_ok() {
|
||||
fs::remove_file(headers_path).unwrap();
|
||||
}
|
||||
|
||||
let mut spv_client = SpvClient::new(
|
||||
headers_path,
|
||||
0,
|
||||
None,
|
||||
BitcoinNetworkType::Regtest,
|
||||
true,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
spv_client.handle_headers(1, vec![]).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user