Skip to content

Commit

Permalink
fix: use null for missing fields
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
  • Loading branch information
thenswan committed Dec 12, 2023
1 parent 1c250da commit 03be5d0
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@
import static java.util.Collections.unmodifiableList;
import static java.util.Objects.requireNonNull;

import com.hedera.hapi.node.base.AccountID;
import com.hedera.hapi.node.base.ContractID;
import com.hedera.hapi.node.base.FileID;
import com.hedera.hapi.node.base.ResponseCodeEnum;
import com.hedera.hapi.node.base.ScheduleID;
import com.hedera.hapi.node.base.TokenID;
import com.hedera.hapi.node.base.TransactionID;
import com.hedera.hapi.node.contract.ContractFunctionResult;
import com.hedera.node.app.spi.workflows.HandleContext;
import com.hedera.node.app.spi.workflows.HandleContext.TransactionCategory;
import com.hedera.node.app.spi.workflows.HandleException;
Expand Down Expand Up @@ -384,12 +378,12 @@ public void revertChildrenOf(@NonNull final SingleTransactionRecordBuilderImpl r
} else {
if (child.reversingBehavior() == ReversingBehavior.REVERSIBLE && SUCCESSES.contains(child.status())) {
// clear "side effect" fields
child.accountID(AccountID.DEFAULT);
child.contractID(ContractID.DEFAULT);
child.fileID(FileID.DEFAULT);
child.tokenID(TokenID.DEFAULT);
child.scheduleID(ScheduleID.DEFAULT);
child.scheduledTransactionID(TransactionID.DEFAULT);
child.accountID(null);
child.contractID(null);
child.fileID(null);
child.tokenID(null);
child.scheduleID(null);
child.scheduledTransactionID(null);
child.serialNumbers().clear();
child.topicRunningHash(Bytes.EMPTY);
child.newTotalSupply(-1L);
Expand All @@ -401,8 +395,8 @@ public void revertChildrenOf(@NonNull final SingleTransactionRecordBuilderImpl r
child.transferList().accountAmounts().clear();
}
child.paidStakingRewards().clear();
child.contractCreateResult(ContractFunctionResult.DEFAULT);
child.scheduleRef(ScheduleID.DEFAULT);
child.contractCreateResult(null);
child.scheduleRef(null);
child.assessedCustomFees().clear();
child.alias(Bytes.EMPTY);
child.ethereumHash(Bytes.EMPTY);
Expand Down

0 comments on commit 03be5d0

Please sign in to comment.