use of org.hyperledger.besu.ethereum.privacy.storage.PrivateStateKeyValueStorage in project besu by hyperledger.
the class PrivacyBlockProcessorTest method setUp.
@Before
public void setUp() {
blockProcessor = mock(AbstractBlockProcessor.class);
privateStateStorage = new PrivateStateKeyValueStorage(new InMemoryKeyValueStorage());
privateWorldStateArchive = mock(WorldStateArchive.class);
enclave = mock(Enclave.class);
protocolSchedule = mock(ProtocolSchedule.class);
this.privacyBlockProcessor = new PrivacyBlockProcessor(blockProcessor, protocolSchedule, enclave, privateStateStorage, privateWorldStateArchive, new PrivateStateRootResolver(privateStateStorage), new PrivateStateGenesisAllocator(true, (privacyGroupId, blockNumber) -> Collections::emptyList));
publicWorldStateArchive = mock(WorldStateArchive.class);
privacyBlockProcessor.setPublicWorldStateArchive(publicWorldStateArchive);
}
use of org.hyperledger.besu.ethereum.privacy.storage.PrivateStateKeyValueStorage in project besu by hyperledger.
the class PrivateStorageMigrationTest method setUp.
@Before
public void setUp() {
final KeyValueStorage kvStorage = new InMemoryKeyValueStorage();
privateStateStorage = new PrivateStateKeyValueStorage(kvStorage);
privateStateRootResolver = new PrivateStateRootResolver(privateStateStorage);
lenient().when(protocolSchedule.getByBlockNumber(anyLong())).thenReturn(protocolSpec);
lenient().when(protocolSpec.getTransactionProcessor()).thenReturn(transactionProcessor);
lenient().when(protocolSpec.getTransactionReceiptFactory()).thenReturn(transactionReceiptFactory);
lenient().when(protocolSpec.getBlockReward()).thenReturn(Wei.ZERO);
lenient().when(protocolSpec.getMiningBeneficiaryCalculator()).thenReturn(miningBeneficiaryCalculator);
lenient().when(protocolSpec.isSkipZeroBlockRewards()).thenReturn(false);
migration = new PrivateStorageMigration(blockchain, PRIVACY_ADDRESS, protocolSchedule, publicWorldStateArchive, privateStateStorage, privateStateRootResolver, legacyPrivateStateStorage, (protocolSpec) -> privateMigrationBlockProcessor);
}
Aggregations