From 462f22b18861e8c76dc0c4d3bd20b20f47cdcb62 Mon Sep 17 00:00:00 2001 From: Krisztian Pinter Date: Fri, 13 Dec 2024 11:37:44 +0100 Subject: [PATCH] cleanup --- .../src/register/register3.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/toolkit/partner-chains-cli/src/register/register3.rs b/toolkit/partner-chains-cli/src/register/register3.rs index d57e316ba..ef1d68ecb 100644 --- a/toolkit/partner-chains-cli/src/register/register3.rs +++ b/toolkit/partner-chains-cli/src/register/register3.rs @@ -189,7 +189,7 @@ mod tests { None, PcContractsCliResources::default(), )], - vec![MockIO::file_read("/path/to/payment.skey")], + run_registration_io(), prompt_for_registration_status_y(), show_registration_status_io(), ] @@ -208,7 +208,7 @@ mod tests { genesis_utxo(), new_candidate_registration(), payment_signing_key(), - Err(OffchainError::InternalError("".to_string())), + Err(OffchainError::InternalError("test error".to_string())), ); let mock_context = MockIOContext::new() .with_json_file("/path/to/payment.skey", payment_skey_content()) @@ -226,8 +226,7 @@ mod tests { None, PcContractsCliResources::default(), )], - vec![MockIO::file_read("/path/to/payment.skey")], - // run_registration_command_fail_io(), + run_registration_fail_io(), ] .into_iter() .flatten() @@ -262,7 +261,7 @@ mod tests { None, PcContractsCliResources::default(), )], - vec![MockIO::file_read("/path/to/payment.skey")], + run_registration_io(), prompt_for_registration_status_n(), ] .into_iter() @@ -327,6 +326,14 @@ mod tests { ] } + fn run_registration_io() -> Vec { + vec![MockIO::file_read("/path/to/payment.skey")] + } + + fn run_registration_fail_io() -> Vec { + vec![MockIO::file_read("/path/to/payment.skey")] + } + fn mock_register3_cmd() -> Register3Cmd { Register3Cmd { genesis_utxo: genesis_utxo(),