Search in sources :

Example 1 with HapiApiSpec

use of com.hedera.services.bdd.spec.HapiApiSpec in project hedera-services by hashgraph.

the class DynamicGasCostSuite method inlineCreateCanFailSafely.

private HapiApiSpec inlineCreateCanFailSafely() {
    final var tcValue = 1_234L;
    final var creation = "creation";
    final var initcode = "initcode";
    final var inlineCreateFactory = "inlineCreateFactory";
    final int foo = 22;
    final int timesToFail = 7;
    final AtomicLong factoryEntityNum = new AtomicLong();
    final AtomicReference<String> factoryEvmAddress = new AtomicReference<>();
    final AtomicReference<byte[]> testContractInitcode = new AtomicReference<>();
    return defaultHapiSpec("InlineCreateCanFailSafely").given(overriding("contracts.throttle.throttleByGas", "false"), fileCreate(initcode).path(REVERTING_CREATE_FACTORY_PATH), contractCreate(inlineCreateFactory).payingWith(GENESIS).bytecode(initcode).via(creation).exposingNumTo(num -> {
        factoryEntityNum.set(num);
        factoryEvmAddress.set(asHexedSolidityAddress(0, 0, num));
    })).when(sourcing(() -> contractCallLocal(inlineCreateFactory, CREATE_FACTORY_GET_BYTECODE_ABI, factoryEvmAddress.get(), foo).exposingTypedResultsTo(results -> {
        final var tcInitcode = (byte[]) results[0];
        testContractInitcode.set(tcInitcode);
        log.info("Contract reported TestContract initcode is {} bytes", tcInitcode.length);
    }).payingWith(GENESIS).nodePayment(ONE_HBAR))).then(inParallel(IntStream.range(0, timesToFail).mapToObj(i -> sourcing(() -> contractCall(inlineCreateFactory, NORMAL_DEPLOY_ABI, testContractInitcode.get()).payingWith(GENESIS).gas(4_000_000L).sending(tcValue).via(creation))).toArray(HapiSpecOperation[]::new)), sourcing(() -> cryptoCreate("nextUp").exposingCreatedIdTo(id -> log.info("Next entity num was {} instead of expected {}", id.getAccountNum(), factoryEntityNum.get() + 1))));
}
Also used : START_CHAIN_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.START_CHAIN_ABI) TxnVerbs.cryptoCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate) PC2_USER_MINT_NFT_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_USER_MINT_NFT_ABI) TxnVerbs.contractDelete(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractDelete) NftTransfer(com.hederahashgraph.api.proto.java.NftTransfer) TokenTransferList(com.hederahashgraph.api.proto.java.TokenTransferList) OBTAINER_SAME_CONTRACT_ID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.OBTAINER_SAME_CONTRACT_ID) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) PC2_DISSOCIATE_BOTH_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_DISSOCIATE_BOTH_ABI) QueryVerbs.contractCallLocal(com.hedera.services.bdd.spec.queries.QueryVerbs.contractCallLocal) REVERTING_CREATE_FACTORY_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.REVERTING_CREATE_FACTORY_PATH) BigInteger(java.math.BigInteger) ADDRESS_VAL_RETURNER_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.ADDRESS_VAL_RETURNER_PATH) CREATE2_FACTORY_GET_ADDRESS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE2_FACTORY_GET_ADDRESS_ABI) SAFE_MINT_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_MINT_ABI) CONTRACT_DELETED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.CONTRACT_DELETED) ACCOUNT_STILL_OWNS_NFTS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.ACCOUNT_STILL_OWNS_NFTS) ADDRESS_VAL_CALL_RETURNER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.ADDRESS_VAL_CALL_RETURNER_ABI) TxnVerbs.contractCall(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCall) ContractFnResultAsserts.resultWith(com.hedera.services.bdd.spec.assertions.ContractFnResultAsserts.resultWith) TEST_CONTRACT_VACATE_ADDRESS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.TEST_CONTRACT_VACATE_ADDRESS_ABI) TransactionRecordAsserts.recordWith(com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) Logger(org.apache.logging.log4j.Logger) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) QueryVerbs.getContractBytecode(com.hedera.services.bdd.spec.queries.QueryVerbs.getContractBytecode) TxnVerbs.tokenDissociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenDissociate) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) SALTING_CREATOR_FACTORY_BUILD_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SALTING_CREATOR_FACTORY_BUILD_ABI) UtilVerbs.overriding(com.hedera.services.bdd.spec.utilops.UtilVerbs.overriding) TxnVerbs.tokenAssociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenAssociate) SAFE_DISSOCIATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_DISSOCIATE_ABI) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) CommonUtils.hex(com.swirlds.common.CommonUtils.hex) TxnVerbs.cryptoUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoUpdate) HapiPropertySource.contractIdFromHexedMirrorAddress(com.hedera.services.bdd.spec.HapiPropertySource.contractIdFromHexedMirrorAddress) ADDRESS_VAL_CREATE_RETURNER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.ADDRESS_VAL_CREATE_RETURNER_ABI) WHAT_IS_FOO_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.WHAT_IS_FOO_ABI) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) BUILD_THEN_REVERT_THEN_BUILD_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.BUILD_THEN_REVERT_THEN_BUILD_ABI) AccountID(com.hederahashgraph.api.proto.java.AccountID) SAFE_TOKEN_TRANSFER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_TOKEN_TRANSFER_ABI) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) UtilVerbs.updateLargeFile(com.hedera.services.bdd.spec.utilops.UtilVerbs.updateLargeFile) CREATE2_FACTORY_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE2_FACTORY_PATH) CustomSpecAssert.allRunFor(com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor) HapiPropertySource.asSolidityAddress(com.hedera.services.bdd.spec.HapiPropertySource.asSolidityAddress) Assertions.assertArrayEquals(org.junit.jupiter.api.Assertions.assertArrayEquals) AtomicLong(java.util.concurrent.atomic.AtomicLong) PC2_CREATE_USER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_CREATE_USER_ABI) TxnVerbs.fileCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileCreate) TokenID(com.hederahashgraph.api.proto.java.TokenID) PC2_FT_SEND_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_FT_SEND_ABI) Utils.asAddress(com.hedera.services.bdd.suites.contract.Utils.asAddress) PC2_ASSOCIATE_BOTH_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_ASSOCIATE_BOTH_ABI) CONTRACT_REVERT_EXECUTED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.CONTRACT_REVERT_EXECUTED) INVALID_SOLIDITY_ADDRESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_SOLIDITY_ADDRESS) ContractInfoAsserts.contractWith(com.hedera.services.bdd.spec.assertions.ContractInfoAsserts.contractWith) RETURN_THIS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.RETURN_THIS_ABI) SAFE_ASSOCIATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_ASSOCIATE_ABI) HapiPropertySource.asContractString(com.hedera.services.bdd.spec.HapiPropertySource.asContractString) UtilVerbs.sourcing(com.hedera.services.bdd.spec.utilops.UtilVerbs.sourcing) CREATE2_FACTORY_GET_BYTECODE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE2_FACTORY_GET_BYTECODE_ABI) TxnVerbs.contractUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractUpdate) TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) TxnVerbs.cryptoTransfer(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer) ContractLogAsserts.logWith(com.hedera.services.bdd.spec.assertions.ContractLogAsserts.logWith) QueryVerbs.getContractInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getContractInfo) ContractID(com.hederahashgraph.api.proto.java.ContractID) QueryVerbs.getTxnRecord(com.hedera.services.bdd.spec.queries.QueryVerbs.getTxnRecord) CREATE_PLACEHOLDER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_PLACEHOLDER_ABI) UtilVerbs.inParallel(com.hedera.services.bdd.spec.utilops.UtilVerbs.inParallel) HapiPropertySource.literalIdFromHexedMirrorAddress(com.hedera.services.bdd.spec.HapiPropertySource.literalIdFromHexedMirrorAddress) WRONG_REPEATED_CREATE2_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.WRONG_REPEATED_CREATE2_ABI) HapiPropertySource.asHexedSolidityAddress(com.hedera.services.bdd.spec.HapiPropertySource.asHexedSolidityAddress) REVERTING_CREATE2_FACTORY_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.REVERTING_CREATE2_FACTORY_PATH) SALTING_CREATOR_FACTORY_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SALTING_CREATOR_FACTORY_PATH) SALTING_CREATOR_CALL_CREATOR_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SALTING_CREATOR_CALL_CREATOR_ABI) RELINQUISH_FUNDS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.RELINQUISH_FUNDS_ABI) SAFE_MULTIPLE_ASSOCIATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_MULTIPLE_ASSOCIATE_ABI) UtilVerbs.logIt(com.hedera.services.bdd.spec.utilops.UtilVerbs.logIt) UtilVerbs.newKeyNamed(com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed) Utils.extractByteCode(com.hedera.services.bdd.suites.contract.Utils.extractByteCode) ByteString(com.google.protobuf.ByteString) List(java.util.List) REVERTED_SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.REVERTED_SUCCESS) CREATE_DONOR_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_DONOR_ABI) TxnVerbs.tokenUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUpdate) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) CREATE_AND_RECREATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_AND_RECREATE_ABI) IntStream(java.util.stream.IntStream) CONTRACT_EXECUTION_EXCEPTION(com.hederahashgraph.api.proto.java.ResponseCodeEnum.CONTRACT_EXECUTION_EXCEPTION) Utils(com.hedera.services.bdd.suites.contract.Utils) MiscEETUtils.metadata(com.hedera.services.bdd.suites.utils.MiscEETUtils.metadata) CREATE2_FACTORY_DEPLOY_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE2_FACTORY_DEPLOY_ABI) SALTING_CREATOR_CREATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SALTING_CREATOR_CREATE_ABI) AtomicReference(java.util.concurrent.atomic.AtomicReference) INVALID_SIGNATURE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_SIGNATURE) ContractResources(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources) TEST_CONTRACT_GET_BALANCE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.TEST_CONTRACT_GET_BALANCE_ABI) TokenMovement.moving(com.hedera.services.bdd.spec.transactions.token.TokenMovement.moving) UtilVerbs.childRecordsCheck(com.hedera.services.bdd.spec.utilops.UtilVerbs.childRecordsCheck) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) CREATE_FACTORY_GET_BYTECODE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_FACTORY_GET_BYTECODE_ABI) PRECOMPILE_CREATE2_USER_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PRECOMPILE_CREATE2_USER_PATH) SAFE_NFT_TRANSFER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_NFT_TRANSFER_ABI) TxnVerbs.mintToken(com.hedera.services.bdd.spec.transactions.TxnVerbs.mintToken) TxnVerbs.tokenCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenCreate) TransferList(com.hederahashgraph.api.proto.java.TransferList) NORMAL_DEPLOY_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.NORMAL_DEPLOY_ABI) SAFE_MULTIPLE_DISSOCIATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_MULTIPLE_DISSOCIATE_ABI) SAFE_BURN_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_BURN_ABI) OUTER_CREATOR_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.OUTER_CREATOR_PATH) PC2_USER_HELPER_MINT_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_USER_HELPER_MINT_ABI) QueryVerbs.getAccountBalance(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance) VANILLA_TOKEN(com.hedera.services.bdd.suites.token.TokenAssociationSpecs.VANILLA_TOKEN) ContractFnResultAsserts.isLiteralResult(com.hedera.services.bdd.spec.assertions.ContractFnResultAsserts.isLiteralResult) PC2_NFT_SEND_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_NFT_SEND_ABI) KNOWABLE_TOKEN(com.hedera.services.bdd.suites.token.TokenAssociationSpecs.KNOWABLE_TOKEN) UtilVerbs(com.hedera.services.bdd.spec.utilops.UtilVerbs) SAFE_NFTS_TRANSFER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_NFTS_TRANSFER_ABI) CREATE_DONOR_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_DONOR_PATH) SAFE_TOKENS_TRANSFER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_TOKENS_TRANSFER_ABI) INVALID_CONTRACT_ID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_CONTRACT_ID) NON_FUNGIBLE_UNIQUE(com.hederahashgraph.api.proto.java.TokenType.NON_FUNGIBLE_UNIQUE) TxnVerbs.contractCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCreate) FUNGIBLE_COMMON(com.hederahashgraph.api.proto.java.TokenType.FUNGIBLE_COMMON) AssertUtils.inOrder(com.hedera.services.bdd.spec.assertions.AssertUtils.inOrder) CommonUtils.unhex(com.swirlds.common.CommonUtils.unhex) LogManager(org.apache.logging.log4j.LogManager) Collections(java.util.Collections) TokenMovement.movingUnique(com.hedera.services.bdd.spec.transactions.token.TokenMovement.movingUnique) AtomicLong(java.util.concurrent.atomic.AtomicLong) AtomicReference(java.util.concurrent.atomic.AtomicReference) HapiPropertySource.asContractString(com.hedera.services.bdd.spec.HapiPropertySource.asContractString) ByteString(com.google.protobuf.ByteString)

