use of org.hyperledger.besu.evm.worldstate.WrappedEvmAccount in project besu by hyperledger.
the class PrivacyBlockProcessorTest method mockPrivateStateArchive.
private MutableWorldState mockPrivateStateArchive() {
final MutableWorldState mockPrivateState = mock(MutableWorldState.class);
final WorldUpdater mockWorldUpdater = mock(WorldUpdater.class);
final WrappedEvmAccount mockWrappedEvmAccount = mock(WrappedEvmAccount.class);
final MutableAccount mockMutableAccount = mock(MutableAccount.class);
when(mockWrappedEvmAccount.getMutable()).thenReturn(mockMutableAccount);
when(mockWorldUpdater.createAccount(any())).thenReturn(mockWrappedEvmAccount);
when(mockPrivateState.updater()).thenReturn(mockWorldUpdater);
when(mockPrivateState.rootHash()).thenReturn(Hash.ZERO);
return mockPrivateState;
}
use of org.hyperledger.besu.evm.worldstate.WrappedEvmAccount in project besu by hyperledger.
the class DebugOperationTracerTest method setupStorageForCapture.
private Map<UInt256, UInt256> setupStorageForCapture(final MessageFrame frame) {
final WrappedEvmAccount account = mock(WrappedEvmAccount.class);
final MutableAccount mutableAccount = mock(MutableAccount.class);
when(account.getMutable()).thenReturn(mutableAccount);
when(worldUpdater.getAccount(frame.getRecipientAddress())).thenReturn(account);
final Map<UInt256, UInt256> updatedStorage = new TreeMap<>();
updatedStorage.put(UInt256.ZERO, UInt256.valueOf(233));
updatedStorage.put(UInt256.ONE, UInt256.valueOf(2424));
when(mutableAccount.getUpdatedStorage()).thenReturn(updatedStorage);
final Bytes32 word1 = Bytes32.fromHexString("0x01");
final Bytes32 word2 = Bytes32.fromHexString("0x02");
final Bytes32 word3 = Bytes32.fromHexString("0x03");
frame.writeMemory(0, 32, word1);
frame.writeMemory(32, 32, word2);
frame.writeMemory(64, 32, word3);
return updatedStorage;
}
use of org.hyperledger.besu.evm.worldstate.WrappedEvmAccount in project besu by hyperledger.
the class DefaultMutablePrivateWorldStateUpdater method getAccount.
@Override
public EvmAccount getAccount(final Address address) {
final EvmAccount privateAccount = privateWorldUpdater.getAccount(address);
if (privateAccount != null && !privateAccount.isEmpty()) {
return privateAccount;
}
final EvmAccount publicAccount = publicWorldUpdater.getAccount(address);
if (publicAccount != null && !publicAccount.isEmpty()) {
// FIXME
((WrappedEvmAccount) publicAccount).setImmutable(true);
return publicAccount;
}
return privateAccount;
}
Aggregations