|
|
|
@ -24,18 +24,18 @@ import org.hyperledger.besu.evm.frame.BlockValues; |
|
|
|
|
import org.hyperledger.besu.evm.frame.MessageFrame; |
|
|
|
|
import org.hyperledger.besu.evm.gascalculator.LondonGasCalculator; |
|
|
|
|
import org.hyperledger.besu.evm.operation.Operation; |
|
|
|
|
import org.hyperledger.besu.evm.operation.RandomOperation; |
|
|
|
|
import org.hyperledger.besu.evm.operation.PrevRanDaoOperation; |
|
|
|
|
|
|
|
|
|
import org.apache.tuweni.bytes.Bytes; |
|
|
|
|
import org.apache.tuweni.bytes.Bytes32; |
|
|
|
|
import org.apache.tuweni.units.bigints.UInt256; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
public class RandomOperationTest { |
|
|
|
|
public class PrevRanDaoOperationTest { |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void pushesRandWhenDifficultyZero() { |
|
|
|
|
RandomOperation op = new RandomOperation(new LondonGasCalculator()); |
|
|
|
|
PrevRanDaoOperation op = new PrevRanDaoOperation(new LondonGasCalculator()); |
|
|
|
|
MessageFrame messageFrame = mock(MessageFrame.class); |
|
|
|
|
BlockValues blockHeader = mock(BlockValues.class); |
|
|
|
|
Bytes32 rand = Bytes32.fromHexString("0xb0b0face"); |
|
|
|
@ -50,7 +50,7 @@ public class RandomOperationTest { |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void pushesDifficultyWhenPresent() { |
|
|
|
|
RandomOperation op = new RandomOperation(new LondonGasCalculator()); |
|
|
|
|
PrevRanDaoOperation op = new PrevRanDaoOperation(new LondonGasCalculator()); |
|
|
|
|
MessageFrame messageFrame = mock(MessageFrame.class); |
|
|
|
|
BlockValues blockHeader = mock(BlockValues.class); |
|
|
|
|
Bytes32 rand = Bytes32.fromHexString("0xb0b0face"); |