Skip to content

Commit

Permalink
Rename method (#412)
Browse files Browse the repository at this point in the history
* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for

Signed-off-by: Stefan Pingel <[email protected]>

* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for

Signed-off-by: Stefan Pingel <[email protected]>

* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for

Signed-off-by: Stefan Pingel <[email protected]>
  • Loading branch information
pinges authored Feb 19, 2020
1 parent 8afd651 commit 1b0dffc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public Result processTransaction(
final Address miningBeneficiary,
final OperationTracer operationTracer,
final BlockHashLookup blockHashLookup,
final Boolean isPersistingState,
final Boolean isPersistingPrivateState,
final TransactionValidationParams transactionValidationParams) {
LOG.trace("Starting execution of {}", transaction);

Expand Down Expand Up @@ -246,7 +246,7 @@ public Result processTransaction(
.completer(c -> {})
.miningBeneficiary(miningBeneficiary)
.blockHashLookup(blockHashLookup)
.isPersistingState(isPersistingState)
.isPersistingPrivateState(isPersistingPrivateState)
.maxStackSize(maxStackSize)
.transactionHash(transaction.getHash())
.build();
Expand Down Expand Up @@ -279,7 +279,7 @@ public Result processTransaction(
.miningBeneficiary(miningBeneficiary)
.blockHashLookup(blockHashLookup)
.maxStackSize(maxStackSize)
.isPersistingState(isPersistingState)
.isPersistingPrivateState(isPersistingPrivateState)
.transactionHash(transaction.getHash())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ default boolean isSuccessful() {
* @param transaction The transaction to process
* @param miningBeneficiary The address which is to receive the transaction fee
* @param blockHashLookup The {@link BlockHashLookup} to use for BLOCKHASH operations
* @param isPersistingState Whether the state will be modified by this process
* @param isPersistingPrivateState Whether the resulting private state will be persisted
* @param transactionValidationParams Validation parameters that will be used by the {@link
* TransactionValidator}
* @return the transaction result
Expand All @@ -130,7 +130,7 @@ default Result processTransaction(
final Transaction transaction,
final Address miningBeneficiary,
final BlockHashLookup blockHashLookup,
final Boolean isPersistingState,
final Boolean isPersistingPrivateState,
final TransactionValidationParams transactionValidationParams) {
return processTransaction(
blockchain,
Expand All @@ -140,7 +140,7 @@ default Result processTransaction(
miningBeneficiary,
OperationTracer.NO_TRACING,
blockHashLookup,
isPersistingState,
isPersistingPrivateState,
transactionValidationParams);
}

Expand All @@ -154,7 +154,7 @@ default Result processTransaction(
* @param operationTracer The tracer to record results of each EVM operation
* @param miningBeneficiary The address which is to receive the transaction fee
* @param blockHashLookup The {@link BlockHashLookup} to use for BLOCKHASH operations
* @param isPersistingState Whether the state will be modified by this process
* @param isPersistingPrivateState Whether the resulting private state will be persisted
* @return the transaction result
*/
default Result processTransaction(
Expand All @@ -165,7 +165,7 @@ default Result processTransaction(
final Address miningBeneficiary,
final OperationTracer operationTracer,
final BlockHashLookup blockHashLookup,
final Boolean isPersistingState) {
final Boolean isPersistingPrivateState) {
return processTransaction(
blockchain,
worldState,
Expand All @@ -174,7 +174,7 @@ default Result processTransaction(
miningBeneficiary,
operationTracer,
blockHashLookup,
isPersistingState,
isPersistingPrivateState,
new TransactionValidationParams.Builder().build());
}

Expand All @@ -186,6 +186,6 @@ Result processTransaction(
Address miningBeneficiary,
OperationTracer operationTracer,
BlockHashLookup blockHashLookup,
Boolean isPersistingState,
Boolean isPersistingPrivateState,
TransactionValidationParams transactionValidationParams);
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public Gas gasRequirement(final Bytes input) {
public Bytes compute(final Bytes input, final MessageFrame messageFrame) {
final ProcessableBlockHeader currentBlockHeader = messageFrame.getBlockHeader();
if (!BlockHeader.class.isAssignableFrom(currentBlockHeader.getClass())) {
if (!messageFrame.isPersistingState()) {
if (!messageFrame.isPersistingPrivateState()) {
// We get in here from block mining.
return Bytes.EMPTY;
} else {
Expand Down Expand Up @@ -168,7 +168,7 @@ public Bytes compute(final Bytes input, final MessageFrame messageFrame) {
return Bytes.EMPTY;
}

if (messageFrame.isPersistingState()) {
if (messageFrame.isPersistingPrivateState()) {
LOG.trace(
"Persisting private state {} for privacyGroup {}",
disposablePrivateState.rootHash(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public enum Type {
private final int depth;
private final Deque<MessageFrame> messageFrameStack;
private final Address miningBeneficiary;
private final Boolean isPersistingState;
private final Boolean isPersistingPrivateState;
private Optional<Bytes> revertReason;

// Privacy Execution Environment fields.
Expand Down Expand Up @@ -267,7 +267,7 @@ private MessageFrame(
final Consumer<MessageFrame> completer,
final Address miningBeneficiary,
final BlockHashLookup blockHashLookup,
final Boolean isPersistingState,
final Boolean isPersistingPrivateState,
final Hash transactionHash,
final Optional<Bytes> revertReason,
final int maxStackSize) {
Expand Down Expand Up @@ -303,7 +303,7 @@ private MessageFrame(
this.isStatic = isStatic;
this.completer = completer;
this.miningBeneficiary = miningBeneficiary;
this.isPersistingState = isPersistingState;
this.isPersistingPrivateState = isPersistingPrivateState;
this.transactionHash = transactionHash;
this.revertReason = revertReason;
}
Expand Down Expand Up @@ -962,8 +962,8 @@ public int getMaxStackSize() {
*
* @return whether Message calls will be persisted
*/
public Boolean isPersistingState() {
return isPersistingState;
public Boolean isPersistingPrivateState() {
return isPersistingPrivateState;
}

/**
Expand Down Expand Up @@ -1020,7 +1020,7 @@ public static class Builder {
private Consumer<MessageFrame> completer;
private Address miningBeneficiary;
private BlockHashLookup blockHashLookup;
private Boolean isPersistingState = false;
private Boolean isPersistingPrivateState = false;
private Hash transactionHash;
private Optional<Bytes> reason = Optional.empty();

Expand Down Expand Up @@ -1135,8 +1135,8 @@ public Builder blockHashLookup(final BlockHashLookup blockHashLookup) {
return this;
}

public Builder isPersistingState(final Boolean isPersistingState) {
this.isPersistingState = isPersistingState;
public Builder isPersistingPrivateState(final Boolean isPersistingPrivateState) {
this.isPersistingPrivateState = isPersistingPrivateState;
return this;
}

Expand Down Expand Up @@ -1170,7 +1170,7 @@ private void validate() {
checkState(completer != null, "Missing message frame completer");
checkState(miningBeneficiary != null, "Missing mining beneficiary");
checkState(blockHashLookup != null, "Missing block hash lookup");
checkState(isPersistingState != null, "Missing isPersistingState");
checkState(isPersistingPrivateState != null, "Missing isPersistingPrivateState");
checkState(contractAccountVersion != -1, "Missing contractAccountVersion");
}

Expand Down Expand Up @@ -1199,7 +1199,7 @@ public MessageFrame build() {
completer,
miningBeneficiary,
blockHashLookup,
isPersistingState,
isPersistingPrivateState,
transactionHash,
reason,
maxStackSize);
Expand Down

0 comments on commit 1b0dffc

Please sign in to comment.