Skip to content

Commit

Permalink
fix new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cce committed Mar 27, 2024
1 parent c054b3c commit 6305819
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ledger/eval/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ func (ledger *evalTestLedger) endBlock(t testing.TB, eval *BlockEvaluator) *ledg
// fake agreement's setting of header fields so later validates work.
seed := committee.Seed{}
crypto.RandBytes(seed[:])
*validatedBlock = validatedBlock.WithProposer(seed, testPoolAddr, true)
*validatedBlock = ledgercore.MakeValidatedBlock(validatedBlock.Block().WithProposer(seed, testPoolAddr, true), validatedBlock.Delta())
err = ledger.AddValidatedBlock(*validatedBlock, agreement.Certificate{})
require.NoError(t, err)
return validatedBlock
Expand Down Expand Up @@ -1212,7 +1212,7 @@ func TestEvalFunctionForExpiredAccounts(t *testing.T) {
require.NoError(t, err)

// fake agreement's setting of header fields so later validates work
*validatedBlock = validatedBlock.WithProposer(committee.Seed{}, testPoolAddr, true)
*validatedBlock = ledgercore.MakeValidatedBlock(validatedBlock.Block().WithProposer(committee.Seed{}, testPoolAddr, true), validatedBlock.Delta())

expired := false
for _, acct := range validatedBlock.Block().ExpiredParticipationAccounts {
Expand Down Expand Up @@ -1454,7 +1454,7 @@ func TestAbsenteeChecks(t *testing.T) {
require.NoError(t, err)

// fake agreement's setting of header fields so later validates work
*validatedBlock = validatedBlock.WithProposer(committee.Seed{}, testPoolAddr, true)
*validatedBlock = ledgercore.MakeValidatedBlock(validatedBlock.Block().WithProposer(committee.Seed{}, testPoolAddr, true), validatedBlock.Delta())

require.Zero(t, validatedBlock.Block().ExpiredParticipationAccounts)
require.Contains(t, validatedBlock.Block().AbsentParticipationAccounts, addrs[0], addrs[0].String())
Expand Down
4 changes: 2 additions & 2 deletions ledger/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ func endBlock(t testing.TB, ledger *Ledger, eval *eval.BlockEvaluator, proposer
// can't call the agreement code, the eligibility of the prp is not
// considered.
if ledger.GenesisProto().Payouts.Enabled {
*vb = vb.WithProposer(committee.Seed(prp), prp, true)
*vb = ledgercore.MakeValidatedBlock(vb.Block().WithProposer(committee.Seed(prp), prp, true), vb.Delta())
} else {
// To more closely mimic the agreement code, we don't
// write the proposer when !Payouts.Enabled.
*vb = vb.WithProposer(committee.Seed(prp), basics.Address{}, false)
*vb = ledgercore.MakeValidatedBlock(vb.Block().WithProposer(committee.Seed(prp), basics.Address{}, false), vb.Delta())
}

err = ledger.AddValidatedBlock(*vb, agreement.Certificate{})
Expand Down

0 comments on commit 6305819

Please sign in to comment.