aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/multisig.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-10-01 14:06:54 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-17 16:12:18 +0000
commit265290388bd2134108d689818518f7d9c830292c (patch)
treef4009e97bb83c923349cc5326b954b176ce3cd71 /tests/unit_tests/multisig.cpp
parentadd multisig core test and factor multisig building blocks (diff)
downloadmonero-265290388bd2134108d689818518f7d9c830292c.tar.xz
wallet: guard against partly initialized multisig wallet
Diffstat (limited to 'tests/unit_tests/multisig.cpp')
-rw-r--r--tests/unit_tests/multisig.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/unit_tests/multisig.cpp b/tests/unit_tests/multisig.cpp
index 0e8a6b168..aab1ce420 100644
--- a/tests/unit_tests/multisig.cpp
+++ b/tests/unit_tests/multisig.cpp
@@ -94,11 +94,14 @@ static void make_M_2_wallet(tools::wallet2 &wallet0, tools::wallet2 &wallet1, un
ASSERT_TRUE(wallet0.get_account().get_public_address_str(true) == wallet1.get_account().get_public_address_str(true));
+ bool ready;
uint32_t threshold, total;
- ASSERT_TRUE(wallet0.multisig(&threshold, &total));
+ ASSERT_TRUE(wallet0.multisig(&ready, &threshold, &total));
+ ASSERT_TRUE(ready);
ASSERT_TRUE(threshold == M);
ASSERT_TRUE(total == 2);
- ASSERT_TRUE(wallet1.multisig(&threshold, &total));
+ ASSERT_TRUE(wallet1.multisig(&ready, &threshold, &total));
+ ASSERT_TRUE(ready);
ASSERT_TRUE(threshold == M);
ASSERT_TRUE(total == 2);
}
@@ -149,14 +152,18 @@ static void make_M_3_wallet(tools::wallet2 &wallet0, tools::wallet2 &wallet1, to
ASSERT_TRUE(wallet0.get_account().get_public_address_str(true) == wallet1.get_account().get_public_address_str(true));
ASSERT_TRUE(wallet0.get_account().get_public_address_str(true) == wallet2.get_account().get_public_address_str(true));
+ bool ready;
uint32_t threshold, total;
- ASSERT_TRUE(wallet0.multisig(&threshold, &total));
+ ASSERT_TRUE(wallet0.multisig(&ready, &threshold, &total));
+ ASSERT_TRUE(ready);
ASSERT_TRUE(threshold == M);
ASSERT_TRUE(total == 3);
- ASSERT_TRUE(wallet1.multisig(&threshold, &total));
+ ASSERT_TRUE(wallet1.multisig(&ready, &threshold, &total));
+ ASSERT_TRUE(ready);
ASSERT_TRUE(threshold == M);
ASSERT_TRUE(total == 3);
- ASSERT_TRUE(wallet2.multisig(&threshold, &total));
+ ASSERT_TRUE(wallet2.multisig(&ready, &threshold, &total));
+ ASSERT_TRUE(ready);
ASSERT_TRUE(threshold == M);
ASSERT_TRUE(total == 3);
}