Example 2 with HapiApiSpec

use of com.hedera.services.bdd.spec.HapiApiSpec in project hedera-services by hashgraph.

the class DynamicGasCostSuite method inlineCreate2CanFailSafely.

// https://github.com/hashgraph/hedera-services/issues/2868
private HapiApiSpec inlineCreate2CanFailSafely() {
    final var tcValue = 1_234L;
    final var creation = "creation";
    final var initcode = "initcode";
    final var inlineCreate2Factory = "inlineCreate2Factory";
    final int foo = 22;
    final int salt = 23;
    final int timesToFail = 7;
    final AtomicLong factoryEntityNum = new AtomicLong();
    final AtomicReference<String> factoryEvmAddress = new AtomicReference<>();
    final AtomicReference<byte[]> testContractInitcode = new AtomicReference<>();
    return defaultHapiSpec("InlineCreate2CanFailSafely").given(overriding("contracts.throttle.throttleByGas", "false"), fileCreate(initcode).path(REVERTING_CREATE2_FACTORY_PATH), contractCreate(inlineCreate2Factory).payingWith(GENESIS).bytecode(initcode).via(creation).exposingNumTo(num -> {
        factoryEntityNum.set(num);
        factoryEvmAddress.set(asHexedSolidityAddress(0, 0, num));
    })).when(sourcing(() -> contractCallLocal(inlineCreate2Factory, CREATE2_FACTORY_GET_BYTECODE_ABI, factoryEvmAddress.get(), foo).exposingTypedResultsTo(results -> {
        final var tcInitcode = (byte[]) results[0];
        testContractInitcode.set(tcInitcode);
        log.info("Contract reported TestContract initcode is {} bytes", tcInitcode.length);
    }).payingWith(GENESIS).nodePayment(ONE_HBAR))).then(inParallel(IntStream.range(0, timesToFail).mapToObj(i -> sourcing(() -> contractCall(inlineCreate2Factory, CREATE2_FACTORY_DEPLOY_ABI, testContractInitcode.get(), salt).payingWith(GENESIS).gas(4_000_000L).sending(tcValue).via(creation))).toArray(HapiSpecOperation[]::new)), sourcing(() -> cryptoCreate("nextUp").exposingCreatedIdTo(id -> log.info("Next entity num was {} instead of expected {}", id.getAccountNum(), factoryEntityNum.get() + 1))));
}
Also used : START_CHAIN_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.START_CHAIN_ABI) TxnVerbs.cryptoCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate) PC2_USER_MINT_NFT_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_USER_MINT_NFT_ABI) TxnVerbs.contractDelete(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractDelete) NftTransfer(com.hederahashgraph.api.proto.java.NftTransfer) TokenTransferList(com.hederahashgraph.api.proto.java.TokenTransferList) OBTAINER_SAME_CONTRACT_ID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.OBTAINER_SAME_CONTRACT_ID) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) PC2_DISSOCIATE_BOTH_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_DISSOCIATE_BOTH_ABI) QueryVerbs.contractCallLocal(com.hedera.services.bdd.spec.queries.QueryVerbs.contractCallLocal) REVERTING_CREATE_FACTORY_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.REVERTING_CREATE_FACTORY_PATH) BigInteger(java.math.BigInteger) ADDRESS_VAL_RETURNER_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.ADDRESS_VAL_RETURNER_PATH) CREATE2_FACTORY_GET_ADDRESS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE2_FACTORY_GET_ADDRESS_ABI) SAFE_MINT_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_MINT_ABI) CONTRACT_DELETED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.CONTRACT_DELETED) ACCOUNT_STILL_OWNS_NFTS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.ACCOUNT_STILL_OWNS_NFTS) ADDRESS_VAL_CALL_RETURNER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.ADDRESS_VAL_CALL_RETURNER_ABI) TxnVerbs.contractCall(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCall) ContractFnResultAsserts.resultWith(com.hedera.services.bdd.spec.assertions.ContractFnResultAsserts.resultWith) TEST_CONTRACT_VACATE_ADDRESS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.TEST_CONTRACT_VACATE_ADDRESS_ABI) TransactionRecordAsserts.recordWith(com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) Logger(org.apache.logging.log4j.Logger) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) QueryVerbs.getContractBytecode(com.hedera.services.bdd.spec.queries.QueryVerbs.getContractBytecode) TxnVerbs.tokenDissociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenDissociate) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) SALTING_CREATOR_FACTORY_BUILD_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SALTING_CREATOR_FACTORY_BUILD_ABI) UtilVerbs.overriding(com.hedera.services.bdd.spec.utilops.UtilVerbs.overriding) TxnVerbs.tokenAssociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenAssociate) SAFE_DISSOCIATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_DISSOCIATE_ABI) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) CommonUtils.hex(com.swirlds.common.CommonUtils.hex) TxnVerbs.cryptoUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoUpdate) HapiPropertySource.contractIdFromHexedMirrorAddress(com.hedera.services.bdd.spec.HapiPropertySource.contractIdFromHexedMirrorAddress) ADDRESS_VAL_CREATE_RETURNER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.ADDRESS_VAL_CREATE_RETURNER_ABI) WHAT_IS_FOO_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.WHAT_IS_FOO_ABI) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) BUILD_THEN_REVERT_THEN_BUILD_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.BUILD_THEN_REVERT_THEN_BUILD_ABI) AccountID(com.hederahashgraph.api.proto.java.AccountID) SAFE_TOKEN_TRANSFER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_TOKEN_TRANSFER_ABI) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) UtilVerbs.updateLargeFile(com.hedera.services.bdd.spec.utilops.UtilVerbs.updateLargeFile) CREATE2_FACTORY_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE2_FACTORY_PATH) CustomSpecAssert.allRunFor(com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor) HapiPropertySource.asSolidityAddress(com.hedera.services.bdd.spec.HapiPropertySource.asSolidityAddress) Assertions.assertArrayEquals(org.junit.jupiter.api.Assertions.assertArrayEquals) AtomicLong(java.util.concurrent.atomic.AtomicLong) PC2_CREATE_USER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_CREATE_USER_ABI) TxnVerbs.fileCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileCreate) TokenID(com.hederahashgraph.api.proto.java.TokenID) PC2_FT_SEND_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_FT_SEND_ABI) Utils.asAddress(com.hedera.services.bdd.suites.contract.Utils.asAddress) PC2_ASSOCIATE_BOTH_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_ASSOCIATE_BOTH_ABI) CONTRACT_REVERT_EXECUTED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.CONTRACT_REVERT_EXECUTED) INVALID_SOLIDITY_ADDRESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_SOLIDITY_ADDRESS) ContractInfoAsserts.contractWith(com.hedera.services.bdd.spec.assertions.ContractInfoAsserts.contractWith) RETURN_THIS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.RETURN_THIS_ABI) SAFE_ASSOCIATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_ASSOCIATE_ABI) HapiPropertySource.asContractString(com.hedera.services.bdd.spec.HapiPropertySource.asContractString) UtilVerbs.sourcing(com.hedera.services.bdd.spec.utilops.UtilVerbs.sourcing) CREATE2_FACTORY_GET_BYTECODE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE2_FACTORY_GET_BYTECODE_ABI) TxnVerbs.contractUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractUpdate) TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) TxnVerbs.cryptoTransfer(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer) ContractLogAsserts.logWith(com.hedera.services.bdd.spec.assertions.ContractLogAsserts.logWith) QueryVerbs.getContractInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getContractInfo) ContractID(com.hederahashgraph.api.proto.java.ContractID) QueryVerbs.getTxnRecord(com.hedera.services.bdd.spec.queries.QueryVerbs.getTxnRecord) CREATE_PLACEHOLDER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_PLACEHOLDER_ABI) UtilVerbs.inParallel(com.hedera.services.bdd.spec.utilops.UtilVerbs.inParallel) HapiPropertySource.literalIdFromHexedMirrorAddress(com.hedera.services.bdd.spec.HapiPropertySource.literalIdFromHexedMirrorAddress) WRONG_REPEATED_CREATE2_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.WRONG_REPEATED_CREATE2_ABI) HapiPropertySource.asHexedSolidityAddress(com.hedera.services.bdd.spec.HapiPropertySource.asHexedSolidityAddress) REVERTING_CREATE2_FACTORY_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.REVERTING_CREATE2_FACTORY_PATH) SALTING_CREATOR_FACTORY_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SALTING_CREATOR_FACTORY_PATH) SALTING_CREATOR_CALL_CREATOR_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SALTING_CREATOR_CALL_CREATOR_ABI) RELINQUISH_FUNDS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.RELINQUISH_FUNDS_ABI) SAFE_MULTIPLE_ASSOCIATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_MULTIPLE_ASSOCIATE_ABI) UtilVerbs.logIt(com.hedera.services.bdd.spec.utilops.UtilVerbs.logIt) UtilVerbs.newKeyNamed(com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed) Utils.extractByteCode(com.hedera.services.bdd.suites.contract.Utils.extractByteCode) ByteString(com.google.protobuf.ByteString) List(java.util.List) REVERTED_SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.REVERTED_SUCCESS) CREATE_DONOR_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_DONOR_ABI) TxnVerbs.tokenUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUpdate) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) CREATE_AND_RECREATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_AND_RECREATE_ABI) IntStream(java.util.stream.IntStream) CONTRACT_EXECUTION_EXCEPTION(com.hederahashgraph.api.proto.java.ResponseCodeEnum.CONTRACT_EXECUTION_EXCEPTION) Utils(com.hedera.services.bdd.suites.contract.Utils) MiscEETUtils.metadata(com.hedera.services.bdd.suites.utils.MiscEETUtils.metadata) CREATE2_FACTORY_DEPLOY_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE2_FACTORY_DEPLOY_ABI) SALTING_CREATOR_CREATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SALTING_CREATOR_CREATE_ABI) AtomicReference(java.util.concurrent.atomic.AtomicReference) INVALID_SIGNATURE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_SIGNATURE) ContractResources(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources) TEST_CONTRACT_GET_BALANCE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.TEST_CONTRACT_GET_BALANCE_ABI) TokenMovement.moving(com.hedera.services.bdd.spec.transactions.token.TokenMovement.moving) UtilVerbs.childRecordsCheck(com.hedera.services.bdd.spec.utilops.UtilVerbs.childRecordsCheck) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) CREATE_FACTORY_GET_BYTECODE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_FACTORY_GET_BYTECODE_ABI) PRECOMPILE_CREATE2_USER_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PRECOMPILE_CREATE2_USER_PATH) SAFE_NFT_TRANSFER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_NFT_TRANSFER_ABI) TxnVerbs.mintToken(com.hedera.services.bdd.spec.transactions.TxnVerbs.mintToken) TxnVerbs.tokenCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenCreate) TransferList(com.hederahashgraph.api.proto.java.TransferList) NORMAL_DEPLOY_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.NORMAL_DEPLOY_ABI) SAFE_MULTIPLE_DISSOCIATE_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_MULTIPLE_DISSOCIATE_ABI) SAFE_BURN_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_BURN_ABI) OUTER_CREATOR_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.OUTER_CREATOR_PATH) PC2_USER_HELPER_MINT_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_USER_HELPER_MINT_ABI) QueryVerbs.getAccountBalance(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance) VANILLA_TOKEN(com.hedera.services.bdd.suites.token.TokenAssociationSpecs.VANILLA_TOKEN) ContractFnResultAsserts.isLiteralResult(com.hedera.services.bdd.spec.assertions.ContractFnResultAsserts.isLiteralResult) PC2_NFT_SEND_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.PC2_NFT_SEND_ABI) KNOWABLE_TOKEN(com.hedera.services.bdd.suites.token.TokenAssociationSpecs.KNOWABLE_TOKEN) UtilVerbs(com.hedera.services.bdd.spec.utilops.UtilVerbs) SAFE_NFTS_TRANSFER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_NFTS_TRANSFER_ABI) CREATE_DONOR_PATH(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.CREATE_DONOR_PATH) SAFE_TOKENS_TRANSFER_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SAFE_TOKENS_TRANSFER_ABI) INVALID_CONTRACT_ID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_CONTRACT_ID) NON_FUNGIBLE_UNIQUE(com.hederahashgraph.api.proto.java.TokenType.NON_FUNGIBLE_UNIQUE) TxnVerbs.contractCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCreate) FUNGIBLE_COMMON(com.hederahashgraph.api.proto.java.TokenType.FUNGIBLE_COMMON) AssertUtils.inOrder(com.hedera.services.bdd.spec.assertions.AssertUtils.inOrder) CommonUtils.unhex(com.swirlds.common.CommonUtils.unhex) LogManager(org.apache.logging.log4j.LogManager) Collections(java.util.Collections) TokenMovement.movingUnique(com.hedera.services.bdd.spec.transactions.token.TokenMovement.movingUnique) AtomicLong(java.util.concurrent.atomic.AtomicLong) AtomicReference(java.util.concurrent.atomic.AtomicReference) HapiPropertySource.asContractString(com.hedera.services.bdd.spec.HapiPropertySource.asContractString) ByteString(com.google.protobuf.ByteString)

