diff --git a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/record/RecordListBuilder.java b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/record/RecordListBuilder.java index 5e824a5999a8..cf99fdebe3bc 100644 --- a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/record/RecordListBuilder.java +++ b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/record/RecordListBuilder.java @@ -32,6 +32,7 @@ import com.hedera.node.app.workflows.handle.HandleContextImpl; import com.hedera.node.app.workflows.handle.record.SingleTransactionRecordBuilderImpl.ReversingBehavior; import com.hedera.node.config.data.ConsensusConfig; +import com.hedera.pbj.runtime.io.buffer.Bytes; import com.swirlds.config.api.Configuration; import edu.umd.cs.findbugs.annotations.NonNull; import java.time.Instant; @@ -376,7 +377,31 @@ public void revertChildrenOf(@NonNull final SingleTransactionRecordBuilderImpl r followingChildRemoved = true; } else { if (child.reversingBehavior() == ReversingBehavior.REVERSIBLE && SUCCESSES.contains(child.status())) { + // clear "side effect" fields + 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); + child.topicRunningHashVersion(0L); + child.topicSequenceNumber(0L); child.tokenTransferLists().clear(); + child.automaticTokenAssociations().clear(); + if (child.transferList().hasAccountAmounts()) { + child.transferList().accountAmounts().clear(); + } + child.paidStakingRewards().clear(); + child.contractCreateResult(null); + child.scheduleRef(null); + child.assessedCustomFees().clear(); + child.alias(Bytes.EMPTY); + child.ethereumHash(Bytes.EMPTY); + child.evmAddress(Bytes.EMPTY); + child.status(ResponseCodeEnum.REVERTED_SUCCESS); } diff --git a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/record/SingleTransactionRecordBuilderImpl.java b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/record/SingleTransactionRecordBuilderImpl.java index 5b38c7e474e1..b4d5af6d913c 100644 --- a/hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/record/SingleTransactionRecordBuilderImpl.java +++ b/hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/record/SingleTransactionRecordBuilderImpl.java @@ -482,6 +482,17 @@ public SingleTransactionRecordBuilderImpl contractCreateResult( return this; } + /** + * Gets the transferList. + * + * @return transferList + */ + @Override + @NonNull + public TransferList transferList() { + return transferList; + } + /** * Sets the transferList. * @@ -496,12 +507,6 @@ public SingleTransactionRecordBuilderImpl transferList(@NonNull final TransferLi return this; } - @Override - @NonNull - public TransferList transferList() { - return transferList; - } - /** * Sets the tokenTransferLists. * @@ -549,6 +554,16 @@ public SingleTransactionRecordBuilderImpl scheduleRef(@NonNull final ScheduleID return this; } + /** + * Gets the assessedCustomFees. + * + * @return assessedCustomFees + */ + @NonNull + public List assessedCustomFees() { + return this.assessedCustomFees; + } + /** * Sets the assessedCustomFees. * @@ -577,6 +592,16 @@ public SingleTransactionRecordBuilderImpl addAssessedCustomFee(@NonNull final As return this; } + /** + * Gets the automaticTokenAssociations. + * + * @return automaticTokenAssociations + */ + @NonNull + public List automaticTokenAssociations() { + return this.automaticTokenAssociations; + } + /** * Sets the automaticTokenAssociations. * @@ -631,6 +656,16 @@ public SingleTransactionRecordBuilderImpl ethereumHash(@NonNull final Bytes ethe return this; } + /** + * Gets the paidStakingRewards. + * + * @return paidStakingRewards + */ + @NonNull + public final List paidStakingRewards() { + return this.paidStakingRewards; + } + /** * Sets the paidStakingRewards. *