resolve todos

This commit is contained in:
Mayukha Vadari
2025-10-14 17:54:54 -04:00
parent 91455b6860
commit c6c54b3282

View File

@@ -695,7 +695,6 @@ EscrowCreate::doApply()
}
// increment owner count
// TODO: determine actual reserve based on FinishFunction size
adjustOwnerCount(ctx_.view(), sle, reserveToAdd, ctx_.journal);
ctx_.view().update(sle);
return tesSUCCESS;
@@ -1345,12 +1344,17 @@ EscrowFinish::doApply()
if (re.has_value())
{
JLOG(j_.debug()) << "WASM Success: " + std::to_string(reValue)
<< ", cost: " << reCost;
auto reValue = re.value().result;
ctx_.setWasmReturnCode(reValue);
// TODO: better error handling for this conversion
ctx_.setGasUsed(static_cast<uint32_t>(re.value().cost));
JLOG(j_.debug()) << "WASM Success: " + std::to_string(reValue)
<< ", cost: " << re.value().cost;
auto reCost = re.value().cost;
if (reCost < 0 || reCost > std::numeric_limits<uint32_t>::max())
return tecINTERNAL; // LCOV_EXCL_LINE
ctx_.setGasUsed(static_cast<uint32_t>(reCost));
if (reValue <= 0)
{
return tecWASM_REJECTED;