Skip to content

Commit

Permalink
Sonar suggested improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioDemianLerner authored and fedejinich committed Nov 23, 2021
1 parent 361ff2e commit 81b7d0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public String estimateGas(CallArguments args) {
if (res.getCallWithValuePerformed()) {
gasNeeded += GasCost.STIPEND_CALL;
}
return s = TypeConverter.toQuantityJsonHex(gasNeeded);
s = TypeConverter.toQuantityJsonHex(gasNeeded);
return s;
} finally {
LOGGER.debug("eth_estimateGas(): {}", s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,7 @@ private void finalization() {
long gasRefund = Math.min(result.getFutureRefund(), result.getGasUsed() / 2);
result.addDeductedRefund(gasRefund);

if (program != null) {
if (program.getCallWithValuePerformed())
if ((program != null) && (program.getCallWithValuePerformed())) {
result.markCallWithValuePerformed();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ public class ProgramResult {
private long deductedRefund =0;
private boolean callWithValuePerformed;


/*
* for testing runs ,
* call/create is not executed
* but dummy recorded
*/
private List<CallCreate> callCreateList;

public boolean getCallWithValuePerformed() {
return callWithValuePerformed;
}
Expand All @@ -60,12 +68,6 @@ public void markCallWithValuePerformed() {
callWithValuePerformed =true;
}

/*
* for testing runs ,
* call/create is not executed
* but dummy recorded
*/
private List<CallCreate> callCreateList;

public void clearUsedGas() {
gasUsed = 0;
Expand Down

0 comments on commit 81b7d0d

Please sign in to comment.