Merge remote-tracking branch 'upstream/develop' into sponsor

This commit is contained in:
tequ
2026-04-30 10:20:37 +09:00
committed by Oleksandr
299 changed files with 5000 additions and 2056 deletions

View File

@@ -4026,7 +4026,7 @@ private:
ChainStateTrack b_;
};
enum SmState {
enum class SmState {
st_initial,
st_claim_id_created,
st_attesting,
@@ -4035,8 +4035,6 @@ private:
st_closed,
};
enum Act_Flags { af_a2b = 1 << 0 };
// --------------------------------------------------
template <class T>
class SmBase
@@ -4170,7 +4168,7 @@ private:
st.spend(dstDoor(), reward, num_attestors);
st.transfer(dstDoor(), cr.to, cr.amt);
st.env.env_.memoize(cr.to);
sm_state = st_completed;
sm_state = SmState::st_completed;
};
counters.create_callbacks[cr.claim_id - 1] = std::move(complete_cb);
@@ -4181,12 +4179,12 @@ private:
{
switch (sm_state)
{
case st_initial:
case SmState::st_initial:
cr.claim_id = issue_account_create();
sm_state = st_attesting;
sm_state = SmState::st_attesting;
break;
case st_attesting:
case SmState::st_attesting:
attest(time, rnd);
break;
@@ -4194,14 +4192,14 @@ private:
assert(0);
break;
case st_completed:
case SmState::st_completed:
break; // will get this once
}
return sm_state;
}
private:
SmState sm_state{st_initial};
SmState sm_state{SmState::st_initial};
AccountCreate cr;
};
@@ -4330,35 +4328,36 @@ private:
{
switch (sm_state)
{
case st_initial:
case SmState::st_initial:
xfer.claim_id = create_claim_id();
sm_state = st_claim_id_created;
sm_state = SmState::st_claim_id_created;
break;
case st_claim_id_created:
case SmState::st_claim_id_created:
commit();
sm_state = st_attesting;
sm_state = SmState::st_attesting;
break;
case st_attesting:
case SmState::st_attesting:
if (attest(time, rnd))
{
sm_state = xfer.with_claim == WithClaim::yes ? st_attested : st_completed;
sm_state = xfer.with_claim == WithClaim::yes ? SmState::st_attested
: SmState::st_completed;
}
else
{
sm_state = st_attesting;
sm_state = SmState::st_attesting;
}
break;
case st_attested:
case SmState::st_attested:
assert(xfer.with_claim == WithClaim::yes);
claim();
sm_state = st_completed;
sm_state = SmState::st_completed;
break;
default:
case st_completed:
case SmState::st_completed:
assert(0); // should have been removed
break;
}
@@ -4367,7 +4366,7 @@ private:
private:
Transfer xfer;
SmState sm_state{st_initial};
SmState sm_state{SmState::st_initial};
};
// --------------------------------------------------
@@ -4414,7 +4413,7 @@ public:
return sm.advance(time, rnd);
};
auto& [t, sm] = *it;
if (t <= time && std::visit(vis, sm) == st_completed)
if (t <= time && std::visit(vis, sm) == SmState::st_completed)
{
it = sm_.erase(it);
}