run owner rpc doctests on windows

This commit is contained in:
wiesche
2026-09-02 20:37:44 +02:00
parent fff7948448
commit 39ba6c4ff2
2 changed files with 30 additions and 38 deletions
-2
View File
@@ -344,8 +344,6 @@ fn test_check_middleware(
_node_version_info: Option<NodeVersionInfo>,
_slate: Option<&Slate>,
) -> Result<(), libwallet::Error> {
// TODO: Implement checks
// return Err(Error::GenericError("Test Rejection".into()))?
Ok(())
}
+30 -36
View File
@@ -2855,45 +2855,39 @@ macro_rules! doctest_helper_json_rpc_owner_assert_response {
// json response.
// In order to prevent leaking tempdirs, This function should not panic.
// These cause LMDB to run out of disk space on CircleCI
// disable for now on windows
// TODO: Fix properly
#[cfg(not(target_os = "windows"))]
{
use grin_wallet_api::run_doctest_owner;
use serde_json;
use serde_json::Value;
use tempfile::tempdir;
use grin_wallet_api::run_doctest_owner;
use serde_json;
use serde_json::Value;
use tempfile::tempdir;
let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap();
let dir = dir
.path()
.to_str()
.ok_or("Failed to convert tmpdir path to string.".to_owned())
.unwrap();
let request_val: Value = serde_json::from_str($request).unwrap();
let expected_response: Value = serde_json::from_str($expected_response).unwrap();
let response = run_doctest_owner(
request_val,
dir,
$blocks_to_mine,
$perform_tx,
$lock_tx,
$finalize_tx,
$payment_proof,
)
.unwrap()
let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap();
let dir = dir
.path()
.to_str()
.ok_or("Failed to convert tmpdir path to string.".to_owned())
.unwrap();
if response != expected_response {
panic!(
"(left != right) \nleft: {}\nright: {}",
serde_json::to_string_pretty(&response).unwrap(),
serde_json::to_string_pretty(&expected_response).unwrap()
);
}
let request_val: Value = serde_json::from_str($request).unwrap();
let expected_response: Value = serde_json::from_str($expected_response).unwrap();
let response = run_doctest_owner(
request_val,
dir,
$blocks_to_mine,
$perform_tx,
$lock_tx,
$finalize_tx,
$payment_proof,
)
.unwrap()
.unwrap();
if response != expected_response {
panic!(
"(left != right) \nleft: {}\nright: {}",
serde_json::to_string_pretty(&response).unwrap(),
serde_json::to_string_pretty(&expected_response).unwrap()
);
}
};
}