Example 3 with HapiApiSpec

use of com.hedera.services.bdd.spec.HapiApiSpec in project hedera-services by hashgraph.

the class ContractKeysHTSSuite method callForMintWithDelegateContractKey.

private HapiApiSpec callForMintWithDelegateContractKey() {
    final var theAccount = "anybody";
    final var mintContractByteCode = "mintContractByteCode";
    final var amount = 10L;
    final var fungibleToken = "fungibleToken";
    final var theContract = "mintContract";
    final var firstMintTxn = "firstMintTxn";
    final AtomicLong fungibleNum = new AtomicLong();
    return defaultHapiSpec("callForMintWithDelegateContractKey").given(newKeyNamed(MULTI_KEY), cryptoCreate(theAccount).balance(10 * ONE_HUNDRED_HBARS), cryptoCreate(TOKEN_TREASURY), fileCreate(mintContractByteCode).payingWith(theAccount), updateLargeFile(theAccount, mintContractByteCode, extractByteCode(ContractResources.ORDINARY_CALLS_CONTRACT)), tokenCreate(fungibleToken).tokenType(FUNGIBLE_COMMON).initialSupply(0).treasury(TOKEN_TREASURY).adminKey(MULTI_KEY).supplyKey(MULTI_KEY).exposingCreatedIdTo(idLit -> fungibleNum.set(asDotDelimitedLongArray(idLit)[2]))).when(sourcing(() -> contractCreate(theContract).bytecode(mintContractByteCode).payingWith(theAccount).gas(GAS_TO_OFFER))).then(withOpContext((spec, opLog) -> allRunFor(spec, newKeyNamed("delegateContractKey").shape(DELEGATE_CONTRACT_KEY_SHAPE.signedWith(sigs(ON, theContract))), tokenUpdate(fungibleToken).supplyKey("delegateContractKey"), contractCall(theContract, MINT_TOKEN_ORDINARY_CALL, asAddress(spec.registry().getTokenID(fungibleToken)), amount, new byte[] {}).via(firstMintTxn).payingWith(theAccount))), childRecordsCheck(firstMintTxn, SUCCESS, recordWith().status(SUCCESS).tokenTransfers(changingFungibleBalances().including(fungibleToken, TOKEN_TREASURY, 10)).newTotalSupply(10)), getTokenInfo(fungibleToken).hasTotalSupply(amount), getAccountBalance(TOKEN_TREASURY).hasTokenBalance(fungibleToken, amount));
}
Also used : SINGLE_TOKEN_DISSOCIATE(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SINGLE_TOKEN_DISSOCIATE) TxnVerbs.cryptoCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate) UtilVerbs.sourcing(com.hedera.services.bdd.spec.utilops.UtilVerbs.sourcing) TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES) ON(com.hedera.services.bdd.spec.keys.SigControl.ON) TxnVerbs.cryptoTransfer(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer) BURN_TOKEN_ORDINARY_CALL(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.BURN_TOKEN_ORDINARY_CALL) QueryVerbs.getAccountInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountInfo) ACCOUNT_IS_TREASURY(com.hederahashgraph.api.proto.java.ResponseCodeEnum.ACCOUNT_IS_TREASURY) DELEGATE_BURN_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_BURN_CALL_ABI) ExpectedTokenRel.relationshipWith(com.hedera.services.bdd.spec.queries.crypto.ExpectedTokenRel.relationshipWith) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) STATIC_ASSOCIATE_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_ASSOCIATE_CALL_ABI) Frozen(com.hederahashgraph.api.proto.java.TokenFreezeStatus.Frozen) SomeFungibleTransfers.changingFungibleBalances(com.hedera.services.bdd.spec.assertions.SomeFungibleTransfers.changingFungibleBalances) DELEGATE_ASSOCIATE_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_ASSOCIATE_CALL_ABI) ACCOUNT_STILL_OWNS_NFTS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.ACCOUNT_STILL_OWNS_NFTS) STATIC_DISSOCIATE_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_DISSOCIATE_CALL_ABI) STATIC_MINT_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_MINT_CALL_ABI) TxnVerbs.contractCall(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCall) TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT) UtilVerbs.newKeyNamed(com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed) TransactionRecordAsserts.recordWith(com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) TOKEN_NOT_ASSOCIATED_TO_ACCOUNT(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT) TRANSFER_NFT_ORDINARY_CALL(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.TRANSFER_NFT_ORDINARY_CALL) Utils.extractByteCode(com.hedera.services.bdd.suites.contract.Utils.extractByteCode) NonFungibleTransfers(com.hedera.services.bdd.spec.assertions.NonFungibleTransfers) List(java.util.List) Logger(org.apache.logging.log4j.Logger) TxnVerbs.tokenUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUpdate) NotNull(org.jetbrains.annotations.NotNull) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) STATIC_TRANSFER_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_TRANSFER_CALL_ABI) KeyShape.sigs(com.hedera.services.bdd.spec.keys.KeyShape.sigs) TxnVerbs.tokenAssociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenAssociate) MiscEETUtils.metadata(com.hedera.services.bdd.suites.utils.MiscEETUtils.metadata) ByteString.copyFromUtf8(com.google.protobuf.ByteString.copyFromUtf8) DELEGATE_MINT_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_MINT_CALL_ABI) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) QueryVerbs.getTokenInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getTokenInfo) Revoked(com.hederahashgraph.api.proto.java.TokenKycStatus.Revoked) HapiPropertySource.asToken(com.hedera.services.bdd.spec.HapiPropertySource.asToken) SINGLE_TOKEN_ASSOCIATE(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SINGLE_TOKEN_ASSOCIATE) AtomicReference(java.util.concurrent.atomic.AtomicReference) DELEGATE_CONTRACT(com.hedera.services.bdd.spec.keys.KeyShape.DELEGATE_CONTRACT) INVALID_SIGNATURE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_SIGNATURE) ContractResources(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources) ArrayList(java.util.ArrayList) UtilVerbs.emptyChildRecordsCheck(com.hedera.services.bdd.spec.utilops.UtilVerbs.emptyChildRecordsCheck) TxnVerbs.cryptoUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoUpdate) TokenMovement.moving(com.hedera.services.bdd.spec.transactions.token.TokenMovement.moving) UtilVerbs.childRecordsCheck(com.hedera.services.bdd.spec.utilops.UtilVerbs.childRecordsCheck) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) HapiPropertySource.asDotDelimitedLongArray(com.hedera.services.bdd.spec.HapiPropertySource.asDotDelimitedLongArray) KeyShape(com.hedera.services.bdd.spec.keys.KeyShape) AccountID(com.hederahashgraph.api.proto.java.AccountID) MINT_TOKEN_ORDINARY_CALL(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.MINT_TOKEN_ORDINARY_CALL) TxnVerbs.mintToken(com.hedera.services.bdd.spec.transactions.TxnVerbs.mintToken) TxnVerbs.tokenCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenCreate) ACCOUNT_FROZEN_FOR_TOKEN(com.hederahashgraph.api.proto.java.ResponseCodeEnum.ACCOUNT_FROZEN_FOR_TOKEN) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) DELEGATE_DISSOCIATE_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_DISSOCIATE_CALL_ABI) UtilVerbs.updateLargeFile(com.hedera.services.bdd.spec.utilops.UtilVerbs.updateLargeFile) QueryVerbs.getAccountBalance(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance) VANILLA_TOKEN(com.hedera.services.bdd.suites.token.TokenAssociationSpecs.VANILLA_TOKEN) CustomSpecAssert.allRunFor(com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor) BURN_TOKEN_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.BURN_TOKEN_ABI) SIMPLE(com.hedera.services.bdd.spec.keys.KeyShape.SIMPLE) TokenType(com.hederahashgraph.api.proto.java.TokenType) AtomicLong(java.util.concurrent.atomic.AtomicLong) TxnVerbs.fileCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileCreate) TokenID(com.hederahashgraph.api.proto.java.TokenID) STATIC_BURN_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_BURN_CALL_ABI) Utils.asAddress(com.hedera.services.bdd.suites.contract.Utils.asAddress) CONTRACT_REVERT_EXECUTED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.CONTRACT_REVERT_EXECUTED) NON_FUNGIBLE_UNIQUE(com.hederahashgraph.api.proto.java.TokenType.NON_FUNGIBLE_UNIQUE) TxnVerbs.contractCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCreate) FUNGIBLE_COMMON(com.hederahashgraph.api.proto.java.TokenType.FUNGIBLE_COMMON) LogManager(org.apache.logging.log4j.LogManager) DELEGATE_TRANSFER_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_TRANSFER_CALL_ABI) TokenMovement.movingUnique(com.hedera.services.bdd.spec.transactions.token.TokenMovement.movingUnique) TokenSupplyType(com.hederahashgraph.api.proto.java.TokenSupplyType) TxnVerbs.tokenUnfreeze(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUnfreeze) AtomicLong(java.util.concurrent.atomic.AtomicLong)

