From bba6af9064cb95596039f5a8f7ea460d3dedef0d Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 26 Sep 2016 23:11:10 +0100 Subject: wallet: cold wallet transaction signing This change adds the ability to create a new unsigned transaction from a watch only wallet, and save it to a file. This file can then be moved to another computer/VM where a cold wallet may load it, sign it, and save it. That cold wallet does not need to have a blockchain nor daemon. The signed transaction file can then be moved back to the watch only wallet, which can load it and send it to the daemon. Two new simplewallet commands to use it: sign_transfer (on the cold wallet) submit_transfer (on the watch only wallet) The transfer command used on a watch only wallet now writes an unsigned transaction set in a file called 'unsigned_monero_tx' instead of submitting the tx to the daemon as a normal wallet does. The signed tx file is called 'signed_monero_tx'. --- tests/unit_tests/output_selection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/unit_tests/output_selection.cpp b/tests/unit_tests/output_selection.cpp index 4344d1ffc..d26f5ae1a 100644 --- a/tests/unit_tests/output_selection.cpp +++ b/tests/unit_tests/output_selection.cpp @@ -56,14 +56,14 @@ static tools::wallet2::transfer_container make_transfers_container(size_t N) auto i = std::find(unused_indices.begin(), unused_indices.end(), idx); \ ASSERT_TRUE(i != unused_indices.end()); \ unused_indices.erase(i); \ - selected.push_back(transfers.begin() + idx); \ + selected.push_back(idx); \ } while(0) #define PICK(expected) \ do { \ size_t idx = w.pop_best_value_from(transfers, unused_indices, selected); \ ASSERT_EQ(expected, idx); \ - selected.push_back(transfers.begin() + idx); \ + selected.push_back(idx); \ } while(0) TEST(select_outputs, one_out_of_N) @@ -76,7 +76,7 @@ TEST(select_outputs, one_out_of_N) tools::wallet2::transfer_container transfers = make_transfers_container(10); transfers[6].m_block_height = 700; std::vector unused_indices({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}); - std::list selected; + std::list selected; SELECT(2); PICK(6); } @@ -93,7 +93,7 @@ TEST(select_outputs, order) transfers[3].m_block_height = 716; transfers[4].m_block_height = 701; std::vector unused_indices({0, 1, 2, 3, 4}); - std::list selected; + std::list selected; SELECT(0); PICK(3); // first the one that's far away PICK(2); // then the one that's close -- cgit v1.2.3