Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: fix consensus version inconsistency in newTestLedger #5342

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ledger/eval/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,21 +611,23 @@ func newTestLedger(t testing.TB, balances bookkeeping.GenesisBalances) *evalTest
rewardsPool: balances.RewardsPool,
}

protoVersion := protocol.ConsensusFuture
proto := config.Consensus[protoVersion]

crypto.RandBytes(l.genesisHash[:])
genBlock, err := bookkeeping.MakeGenesisBlock(protocol.ConsensusFuture,
genBlock, err := bookkeeping.MakeGenesisBlock(protoVersion,
balances, "test", l.genesisHash)
require.NoError(t, err)
l.roundBalances[0] = balances.Balances
l.blocks[0] = genBlock

// calculate the accounts totals.
var ot basics.OverflowTracker
proto := config.Consensus[protocol.ConsensusCurrentVersion]
for _, acctData := range balances.Balances {
l.latestTotals.AddAccount(proto, ledgercore.ToAccountData(acctData), &ot)
}
l.genesisProto = proto
l.genesisProtoVersion = protocol.ConsensusCurrentVersion
l.genesisProtoVersion = protoVersion

require.False(t, genBlock.FeeSink.IsZero())
require.False(t, genBlock.RewardsPool.IsZero())
Expand Down