Example 4 with HapiApiSpec

use of com.hedera.services.bdd.spec.HapiApiSpec in project hedera-services by hashgraph.

the class ContractKeysHTSSuite method burnTokenWithFullPrefixAndPartialPrefixKeys.

private HapiApiSpec burnTokenWithFullPrefixAndPartialPrefixKeys() {
    final var theAccount = "anybody";
    final var burnContractByteCode = "burnContractByteCode";
    final var amount = 99L;
    final var fungibleToken = "fungibleToken";
    final var theContract = "mintContract";
    final var firstBurnTxn = "firstBurnTxn";
    final var secondBurnTxn = "secondBurnTxn";
    final AtomicLong fungibleNum = new AtomicLong();
    return defaultHapiSpec("burnTokenWithFullPrefixAndPartialPrefixKeys").given(newKeyNamed(MULTI_KEY), cryptoCreate(theAccount).balance(10 * ONE_HUNDRED_HBARS), cryptoCreate(TOKEN_TREASURY), fileCreate(burnContractByteCode).payingWith(theAccount), updateLargeFile(theAccount, burnContractByteCode, extractByteCode(ContractResources.ORDINARY_CALLS_CONTRACT)), tokenCreate(fungibleToken).tokenType(TokenType.FUNGIBLE_COMMON).initialSupply(100).treasury(TOKEN_TREASURY).adminKey(MULTI_KEY).supplyKey(MULTI_KEY).exposingCreatedIdTo(idLit -> fungibleNum.set(asDotDelimitedLongArray(idLit)[2]))).when(sourcing(() -> contractCreate(theContract).bytecode(burnContractByteCode).payingWith(theAccount).gas(GAS_TO_OFFER))).then(withOpContext((spec, opLog) -> allRunFor(spec, contractCall(theContract, BURN_TOKEN_ORDINARY_CALL, asAddress(spec.registry().getTokenID(fungibleToken)), 1, new ArrayList<Long>()).via(firstBurnTxn).payingWith(theAccount).signedBy(MULTI_KEY).signedBy(theAccount).hasKnownStatus(SUCCESS), contractCall(theContract, BURN_TOKEN_ORDINARY_CALL, asAddress(spec.registry().getTokenID(fungibleToken)), 1, new ArrayList<Long>()).via(secondBurnTxn).payingWith(theAccount).alsoSigningWithFullPrefix(MULTI_KEY).hasKnownStatus(SUCCESS))), childRecordsCheck(firstBurnTxn, SUCCESS, recordWith().status(INVALID_SIGNATURE)), childRecordsCheck(secondBurnTxn, SUCCESS, recordWith().status(SUCCESS).newTotalSupply(99)), getTokenInfo(fungibleToken).hasTotalSupply(amount), getAccountBalance(TOKEN_TREASURY).hasTokenBalance(fungibleToken, amount));
}
Also used : SINGLE_TOKEN_DISSOCIATE(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SINGLE_TOKEN_DISSOCIATE) TxnVerbs.cryptoCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate) UtilVerbs.sourcing(com.hedera.services.bdd.spec.utilops.UtilVerbs.sourcing) TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES) ON(com.hedera.services.bdd.spec.keys.SigControl.ON) TxnVerbs.cryptoTransfer(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer) BURN_TOKEN_ORDINARY_CALL(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.BURN_TOKEN_ORDINARY_CALL) QueryVerbs.getAccountInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountInfo) ACCOUNT_IS_TREASURY(com.hederahashgraph.api.proto.java.ResponseCodeEnum.ACCOUNT_IS_TREASURY) DELEGATE_BURN_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_BURN_CALL_ABI) ExpectedTokenRel.relationshipWith(com.hedera.services.bdd.spec.queries.crypto.ExpectedTokenRel.relationshipWith) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) STATIC_ASSOCIATE_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_ASSOCIATE_CALL_ABI) Frozen(com.hederahashgraph.api.proto.java.TokenFreezeStatus.Frozen) SomeFungibleTransfers.changingFungibleBalances(com.hedera.services.bdd.spec.assertions.SomeFungibleTransfers.changingFungibleBalances) DELEGATE_ASSOCIATE_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_ASSOCIATE_CALL_ABI) ACCOUNT_STILL_OWNS_NFTS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.ACCOUNT_STILL_OWNS_NFTS) STATIC_DISSOCIATE_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_DISSOCIATE_CALL_ABI) STATIC_MINT_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_MINT_CALL_ABI) TxnVerbs.contractCall(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCall) TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT) UtilVerbs.newKeyNamed(com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed) TransactionRecordAsserts.recordWith(com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) TOKEN_NOT_ASSOCIATED_TO_ACCOUNT(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT) TRANSFER_NFT_ORDINARY_CALL(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.TRANSFER_NFT_ORDINARY_CALL) Utils.extractByteCode(com.hedera.services.bdd.suites.contract.Utils.extractByteCode) NonFungibleTransfers(com.hedera.services.bdd.spec.assertions.NonFungibleTransfers) List(java.util.List) Logger(org.apache.logging.log4j.Logger) TxnVerbs.tokenUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUpdate) NotNull(org.jetbrains.annotations.NotNull) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) STATIC_TRANSFER_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_TRANSFER_CALL_ABI) KeyShape.sigs(com.hedera.services.bdd.spec.keys.KeyShape.sigs) TxnVerbs.tokenAssociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenAssociate) MiscEETUtils.metadata(com.hedera.services.bdd.suites.utils.MiscEETUtils.metadata) ByteString.copyFromUtf8(com.google.protobuf.ByteString.copyFromUtf8) DELEGATE_MINT_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_MINT_CALL_ABI) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) QueryVerbs.getTokenInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getTokenInfo) Revoked(com.hederahashgraph.api.proto.java.TokenKycStatus.Revoked) HapiPropertySource.asToken(com.hedera.services.bdd.spec.HapiPropertySource.asToken) SINGLE_TOKEN_ASSOCIATE(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.SINGLE_TOKEN_ASSOCIATE) AtomicReference(java.util.concurrent.atomic.AtomicReference) DELEGATE_CONTRACT(com.hedera.services.bdd.spec.keys.KeyShape.DELEGATE_CONTRACT) INVALID_SIGNATURE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_SIGNATURE) ContractResources(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources) ArrayList(java.util.ArrayList) UtilVerbs.emptyChildRecordsCheck(com.hedera.services.bdd.spec.utilops.UtilVerbs.emptyChildRecordsCheck) TxnVerbs.cryptoUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoUpdate) TokenMovement.moving(com.hedera.services.bdd.spec.transactions.token.TokenMovement.moving) UtilVerbs.childRecordsCheck(com.hedera.services.bdd.spec.utilops.UtilVerbs.childRecordsCheck) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) HapiPropertySource.asDotDelimitedLongArray(com.hedera.services.bdd.spec.HapiPropertySource.asDotDelimitedLongArray) KeyShape(com.hedera.services.bdd.spec.keys.KeyShape) AccountID(com.hederahashgraph.api.proto.java.AccountID) MINT_TOKEN_ORDINARY_CALL(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.MINT_TOKEN_ORDINARY_CALL) TxnVerbs.mintToken(com.hedera.services.bdd.spec.transactions.TxnVerbs.mintToken) TxnVerbs.tokenCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenCreate) ACCOUNT_FROZEN_FOR_TOKEN(com.hederahashgraph.api.proto.java.ResponseCodeEnum.ACCOUNT_FROZEN_FOR_TOKEN) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) DELEGATE_DISSOCIATE_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_DISSOCIATE_CALL_ABI) UtilVerbs.updateLargeFile(com.hedera.services.bdd.spec.utilops.UtilVerbs.updateLargeFile) QueryVerbs.getAccountBalance(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance) VANILLA_TOKEN(com.hedera.services.bdd.suites.token.TokenAssociationSpecs.VANILLA_TOKEN) CustomSpecAssert.allRunFor(com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor) BURN_TOKEN_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.BURN_TOKEN_ABI) SIMPLE(com.hedera.services.bdd.spec.keys.KeyShape.SIMPLE) TokenType(com.hederahashgraph.api.proto.java.TokenType) AtomicLong(java.util.concurrent.atomic.AtomicLong) TxnVerbs.fileCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileCreate) TokenID(com.hederahashgraph.api.proto.java.TokenID) STATIC_BURN_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.STATIC_BURN_CALL_ABI) Utils.asAddress(com.hedera.services.bdd.suites.contract.Utils.asAddress) CONTRACT_REVERT_EXECUTED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.CONTRACT_REVERT_EXECUTED) NON_FUNGIBLE_UNIQUE(com.hederahashgraph.api.proto.java.TokenType.NON_FUNGIBLE_UNIQUE) TxnVerbs.contractCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCreate) FUNGIBLE_COMMON(com.hederahashgraph.api.proto.java.TokenType.FUNGIBLE_COMMON) LogManager(org.apache.logging.log4j.LogManager) DELEGATE_TRANSFER_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.DELEGATE_TRANSFER_CALL_ABI) TokenMovement.movingUnique(com.hedera.services.bdd.spec.transactions.token.TokenMovement.movingUnique) TokenSupplyType(com.hederahashgraph.api.proto.java.TokenSupplyType) TxnVerbs.tokenUnfreeze(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUnfreeze) AtomicLong(java.util.concurrent.atomic.AtomicLong) AtomicLong(java.util.concurrent.atomic.AtomicLong) ArrayList(java.util.ArrayList)

