From ad6fda3e0cc9f8cea4d473d796b7a260ff8dc4a2 Mon Sep 17 00:00:00 2001 From: Nikita Lebedev Date: Mon, 5 Feb 2024 11:05:59 +0200 Subject: [PATCH] chore: delete hasChildRecordCount() and rename hasNonStakingChildRecordCount() to it. Signed-off-by: Nikita Lebedev --- .../spec/queries/meta/HapiGetTxnRecord.java | 6 ---- .../LazyCreateThroughPrecompileSuite.java | 2 +- .../precompile/PrngPrecompileSuite.java | 2 +- .../crypto/AutoAccountCreationSuite.java | 8 +++--- .../suites/crypto/staking/StakingSuite.java | 28 +++++++++---------- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/spec/queries/meta/HapiGetTxnRecord.java b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/spec/queries/meta/HapiGetTxnRecord.java index 9a5a5210253b..7d3d83ea66f4 100644 --- a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/spec/queries/meta/HapiGetTxnRecord.java +++ b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/spec/queries/meta/HapiGetTxnRecord.java @@ -285,12 +285,6 @@ public HapiGetTxnRecord assertingNothingAboutHashes() { return this; } - public HapiGetTxnRecord hasChildRecordCount(final int count) { - requestChildRecords = true; - childRecordsCount = OptionalInt.of(count); - return this; - } - public HapiGetTxnRecord hasNonStakingChildRecordCount(final int count) { requestChildRecords = true; includeStakingRecordsInCount = false; diff --git a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/precompile/LazyCreateThroughPrecompileSuite.java b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/precompile/LazyCreateThroughPrecompileSuite.java index eba79af9c30a..65f1227c85c1 100644 --- a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/precompile/LazyCreateThroughPrecompileSuite.java +++ b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/precompile/LazyCreateThroughPrecompileSuite.java @@ -708,7 +708,7 @@ final HapiSpec revertedAutoCreationRollsBackEvenIfTopLevelSucceeds() { .hasKnownStatus(SUCCESS)); })) .then( - getTxnRecord(TRANSFER_TXN).hasChildRecordCount(1), + getTxnRecord(TRANSFER_TXN).hasNonStakingChildRecordCount(1), childRecordsCheck( TRANSFER_TXN, SUCCESS, diff --git a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/precompile/PrngPrecompileSuite.java b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/precompile/PrngPrecompileSuite.java index 836c0333ab5a..7ddbda48847b 100644 --- a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/precompile/PrngPrecompileSuite.java +++ b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/precompile/PrngPrecompileSuite.java @@ -266,7 +266,7 @@ final HapiSpec prngPrecompileHappyPathWorks() { .logged())) .then(getTxnRecord(randomBits) .andAllChildRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith() .pseudoRandomBytes() .contractCallResult(resultWith() diff --git a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/AutoAccountCreationSuite.java b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/AutoAccountCreationSuite.java index fc0a4c38d98f..653a64c87c70 100644 --- a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/AutoAccountCreationSuite.java +++ b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/AutoAccountCreationSuite.java @@ -1039,7 +1039,7 @@ final HapiSpec autoAccountCreationWorksWhenUsingAliasOfDeletedAccount() { // HapiCryptoTransfer.tinyBarsFromToWithAlias("payer", "alias", // ONE_HUNDRED_HBARS)).via( // "txn2"), - // getTxnRecord("txn2").hasChildRecordCount(1).logged() + // getTxnRecord("txn2").hasNonStakingChildRecordCount(1).logged() ); } @@ -1395,7 +1395,7 @@ final HapiSpec transferHbarsToEVMAddressAlias() { })) .then( getTxnRecord(HBAR_XFER) - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().status(SUCCESS).memo(LAZY_MEMO)), // and transfers to the 0.0.ECDSA_BYTES alias should succeed. cryptoTransfer(tinyBarsFromToWithAlias(PARTY, SECP_256K1_SOURCE_KEY, ONE_HBAR)) @@ -1544,7 +1544,7 @@ final HapiSpec transferFungibleToEVMAddressAlias() { getHollowAccountInfoAfterTransfers); })) .then(getTxnRecord(FT_XFER) - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().status(SUCCESS).memo(LAZY_MEMO))); } @@ -1679,7 +1679,7 @@ final HapiSpec cannotAutoCreateWithTxnToLongZero() { .then(withOpContext((spec, opLog) -> { getTxnRecord("failedTxn").logged(); getTxnRecord("passedTxn") - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords( recordWith().status(SUCCESS).memo(LAZY_MEMO).alias(evmAddress.get())); })); diff --git a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/staking/StakingSuite.java b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/staking/StakingSuite.java index e61987e8109e..c86f9e48af0e 100644 --- a/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/staking/StakingSuite.java +++ b/hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/staking/StakingSuite.java @@ -357,7 +357,7 @@ final HapiSpec secondOrderRewardSituationsWork() { .andAllChildRecords() .countStakingRecords() .stakingFeeExempted() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)) .hasPaidStakingRewards(List.of()), @@ -372,7 +372,7 @@ final HapiSpec secondOrderRewardSituationsWork() { .logged(), getTxnRecord("endOfStakingPeriodXfer") .andAllChildRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .countStakingRecords() .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)), getAccountInfo(ALICE) @@ -396,7 +396,7 @@ final HapiSpec secondOrderRewardSituationsWork() { getTxnRecord("expectNoReward") .andAllChildRecords() .countStakingRecords() - .hasChildRecordCount(0) + .hasNonStakingChildRecordCount(0) .hasStakingFeesPaid() // .hasPaidStakingRewards(List.of()) .logged()); @@ -423,7 +423,7 @@ final HapiSpec pendingRewardsPaidBeforeStakedToMeUpdates() { .andAllChildRecords() .countStakingRecords() .stakingFeeExempted() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)), // alice - 100, carol - 100 /* --- third period reward eligible from period 2--- */ @@ -431,7 +431,7 @@ final HapiSpec pendingRewardsPaidBeforeStakedToMeUpdates() { cryptoUpdate(CAROL).newStakedAccountId(ALICE).via("stakedIdUpdate"), getTxnRecord("stakedIdUpdate") .andAllChildRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .countStakingRecords() .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)) .hasPaidStakingRewardsCount(2) @@ -537,7 +537,7 @@ final HapiSpec stakingMetadataUpdateIsRewardOpportunity() { getTxnRecord(FIRST_TXN) .andAllChildRecords() .countStakingRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)) .hasPaidStakingRewards(List.of()), @@ -552,7 +552,7 @@ final HapiSpec stakingMetadataUpdateIsRewardOpportunity() { .logged() .andAllChildRecords() .countStakingRecords() - // .hasChildRecordCount(1) + // .hasNonStakingChildRecordCount(1) // // .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)) .hasPaidStakingRewards(List.of(Pair.of(PAYABLE_CONTRACT, 333333300L))), @@ -563,7 +563,7 @@ final HapiSpec stakingMetadataUpdateIsRewardOpportunity() { getTxnRecord("samePeriodTxn") .andAllChildRecords() .countStakingRecords() - .hasChildRecordCount(0) + .hasNonStakingChildRecordCount(0) .hasPaidStakingRewards(List.of()), waitUntilStartOfNextStakingPeriod(STAKING_PERIOD_MINS), waitUntilStartOfNextStakingPeriod(STAKING_PERIOD_MINS), @@ -576,7 +576,7 @@ final HapiSpec stakingMetadataUpdateIsRewardOpportunity() { getTxnRecord("contractRewardTxn") .andAllChildRecords() .countStakingRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)) .logged() // .hasPaidStakingRewards(List.of(Pair.of(PAYABLE_CONTRACT, @@ -600,25 +600,25 @@ final HapiSpec endOfStakingPeriodRecTest() { getTxnRecord("trigger") .logged() .countStakingRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)), waitUntilStartOfNextStakingPeriod(STAKING_PERIOD_MINS), cryptoTransfer(tinyBarsFromTo("a1", "a2", ONE_HBAR)).via("transfer"), getTxnRecord("transfer") .countStakingRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)) .logged(), cryptoTransfer(tinyBarsFromTo("a1", "a2", ONE_HBAR)).via("noEndOfStakingPeriodRecord"), getTxnRecord("noEndOfStakingPeriodRecord") .countStakingRecords() - .hasChildRecordCount(0) + .hasNonStakingChildRecordCount(0) .logged(), waitUntilStartOfNextStakingPeriod(STAKING_PERIOD_MINS), cryptoTransfer(tinyBarsFromTo("a1", "a2", ONE_HBAR)).via("transfer1"), getTxnRecord("transfer1") .countStakingRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)) .logged()); } @@ -641,7 +641,7 @@ final HapiSpec rewardsOfDeletedAreRedirectedToBeneficiary() { getTxnRecord(deletion) .andAllChildRecords() .countStakingRecords() - .hasChildRecordCount(1) + .hasNonStakingChildRecordCount(1) .hasChildRecords(recordWith().memo(END_OF_STAKING_PERIOD_CALCULATIONS_MEMO)) .hasPaidStakingRewards(List.of(Pair.of(bob, 3333333000000L))) .logged());