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

Consensus: Consensus version v40, set major release to 4 and reset minor. #6207

Merged
merged 11 commits into from
Dec 20, 2024
Prev Previous commit
Next Next commit
fix TestBonus
  • Loading branch information
cce committed Dec 20, 2024
commit 7cb71b695df8bda03caea8b4167972db44391bc7
12 changes: 11 additions & 1 deletion data/bookkeeping/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,22 @@ import (
var delegatesMoney = basics.MicroAlgos{Raw: 1000 * 1000 * 1000}

var proto1 = protocol.ConsensusVersion("Test1")
var proto1NoBonus = protocol.ConsensusVersion("Test1NoBonus")
var proto2 = protocol.ConsensusVersion("Test2")
var proto3 = protocol.ConsensusVersion("Test3")
var protoUnsupported = protocol.ConsensusVersion("TestUnsupported")
var protoDelay = protocol.ConsensusVersion("TestDelay")

func init() {
verBeforeBonus := protocol.ConsensusV39
params1NB := config.Consensus[verBeforeBonus]
params1NB.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{
proto2: 0,
}
params1NB.MinUpgradeWaitRounds = 0
params1NB.MaxUpgradeWaitRounds = 0
config.Consensus[proto1NoBonus] = params1NB

params1 := config.Consensus[protocol.ConsensusCurrentVersion]
params1.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{
proto2: 0,
Expand Down Expand Up @@ -263,7 +273,7 @@ func TestBonus(t *testing.T) {
t.Parallel()

var prev Block
prev.CurrentProtocol = proto1
prev.CurrentProtocol = proto1NoBonus
prev.BlockHeader.GenesisID = t.Name()
crypto.RandBytes(prev.BlockHeader.GenesisHash[:])

Expand Down
Loading