Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into integrated_…
Browse files Browse the repository at this point in the history
…node
  • Loading branch information
anatolse committed Dec 4, 2023
2 parents 34364cd + 847d23a commit 494fdce
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bvm/Shaders/nephrite/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ struct AppGlobalPlus
pFc[2].m_Amount = tx.m_GovPull;
pFc[2].m_Aid = m_Settings.m_AidGov;
pFc[2].m_Consume = 0;
AdjustChargeFunds(pFc[2], nCharge);

if (m_Balance.m_Gov && !bUseBank)
{
Expand Down Expand Up @@ -995,7 +996,7 @@ ON_METHOD(user, upd_stab)
Charge::StdCall() +
Env::Cost::LoadVar_For(sizeof(StabPoolEntry)) +
Env::Cost::SaveVar_For(sizeof(StabPoolEntry)) +
Charge::StabPoolOp0 * 2 + // account for reward calculation
Charge::StabPoolOp0 * 3 + // calculate reward, calculate stab, re-enter stab
g.m_EpochStorageStab.m_Charge +
Env::Cost::Cycle * 100;

Expand Down
Binary file modified bvm/Shaders/nephrite/app.wasm
Binary file not shown.
25 changes: 25 additions & 0 deletions node/unittests/node_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,31 @@ namespace beam
db.get_CacheState(cs);
verify_test(cs.m_SizeCurrent == 0);
}

{
// accounts
NodeDB::WalkerAccount::DataPlus acc;
Merkle::Hash hv3 = 5u;
acc.m_Owner = hv3;
acc.m_hTxoHi = 10;
acc.m_iAccount = 1;
acc.m_Serif = 6u;
db.InsertAccount(acc);

acc.m_hTxoHi = 99;
db.SetAccountTxoHi(acc);

NodeDB::WalkerAccount wlk;
db.EnumAccounts(wlk);
verify_test(wlk.MoveNext());

verify_test(wlk.m_Data.m_iAccount == acc.m_iAccount);
verify_test(wlk.m_Data.m_hTxoHi == acc.m_hTxoHi);
verify_test(wlk.m_Data.m_Serif == acc.m_Serif);
verify_test(!wlk.m_Data.m_Owner.cmp(acc.m_Owner));

verify_test(!wlk.MoveNext());
}
}

#ifdef WIN32
Expand Down

0 comments on commit 494fdce

Please sign in to comment.