Basic "chain hardening" for slightly untrusted daemons (#93)

This commit is contained in:
Lee *!* Clagett
2024-03-07 17:39:18 -05:00
committed by Lee *!* Clagett
parent db66d410cd
commit 351ccaa872
15 changed files with 1063 additions and 82 deletions

View File

@@ -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);