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