aboutsummaryrefslogtreecommitdiff
path: root/tests/fuzz
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-08-27 02:54:29 -0700
committerAlexander Blair <snipa@jagtech.io>2020-08-27 02:54:30 -0700
commitbad5d8d6f05826ff1275c0ece08f3b99f6f39840 (patch)
treea9223c5c27a6e27535120e10cf49e9f5f17c2014 /tests/fuzz
parent3f392341e75ba77c77a35f2f5d6c74ec6f4c012d (diff)
parent7175dcb1078abbdaa130a8c5f5fd2b93fa7b3086 (diff)
downloadmonzero-core-bad5d8d6f05826ff1275c0ece08f3b99f6f39840.tar.gz
monzero-core-bad5d8d6f05826ff1275c0ece08f3b99f6f39840.tar.xz
monzero-core-bad5d8d6f05826ff1275c0ece08f3b99f6f39840.zip
Merge pull request #6690
7175dcb10 replace most boost serialization with existing monero serialization (moneromooo-monero)
Diffstat (limited to 'tests/fuzz')
-rw-r--r--tests/fuzz/cold-outputs.cpp8
-rw-r--r--tests/fuzz/cold-transaction.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/fuzz/cold-outputs.cpp b/tests/fuzz/cold-outputs.cpp
index 797a369a5..2698a36ba 100644
--- a/tests/fuzz/cold-outputs.cpp
+++ b/tests/fuzz/cold-outputs.cpp
@@ -40,7 +40,7 @@ BEGIN_INIT_SIMPLE_FUZZER()
static tools::wallet2 local_wallet;
wallet = &local_wallet;
- static const char * const spendkey_hex = "0b4f47697ec99c3de6579304e5f25c68b07afbe55b71d99620bf6cbf4e45a80f";
+ static const char * const spendkey_hex = "f285d4ac9e66271256fc7cde0d3d6b36f66efff6ccd766706c408e86f4997a0d";
crypto::secret_key spendkey;
epee::string_tools::hex_to_pod(spendkey_hex, spendkey);
@@ -50,12 +50,12 @@ BEGIN_INIT_SIMPLE_FUZZER()
END_INIT_SIMPLE_FUZZER()
BEGIN_SIMPLE_FUZZER()
- std::string s = std::string("\x01\x16serialization::archive") + std::string((const char*)buf, len);
+ std::string s((const char*)buf, len);
std::pair<size_t, std::vector<tools::wallet2::transfer_details>> outputs;
std::stringstream iss;
iss << s;
- boost::archive::portable_binary_iarchive ar(iss);
- ar >> outputs;
+ binary_archive<false> ar(iss);
+ ::serialization::serialize(ar, outputs);
size_t n_outputs = wallet->import_outputs(outputs);
std::cout << boost::lexical_cast<std::string>(n_outputs) << " outputs imported" << std::endl;
END_SIMPLE_FUZZER()
diff --git a/tests/fuzz/cold-transaction.cpp b/tests/fuzz/cold-transaction.cpp
index 36fb35e15..135343704 100644
--- a/tests/fuzz/cold-transaction.cpp
+++ b/tests/fuzz/cold-transaction.cpp
@@ -40,7 +40,7 @@ BEGIN_INIT_SIMPLE_FUZZER()
static tools::wallet2 local_wallet;
wallet = &local_wallet;
- static const char * const spendkey_hex = "0b4f47697ec99c3de6579304e5f25c68b07afbe55b71d99620bf6cbf4e45a80f";
+ static const char * const spendkey_hex = "f285d4ac9e66271256fc7cde0d3d6b36f66efff6ccd766706c408e86f4997a0d";
crypto::secret_key spendkey;
epee::string_tools::hex_to_pod(spendkey_hex, spendkey);
@@ -50,12 +50,12 @@ BEGIN_INIT_SIMPLE_FUZZER()
END_INIT_SIMPLE_FUZZER()
BEGIN_SIMPLE_FUZZER()
- std::string s = std::string("\x01\x16serialization::archive") + std::string((const char*)buf, len);
+ std::string s((const char*)buf, len);
tools::wallet2::unsigned_tx_set exported_txs;
std::stringstream iss;
iss << s;
- boost::archive::portable_binary_iarchive ar(iss);
- ar >> exported_txs;
+ binary_archive<false> ar(iss);
+ ::serialization::serialize(ar, exported_txs);
std::vector<tools::wallet2::pending_tx> ptx;
bool success = wallet->sign_tx(exported_txs, "/tmp/cold-transaction-test-signed", ptx);
std::cout << (success ? "signed" : "error") << std::endl;