Example 5 with HapiApiSpec

use of com.hedera.services.bdd.spec.HapiApiSpec in project hedera-services by hashgraph.

the class ContractMintHTSSuite method happyPathNonFungibleTokenMint.

private HapiApiSpec happyPathNonFungibleTokenMint() {
    final var theAccount = "anybody";
    final var mintContractByteCode = "mintContractByteCode";
    final var nonFungibleToken = "nonFungibleToken";
    final var multiKey = "purpose";
    final var theContract = "mintContract";
    final var firstMintTxn = "firstMintTxn";
    final var totalSupply = 2;
    final AtomicLong nonFungibleNum = new AtomicLong();
    return defaultHapiSpec("NonFungibleMint").given(newKeyNamed(multiKey), cryptoCreate(theAccount).balance(10 * ONE_HUNDRED_HBARS), cryptoCreate(TOKEN_TREASURY), fileCreate(mintContractByteCode).payingWith(theAccount), updateLargeFile(theAccount, mintContractByteCode, extractByteCode(ContractResources.MINT_CONTRACT)), tokenCreate(nonFungibleToken).tokenType(TokenType.NON_FUNGIBLE_UNIQUE).supplyType(TokenSupplyType.INFINITE).initialSupply(0).treasury(TOKEN_TREASURY).adminKey(multiKey).supplyKey(multiKey).exposingCreatedIdTo(idLit -> nonFungibleNum.set(asDotDelimitedLongArray(idLit)[2]))).when(sourcing(() -> contractCreate(theContract, MINT_CONS_ABI, nonFungibleNum.get()).bytecode(mintContractByteCode).payingWith(theAccount).gas(GAS_TO_OFFER))).then(contractCall(theContract, MINT_NON_FUNGIBLE_WITH_EVENT_CALL_ABI, Arrays.asList("Test metadata 1", "Test metadata 2")).via(firstMintTxn).payingWith(theAccount).gas(GAS_TO_OFFER).alsoSigningWithFullPrefix(multiKey), getTxnRecord(firstMintTxn).andAllChildRecords().logged(), getTxnRecord(firstMintTxn).hasPriority(recordWith().contractCallResult(resultWith().logs(inOrder(logWith().noData().withTopicsInOrder(List.of(parsedToByteString(totalSupply), parsedToByteString(1))))))), getTokenInfo(nonFungibleToken).hasTotalSupply(totalSupply), getAccountBalance(TOKEN_TREASURY).hasTokenBalance(nonFungibleToken, totalSupply));
}
Also used : QueryVerbs.getTokenNftInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getTokenNftInfo) Arrays(java.util.Arrays) TxnVerbs.cryptoCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate) UtilVerbs.sourcing(com.hedera.services.bdd.spec.utilops.UtilVerbs.sourcing) ON(com.hedera.services.bdd.spec.keys.SigControl.ON) TxnVerbs.cryptoTransfer(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer) ContractLogAsserts.logWith(com.hedera.services.bdd.spec.assertions.ContractLogAsserts.logWith) QueryVerbs.getTxnRecord(com.hedera.services.bdd.spec.queries.QueryVerbs.getTxnRecord) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) SomeFungibleTransfers.changingFungibleBalances(com.hedera.services.bdd.spec.assertions.SomeFungibleTransfers.changingFungibleBalances) TxnVerbs.contractCall(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCall) ContractFnResultAsserts.resultWith(com.hedera.services.bdd.spec.assertions.ContractFnResultAsserts.resultWith) UtilVerbs.newKeyNamed(com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed) TransactionRecordAsserts.recordWith(com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) Utils.extractByteCode(com.hedera.services.bdd.suites.contract.Utils.extractByteCode) NonFungibleTransfers(com.hedera.services.bdd.spec.assertions.NonFungibleTransfers) List(java.util.List) Logger(org.apache.logging.log4j.Logger) TxnVerbs.tokenUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUpdate) NotNull(org.jetbrains.annotations.NotNull) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) KeyShape.sigs(com.hedera.services.bdd.spec.keys.KeyShape.sigs) HW_MINT_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.HW_MINT_CALL_ABI) TxnVerbs.tokenAssociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenAssociate) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) QueryVerbs.getTokenInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getTokenInfo) MINT_CONS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.MINT_CONS_ABI) DELEGATE_CONTRACT(com.hedera.services.bdd.spec.keys.KeyShape.DELEGATE_CONTRACT) ContractResources(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources) MINT_FUNGIBLE_WITH_EVENT_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.MINT_FUNGIBLE_WITH_EVENT_CALL_ABI) TxnVerbs.cryptoUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoUpdate) TokenMovement.moving(com.hedera.services.bdd.spec.transactions.token.TokenMovement.moving) UtilVerbs.childRecordsCheck(com.hedera.services.bdd.spec.utilops.UtilVerbs.childRecordsCheck) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) HapiPropertySource.asDotDelimitedLongArray(com.hedera.services.bdd.spec.HapiPropertySource.asDotDelimitedLongArray) HW_MINT_CONS_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.HW_MINT_CONS_ABI) KeyShape(com.hedera.services.bdd.spec.keys.KeyShape) HTSPrecompileResult.htsPrecompileResult(com.hedera.services.bdd.suites.utils.contracts.precompile.HTSPrecompileResult.htsPrecompileResult) HW_BRRR_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.HW_BRRR_CALL_ABI) TxnVerbs.tokenCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenCreate) HTSPrecompileResult(com.hedera.services.bdd.suites.utils.contracts.precompile.HTSPrecompileResult) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) MINT_NON_FUNGIBLE_WITH_EVENT_CALL_ABI(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources.MINT_NON_FUNGIBLE_WITH_EVENT_CALL_ABI) UtilVerbs.updateLargeFile(com.hedera.services.bdd.spec.utilops.UtilVerbs.updateLargeFile) QueryVerbs.getAccountBalance(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance) CustomSpecAssert.allRunFor(com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor) TokenType(com.hederahashgraph.api.proto.java.TokenType) AtomicLong(java.util.concurrent.atomic.AtomicLong) TxnVerbs.fileCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileCreate) Utils.asAddress(com.hedera.services.bdd.suites.contract.Utils.asAddress) TxnVerbs.contractCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCreate) Utils.parsedToByteString(com.hedera.services.bdd.suites.contract.Utils.parsedToByteString) AssertUtils.inOrder(com.hedera.services.bdd.spec.assertions.AssertUtils.inOrder) LogManager(org.apache.logging.log4j.LogManager) TokenSupplyType(com.hederahashgraph.api.proto.java.TokenSupplyType) AtomicLong(java.util.concurrent.atomic.AtomicLong)

Aggregations

HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)140 List (java.util.List)134 LogManager (org.apache.logging.log4j.LogManager)125 Logger (org.apache.logging.log4j.Logger)125 HapiApiSuite (com.hedera.services.bdd.suites.HapiApiSuite)84 UtilVerbs.withOpContext (com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext)78 HapiApiSpec.defaultHapiSpec (com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec)76 TxnVerbs.cryptoCreate (com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate)69 SUCCESS (com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS)65 Function (java.util.function.Function)63 HapiSpecOperation (com.hedera.services.bdd.spec.HapiSpecOperation)58 TxnVerbs.cryptoTransfer (com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer)56 ByteString (com.google.protobuf.ByteString)53 Key (com.hederahashgraph.api.proto.java.Key)52 CustomSpecAssert.allRunFor (com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor)51 Optional (java.util.Optional)50 UtilVerbs.newKeyNamed (com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed)49 Consumer (java.util.function.Consumer)49 QueryVerbs.getAccountBalance (com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance)47 TxnVerbs.fileCreate (com.hedera.services.bdd.spec.transactions.TxnVerbs.fileCreate)46