Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/node-flow-build-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ jobs:
enable-unit-tests: false
enable-hapi-tests-crypto: ${{ github.event_name == 'push' || github.event.inputs.enable-hapi-tests == 'true' }}
enable-network-log-capture: true
mats-suffix: MATS
secrets:
access-token: ${{ secrets.GITHUB_TOKEN }}
gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/node-flow-pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
enable-unit-tests: false
enable-hapi-tests-crypto: true
enable-network-log-capture: true
mats-suffix: MATS
secrets:
access-token: ${{ secrets.GITHUB_TOKEN }}
gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node-zxc-compile-application-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ jobs:
env:
LC_ALL: en.UTF-8
LANG: en_US.UTF-8
run: ${GRADLE_EXEC} hapiTestCrypto
run: ${GRADLE_EXEC} hapiTestCrypto${{ inputs.mats-suffix || '' }}

- name: Publish HAPI Test (Crypto) Report
uses: step-security/publish-unit-test-result-action@5d195d4dec0b9fa7b51a3dbc4298362a021247c7 # v2.20.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static com.google.protobuf.ByteString.copyFromUtf8;
import static com.hedera.node.app.hapi.utils.EthSigsUtils.recoverAddressFromPubKey;
import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiPropertySource.asAccount;
import static com.hedera.services.bdd.spec.HapiPropertySource.asAccountString;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
Expand Down Expand Up @@ -156,6 +157,7 @@ public class AutoAccountCreationSuite {
private static final String FT_XFER = "ftXfer";

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> aliasedPayerDoesntWork() {
return hapiTest(
newKeyNamed(ALIAS),
Expand Down Expand Up @@ -393,6 +395,7 @@ final Stream<DynamicTest> canAutoCreateWithNftTransfersToAlias() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> canAutoCreateWithNftTransferToEvmAddress() {
final var civilianBal = 10 * ONE_HBAR;
final var nftTransfer = "multiNftTransfer";
Expand Down Expand Up @@ -649,6 +652,7 @@ final Stream<DynamicTest> canAutoCreateWithFungibleTokenTransfersToAlias() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> noStakePeriodStartIfNotStakingToNode() {
final var user = "user";
final var contract = "contract";
Expand All @@ -665,6 +669,7 @@ final Stream<DynamicTest> noStakePeriodStartIfNotStakingToNode() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> hollowAccountCreationWithCryptoTransfer() {
final var initialTokenSupply = 1000;
final AtomicReference<TokenID> ftId = new AtomicReference<>();
Expand Down Expand Up @@ -912,6 +917,7 @@ final Stream<DynamicTest> accountCreatedIfAliasUsedAsPubKey() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> autoAccountCreationWorksWhenUsingAliasOfDeletedAccount() {
return hapiTest(
newKeyNamed(ALIAS),
Expand Down Expand Up @@ -1273,6 +1279,7 @@ final Stream<DynamicTest> transferHbarsToEVMAddressAlias() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> transferHbarsToECDSAKey() {

final AtomicReference<ByteString> evmAddress = new AtomicReference<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import static com.hedera.node.app.hapi.utils.EthSigsUtils.recoverAddressFromPubKey;
import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiSpec.customizedHapiTest;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
import static com.hedera.services.bdd.spec.assertions.AccountInfoAsserts.accountWith;
Expand Down Expand Up @@ -87,6 +88,7 @@ public class AutoAccountCreationUnlimitedAssociationsSuite {
private static final String NFT_CREATE = "nftCreateTxn";

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> autoAccountCreationsUnlimitedAssociationHappyPath() {
final var creationTime = new AtomicLong();
final long transferFee = 188608L;
Expand Down Expand Up @@ -200,6 +202,7 @@ final Stream<DynamicTest> autoAccountCreationsUnlimitedAssociationsDisabled() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> transferHbarsToEVMAddressAliasUnlimitedAssociations() {
final AtomicReference<AccountID> partyId = new AtomicReference<>();
final AtomicReference<byte[]> partyAlias = new AtomicReference<>();
Expand Down Expand Up @@ -307,6 +310,7 @@ final Stream<DynamicTest> transferHbarsToEVMAddressAliasUnlimitedAssociations()
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> transferTokensToEVMAddressAliasUnlimitedAssociations() {
final AtomicReference<AccountID> partyId = new AtomicReference<>();
final AtomicReference<byte[]> partyAlias = new AtomicReference<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package com.hedera.services.bdd.suites.crypto;

import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
import static com.hedera.services.bdd.spec.assertions.AccountInfoAsserts.accountWith;
import static com.hedera.services.bdd.spec.keys.SigControl.OFF;
Expand Down Expand Up @@ -87,6 +88,7 @@ final Stream<DynamicTest> modifySigRequiredAfterAutoAccountCreation() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> updateKeyOnAutoCreatedAccount() {
final var complexKey = "complexKey";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package com.hedera.services.bdd.suites.crypto;

import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
import static com.hedera.services.bdd.spec.assertions.AccountDetailsAsserts.accountDetailsWith;
import static com.hedera.services.bdd.spec.assertions.AssertUtils.inOrder;
Expand Down Expand Up @@ -132,6 +133,7 @@ public class CryptoApproveAllowanceSuite {
public static final String PAUSE_KEY = "pauseKey";

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> transferErc20TokenFromContractWithApproval() {
final var transferFromOtherContractWithSignaturesTxn = "transferFromOtherContractWithSignaturesTxn";
final var nestedContract = "NestedERC20Contract";
Expand Down Expand Up @@ -316,6 +318,7 @@ final Stream<DynamicTest> transferringMissingNftViaApprovalFailsWithInvalidNftId
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> canDeleteAllowanceFromDeletedSpender() {
return hapiTest(
newKeyNamed(SUPPLY_KEY),
Expand Down Expand Up @@ -774,6 +777,7 @@ final Stream<DynamicTest> noOwnerDefaultsToPayer() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> canHaveMultipleOwners() {
return hapiTest(
newKeyNamed(SUPPLY_KEY),
Expand Down Expand Up @@ -1108,6 +1112,7 @@ final Stream<DynamicTest> emptyAllowancesRejected() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> tokenNotAssociatedToAccountFails() {
return hapiTest(
newKeyNamed(SUPPLY_KEY),
Expand Down Expand Up @@ -1205,6 +1210,7 @@ final Stream<DynamicTest> negativeAmountFailsForFungible() {
}

@HapiTest
@Tag(MATS)
public final Stream<DynamicTest> chargedUsdScalesWithAllowances() {
return hapiTest(
newKeyNamed(SUPPLY_KEY),
Expand Down Expand Up @@ -1489,6 +1495,7 @@ final Stream<DynamicTest> approveForAllDoesNotSetExplicitNFTSpender() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> scheduledCryptoApproveAllowanceWorks() {
return hapiTest(
newKeyNamed(SUPPLY_KEY),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import static com.hedera.node.app.hapi.utils.EthSigsUtils.recoverAddressFromPubKey;
import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
import static com.hedera.services.bdd.spec.assertions.AccountInfoAsserts.accountWith;
import static com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith;
Expand Down Expand Up @@ -189,6 +190,7 @@ final Stream<DynamicTest> canonicalEvmAddressesDeterminedByAliases(
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> createAnAccountWithStakingFields() {
return hapiTest(
cryptoCreate("civilianWORewardStakingNode")
Expand Down Expand Up @@ -766,6 +768,7 @@ final Stream<DynamicTest> successfullyRecreateAccountWithSameAliasAfterDeletion(
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> createAnAccountWithNoMaxAutoAssocAndBalance() {
double v13PriceUsd = 0.05;

Expand Down Expand Up @@ -948,6 +951,7 @@ final Stream<DynamicTest> createAnAccountWith1001MaxAssoc() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> createAnAccountWithEVMAddressAliasAndECKey() {
return hapiTest(newKeyNamed(SECP_256K1_SOURCE_KEY).shape(SECP_256K1_SHAPE), withOpContext((spec, opLog) -> {
final var ecdsaKey = spec.registry().getKey(SECP_256K1_SOURCE_KEY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package com.hedera.services.bdd.suites.crypto;

import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
import static com.hedera.services.bdd.spec.assertions.AccountDetailsAsserts.accountDetailsWith;
import static com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountDetails;
Expand Down Expand Up @@ -96,6 +97,7 @@ final Stream<DynamicTest> idVariantsTreatedAsExpected() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> canDeleteAllowanceForDeletedSpender() {
final String owner = "owner";
final String spender = "spender";
Expand Down Expand Up @@ -274,6 +276,7 @@ final Stream<DynamicTest> invalidOwnerFails() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> feesAsExpected() {
final String owner = "owner";
final String spender = "spender";
Expand Down Expand Up @@ -353,6 +356,7 @@ final Stream<DynamicTest> feesAsExpected() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> succeedsWhenTokenPausedFrozenKycRevoked() {
final String owner = "owner";
final String spender = "spender";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package com.hedera.services.bdd.suites.crypto;

import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiPropertySource.asAccount;
import static com.hedera.services.bdd.spec.HapiPropertySource.explicitBytesOf;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
Expand Down Expand Up @@ -75,6 +76,7 @@ final Stream<DynamicTest> accountIdVariantsTreatedAsExpected() {
}

@LeakyHapiTest(requirement = ContextRequirement.SYSTEM_ACCOUNT_BALANCES)
@Tag(MATS)
final Stream<DynamicTest> deletedAccountCannotBePayer() {
final var submittingNodeAccount = "3";
final var beneficiaryAccount = "beneficiaryAccountForDeletedAccount";
Expand Down Expand Up @@ -122,6 +124,7 @@ final Stream<DynamicTest> canQueryForRecordsWithDeletedPayers() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> fundsTransferOnDelete() {
long B = HapiSpecSetup.getDefaultInstance().defaultBalance();

Expand All @@ -136,6 +139,7 @@ final Stream<DynamicTest> fundsTransferOnDelete() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> cannotDeleteAccountsWithNonzeroTokenBalances() {
return hapiTest(
newKeyNamed("admin"),
Expand Down Expand Up @@ -191,6 +195,7 @@ final Stream<DynamicTest> cannotDeleteAccountWithSameBeneficiary() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> cannotDeleteTreasuryAccount() {
return hapiTest(
cryptoCreate(TREASURY),
Expand All @@ -202,6 +207,7 @@ final Stream<DynamicTest> cannotDeleteTreasuryAccount() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> deleteEcdsaKeyAliasWorked() {
return hapiTest(
createHip32Auto(1, SECP_256K1_SHAPE, i -> ACCOUNT_TO_BE_DELETED),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package com.hedera.services.bdd.suites.crypto;

import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
import static com.hedera.services.bdd.spec.assertions.AccountInfoAsserts.accountWith;
import static com.hedera.services.bdd.spec.keys.KeyShape.SIMPLE;
Expand Down Expand Up @@ -49,6 +50,7 @@ public class CryptoGetInfoRegression {

/** For Demo purpose : The limit on each account info and account balance queries is set to 5 */
@LeakyHapiTest(overrides = {"tokens.maxRelsPerInfoQuery"})
@Tag(MATS)
final Stream<DynamicTest> fetchesOnlyALimitedTokenAssociations() {
final var account = "test";
final var aKey = "tokenKey";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package com.hedera.services.bdd.suites.crypto;

import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
import static com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith;
import static com.hedera.services.bdd.spec.assertions.TransferListAsserts.including;
Expand Down Expand Up @@ -35,6 +36,7 @@ public class CryptoGetRecordsRegression {
private static final String PAYER = "payer";

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> succeedsNormally() {
String memo = "Dim galleries, dusky corridors got past...";

Expand Down Expand Up @@ -106,6 +108,7 @@ final Stream<DynamicTest> failsForDeletedAccount() {
}

@HapiTest
@Tag(MATS)
final Stream<DynamicTest> getAccountRecords_testForDuplicates() {
return hapiTest(
cryptoCreate(ACCOUNT_1).balance(5000000000000L).sendThreshold(1L),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import static com.hedera.services.bdd.junit.ContextRequirement.SYSTEM_ACCOUNT_BALANCES;
import static com.hedera.services.bdd.junit.TestTags.CRYPTO;
import static com.hedera.services.bdd.junit.TestTags.MATS;
import static com.hedera.services.bdd.spec.HapiSpec.hapiTest;
import static com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance;
import static com.hedera.services.bdd.spec.queries.QueryVerbs.getTxnRecord;
Expand Down Expand Up @@ -52,6 +53,7 @@ public class CryptoRecordsSanityCheckSuite {
private static final String ORIG_KEY = "origKey";

@LeakyHapiTest(requirement = SYSTEM_ACCOUNT_BALANCES)
@Tag(MATS)
final Stream<DynamicTest> ownershipChangeShowsInRecord() {
final var firstOwner = "A";
final var secondOwner = "B";
Expand Down Expand Up @@ -92,6 +94,7 @@ final Stream<DynamicTest> cryptoCreateRecordSanityChecks() {
}

@LeakyHapiTest(requirement = SYSTEM_ACCOUNT_BALANCES)
@Tag(MATS)
final Stream<DynamicTest> cryptoDeleteRecordSanityChecks() {
return hapiTest(flattened(
cryptoCreate("test"),
Expand All @@ -116,6 +119,7 @@ final Stream<DynamicTest> cryptoTransferRecordSanityChecks() {
}

@LeakyHapiTest(requirement = SYSTEM_ACCOUNT_BALANCES)
@Tag(MATS)
final Stream<DynamicTest> cryptoUpdateRecordSanityChecks() {
return hapiTest(flattened(
cryptoCreate("test"),
Expand All @@ -128,6 +132,7 @@ final Stream<DynamicTest> cryptoUpdateRecordSanityChecks() {
}

@LeakyHapiTest(requirement = SYSTEM_ACCOUNT_BALANCES)
@Tag(MATS)
final Stream<DynamicTest> insufficientAccountBalanceRecordSanityChecks() {
final long BALANCE = 500_000_000L;
return hapiTest(flattened(
Expand Down
Loading
Loading