Skip to content

Commit 558ec82

Browse files
committed
Fix DataStore failing store pagination
DataStore persistence failure tests use FailingStore through DynStoreWrapper. That wrapper now requires paginated store support, so make the helper fail paginated listings the same way it fails the other store calls. Co-Authored-By: HAL 9000
1 parent aab4bff commit 558ec82

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/data_store.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ where
225225
mod tests {
226226
use lightning::impl_writeable_tlv_based;
227227
use lightning::io;
228+
use lightning::util::persist::{PageToken, PaginatedKVStore, PaginatedListResponse};
228229
use lightning::util::test_utils::TestLogger;
229230

230231
use super::*;
@@ -315,6 +316,16 @@ mod tests {
315316
}
316317
}
317318

319+
impl PaginatedKVStore for FailingStore {
320+
fn list_paginated(
321+
&self, _primary_namespace: &str, _secondary_namespace: &str,
322+
_page_token: Option<PageToken>,
323+
) -> impl std::future::Future<Output = Result<PaginatedListResponse, io::Error>> + 'static + Send
324+
{
325+
async { Err(io::Error::new(io::ErrorKind::Other, "list_paginated failed")) }
326+
}
327+
}
328+
318329
fn new_failing_data_store(objects: Vec<TestObject>) -> DataStore<TestObject, Arc<TestLogger>> {
319330
let store: Arc<DynStore> = Arc::new(DynStoreWrapper(FailingStore));
320331
let logger = Arc::new(TestLogger::new());

0 commit comments

Comments
 (0)