mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-09 23:25:16 -08:00
Basic "chain hardening" for slightly untrusted daemons (#93)
This commit is contained in:
committed by
Lee *!* Clagett
parent
db66d410cd
commit
351ccaa872
@@ -90,7 +90,7 @@ LWS_CASE("db::storage::sync_chain")
|
||||
{
|
||||
const lws::account accounts[1] = {lws::account{get_account(), {}, {}}};
|
||||
EXPECT(accounts[0].scan_height() == last_block.id);
|
||||
EXPECT(db.update(last_block.id, chain, accounts));
|
||||
EXPECT(db.update(last_block.id, chain, accounts, nullptr));
|
||||
EXPECT(get_account().scan_height == lws::db::block_id(std::uint64_t(last_block.id) + 4));
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ LWS_CASE("db::storage::*_webhook")
|
||||
{
|
||||
crypto::hash chain[2] = {head.hash, crypto::rand<crypto::hash>()};
|
||||
|
||||
auto updated = db.update(head.id, chain, {std::addressof(full_account), 1});
|
||||
auto updated = db.update(head.id, chain, {std::addressof(full_account), 1}, nullptr);
|
||||
EXPECT(!updated.has_error());
|
||||
EXPECT(updated->first == 1);
|
||||
if (i < 3)
|
||||
@@ -185,7 +185,7 @@ LWS_CASE("db::storage::*_webhook")
|
||||
const std::vector<lws::db::output> outs = full_account.outputs();
|
||||
EXPECT(outs.size() == 1);
|
||||
|
||||
const auto updated = db.update(last_block.id, chain, {std::addressof(full_account), 1});
|
||||
const auto updated = db.update(last_block.id, chain, {std::addressof(full_account), 1}, nullptr);
|
||||
EXPECT(!updated.has_error());
|
||||
EXPECT(updated->first == 1);
|
||||
EXPECT(updated->second.size() == 3);
|
||||
|
||||
@@ -425,8 +425,8 @@ LWS_CASE("lws::scanner::sync and lws::scanner::run")
|
||||
EXPECT(result->at(0).second.at(0).size() == 2);
|
||||
EXPECT(result->at(0).second.at(0).at(0) == lws::db::minor_index(1));
|
||||
EXPECT(result->at(0).second.at(0).at(1) == lws::db::minor_index(2));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<cryptonote::tx_destination_entry> destinations;
|
||||
destinations.emplace_back();
|
||||
destinations.back().amount = 8000;
|
||||
|
||||
Reference in New Issue
Block a user