@@ -15,11 +15,11 @@ class PrecompiledContractsSpec extends FunSuite with Matchers with PropertyCheck
15
15
16
16
val vm = new TestVM
17
17
18
- def buildContext (recipient : Address , inputData : ByteString , gas : UInt256 = 1000000 ): PC = {
18
+ def buildContext (recipient : Address , inputData : ByteString , gas : UInt256 = 1000000 , blockNumber : BigInt = 0 ): PC = {
19
19
val origin = Address (0xcafebabe )
20
20
21
21
val fakeHeader = BlockHeader (ByteString .empty, ByteString .empty, ByteString .empty, ByteString .empty,
22
- ByteString .empty, ByteString .empty, ByteString .empty, 0 , 0 , 0 , 0 , 0 , ByteString .empty, ByteString .empty, ByteString .empty)
22
+ ByteString .empty, ByteString .empty, ByteString .empty, 0 , blockNumber , 0 , 0 , 0 , ByteString .empty, ByteString .empty, ByteString .empty)
23
23
24
24
val world = MockWorldState ().saveAccount(origin, Account .empty())
25
25
@@ -257,7 +257,7 @@ class PrecompiledContractsSpec extends FunSuite with Matchers with PropertyCheck
257
257
forAll(testData) { (input, expectedResult) =>
258
258
val inputArray = Hex .decode(input)
259
259
val expectedNumOfRounds = BigInt (1 , inputArray.take(4 ))
260
- val context = buildContext(PrecompiledContracts .Blake2bCompressionAddr , ByteString (inputArray))
260
+ val context = buildContext(PrecompiledContracts .Blake2bCompressionAddr , ByteString (inputArray), blockNumber = Fixtures . PhoenixBlockNumber + 1 )
261
261
val result = vm.run(context)
262
262
val gasUsed = context.startGas - result.gasRemaining
263
263
gasUsed shouldEqual expectedNumOfRounds
0 commit comments