diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-10-24 18:24:11 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-04 22:27:01 +0000 |
commit | 8d71b2b1b3714a13d46247ed7342a1ad292c488d (patch) | |
tree | 8df2af493f4f38622ecc9fe20c8735d947cd0be4 /tests | |
parent | wallet2: faster output and key image import/export (diff) | |
download | monero-8d71b2b1b3714a13d46247ed7342a1ad292c488d.tar.xz |
wallet2: only export necessary outputs and key images
and disable annoying test that requires ridiculous amounts
of skullduggery every time some format changes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/fuzz/cold-outputs/OUTPUTS2 | bin | 256 -> 581 bytes | |||
-rw-r--r-- | tests/fuzz/cold-outputs.cpp | 2 | ||||
-rw-r--r-- | tests/unit_tests/serialization.cpp | 14 |
3 files changed, 14 insertions, 2 deletions
diff --git a/tests/data/fuzz/cold-outputs/OUTPUTS2 b/tests/data/fuzz/cold-outputs/OUTPUTS2 Binary files differindex 907bcdb91..33cf39024 100644 --- a/tests/data/fuzz/cold-outputs/OUTPUTS2 +++ b/tests/data/fuzz/cold-outputs/OUTPUTS2 diff --git a/tests/fuzz/cold-outputs.cpp b/tests/fuzz/cold-outputs.cpp index 488a3b931..29b3ed267 100644 --- a/tests/fuzz/cold-outputs.cpp +++ b/tests/fuzz/cold-outputs.cpp @@ -77,7 +77,7 @@ int ColdOutputsFuzzer::run(const std::string &filename) s = std::string("\x01\x16serialization::archive") + s; try { - std::vector<tools::wallet2::transfer_details> outputs; + std::pair<size_t, std::vector<tools::wallet2::transfer_details>> outputs; std::stringstream iss; iss << s; boost::archive::portable_binary_iarchive ar(iss); diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp index 2f7b5aac7..e1404d637 100644 --- a/tests/unit_tests/serialization.cpp +++ b/tests/unit_tests/serialization.cpp @@ -908,9 +908,21 @@ TEST(Serialization, portability_outputs) ASSERT_TRUE(td2.m_pk_index == 0); } +struct unsigned_tx_set +{ + std::vector<tools::wallet2::tx_construction_data> txes; + tools::wallet2::transfer_container transfers; +}; +template <class Archive> +inline void serialize(Archive &a, unsigned_tx_set &x, const boost::serialization::version_type ver) +{ + a & x.txes; + a & x.transfers; +} #define UNSIGNED_TX_PREFIX "Monero unsigned tx set\003" TEST(Serialization, portability_unsigned_tx) { + const boost::filesystem::path filename = unit_test::data_dir / "unsigned_monero_tx"; std::string s; const cryptonote::network_type nettype = cryptonote::TESTNET; @@ -918,7 +930,7 @@ TEST(Serialization, portability_unsigned_tx) ASSERT_TRUE(r); const size_t magiclen = strlen(UNSIGNED_TX_PREFIX); ASSERT_FALSE(strncmp(s.c_str(), UNSIGNED_TX_PREFIX, magiclen)); - tools::wallet2::unsigned_tx_set exported_txs; + unsigned_tx_set exported_txs; s = s.substr(magiclen); r = false; try |