Skip to content

Commit

Permalink
Correctly compute prevRandao in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mashonskii committed Sep 17, 2024
1 parent 3828447 commit 77dc7df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/test/scala/units/ExtensionDomain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,15 @@ class ExtensionDomain(
def createEcBlockBuilder(hashPath: String, miner: ElMinerSettings, parent: EcBlock = ecGenesisBlock): TestEcBlockBuilder =
createEcBlockBuilder(hashPath, miner.elRewardAddress, parent)

def createEcBlockBuilder(hashPath: String, minerRewardL2Address: EthAddress, parent: EcBlock): TestEcBlockBuilder =
def createEcBlockBuilder(hashPath: String, minerRewardL2Address: EthAddress, parent: EcBlock): TestEcBlockBuilder = {
TestEcBlockBuilder(ecClients, elBridgeAddress, elMinerDefaultReward, l2Config.blockDelay, parent = parent).updateBlock(
_.copy(
hash = TestEcBlockBuilder.createBlockHash(hashPath),
minerRewardL2Address = minerRewardL2Address
minerRewardL2Address = minerRewardL2Address,
prevRandao = ELUpdater.calculateRandao(blockchain.vrf(blockchain.height).get, parent.hash)
)
)
}

override def currentHitSource: BlockId =
blockchain.hitSource(blockchain.height).getOrElse(throw new RuntimeException(s"Can't get hit source for ${blockchain.height}"))
Expand Down

0 comments on commit 77dc7df

Please sign in to comment.