|
|
|
@ -18,6 +18,7 @@ import org.hyperledger.besu.ethereum.core.Address; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.EvmAccount; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.UpdateTrackingAccount; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.WorldUpdater; |
|
|
|
|
import org.hyperledger.besu.ethereum.vm.MessageFrame; |
|
|
|
|
|
|
|
|
|
// This class uses a public WorldUpdater and a private WorldUpdater to provide a
|
|
|
|
|
// MutableWorldStateUpdater that can read and write from the private world state and can read from
|
|
|
|
@ -32,6 +33,16 @@ public class GoQuorumMutablePrivateWorldStateUpdater |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public EvmAccount getOrCreateSenderAccount(final Address address) { |
|
|
|
|
return new UpdateTrackingAccount<EvmAccount>(publicWorldUpdater.getOrCreate(address)); |
|
|
|
|
return new UpdateTrackingAccount<>(publicWorldUpdater.getOrCreate(address)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public EvmAccount getSenderAccount(final MessageFrame frame) { |
|
|
|
|
final Address senderAddress = frame.getSenderAddress(); |
|
|
|
|
if (senderAddress.equals(frame.getOriginatorAddress())) { |
|
|
|
|
return new UpdateTrackingAccount<>(publicWorldUpdater.getOrCreate(senderAddress)); |
|
|
|
|
} else { |
|
|
|
|
return getAccount(senderAddress); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|