Search in sources :

Example 11 with SUCCESS

use of com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS in project hedera-mirror-node by hashgraph.

the class TransferTransactionPayerMigrationTest method verifyEntityTimestampMigration.

@Test
void verifyEntityTimestampMigration() throws Exception {
    Entity node = domainBuilder.entity().customize(e -> e.createdTimestamp(10L).timestampRange(Range.atLeast(10L))).get();
    Entity treasury = domainBuilder.entity().customize(e -> e.createdTimestamp(20L).timestampRange(Range.atLeast(20L))).get();
    Entity sender = domainBuilder.entity().customize(e -> e.createdTimestamp(30L).timestampRange(Range.atLeast(30L))).get();
    Entity receiver = domainBuilder.entity().customize(e -> e.createdTimestamp(40L).timestampRange(Range.atLeast(40L))).get();
    Entity contract = domainBuilder.entity().customize(e -> e.createdTimestamp(50L).timestampRange(Range.atLeast(50L)).type(EntityType.CONTRACT)).get();
    Entity file = domainBuilder.entity().customize(e -> e.createdTimestamp(60L).timestampRange(Range.atLeast(60L)).type(EntityType.FILE)).get();
    Entity topic = domainBuilder.entity().customize(e -> e.createdTimestamp(70L).timestampRange(Range.atLeast(70L)).type(EntityType.TOPIC)).get();
    Entity token = domainBuilder.entity().customize(e -> e.createdTimestamp(80L).timestampRange(Range.atLeast(80L)).type(TOKEN)).get();
    Entity schedule = domainBuilder.entity().customize(e -> e.createdTimestamp(90L).timestampRange(Range.atLeast(90L)).type(EntityType.SCHEDULE)).get();
    // given
    persistEntities(List.of(node, treasury, sender, receiver, contract, file, topic, token, schedule));
    MigrationTransaction transfer1 = transaction(schedule.getCreatedTimestamp() + 200L, 0, SUCCESS, TransactionType.CRYPTOTRANSFER);
    MigrationTransaction transfer2 = transaction(schedule.getCreatedTimestamp() + 300L, 0, SUCCESS, TransactionType.CRYPTOTRANSFER);
    MigrationTransaction transfer3 = transaction(schedule.getCreatedTimestamp() + 400L, 0, SUCCESS, TransactionType.CRYPTOTRANSFER);
    MigrationTransaction transfer4 = transaction(schedule.getCreatedTimestamp() + 500L, 0, SUCCESS, TransactionType.CRYPTOTRANSFER);
    MigrationTransaction transfer5 = transaction(schedule.getCreatedTimestamp() + 600L, 0, SUCCESS, TransactionType.CRYPTOTRANSFER);
    persistTransactions(List.of(transaction(contract.getCreatedTimestamp(), contract.getId(), SUCCESS, TransactionType.CONTRACTCREATEINSTANCE), transaction(contract.getCreatedTimestamp() + 1, contract.getId(), INSUFFICIENT_TX_FEE, TransactionType.CONTRACTUPDATEINSTANCE), transaction(file.getCreatedTimestamp(), file.getId(), SUCCESS, TransactionType.FILECREATE), transaction(file.getCreatedTimestamp() + 1, file.getId(), SUCCESS, TransactionType.FILEDELETE), transaction(topic.getCreatedTimestamp(), topic.getId(), SUCCESS, TransactionType.CONSENSUSCREATETOPIC), transaction(topic.getCreatedTimestamp() + 1, topic.getId(), SUCCESS, TransactionType.CONSENSUSUPDATETOPIC), transaction(topic.getCreatedTimestamp() + 2, topic.getId(), SUCCESS, TransactionType.CONSENSUSUPDATETOPIC), transaction(topic.getCreatedTimestamp() + 3, topic.getId(), SUCCESS, TransactionType.CONSENSUSUPDATETOPIC), transaction(token.getCreatedTimestamp(), token.getId(), SUCCESS, TransactionType.TOKENCREATION), transaction(schedule.getCreatedTimestamp(), schedule.getId(), SUCCESS, TransactionType.SCHEDULECREATE), transfer1, transfer2, transfer3, transfer4, transfer5));
    EntityId nodeId = node.toEntityId();
    EntityId treasuryId = treasury.toEntityId();
    EntityId senderId = sender.toEntityId();
    EntityId receiverId = receiver.toEntityId();
    EntityId tokenId = token.toEntityId();
    long senderPaymentAmount = -45L;
    long receivedAmount = 30L;
    long nodePaymentAmount = 10L;
    long treasuryPaymentAmount = 5L;
    AssessedCustomFee assessedCustomFee1 = new AssessedCustomFee();
    assessedCustomFee1.setAmount(receivedAmount);
    assessedCustomFee1.setEffectivePayerAccountIds(List.of(senderId.getId()));
    assessedCustomFee1.setId(new AssessedCustomFee.Id(receiverId, transfer1.getConsensusTimestamp()));
    assessedCustomFee1.setPayerAccountId(tokenId);
    assessedCustomFee1.setTokenId(tokenId);
    AssessedCustomFee assessedCustomFee2 = new AssessedCustomFee();
    assessedCustomFee2.setAmount(receivedAmount);
    assessedCustomFee2.setEffectivePayerAccountIds(List.of(senderId.getId()));
    assessedCustomFee2.setId(new AssessedCustomFee.Id(receiverId, transfer5.getConsensusTimestamp()));
    assessedCustomFee2.setPayerAccountId(tokenId);
    assessedCustomFee2.setTokenId(tokenId);
    persistAssessedCustomFees(List.of(// assessed custom fee transfer
    assessedCustomFee1, // all transfers
    assessedCustomFee2));
    persistCryptoTransfers(List.of(// assessed custom fee transfer
    new CryptoTransfer(transfer1.getConsensusTimestamp(), senderPaymentAmount, senderId), new CryptoTransfer(transfer1.getConsensusTimestamp(), receivedAmount, receiverId), new CryptoTransfer(transfer1.getConsensusTimestamp(), nodePaymentAmount, nodeId), new CryptoTransfer(transfer1.getConsensusTimestamp(), treasuryPaymentAmount, treasuryId), // crypto only transfer
    new CryptoTransfer(transfer2.getConsensusTimestamp(), senderPaymentAmount, senderId), new CryptoTransfer(transfer2.getConsensusTimestamp(), receivedAmount, receiverId), new CryptoTransfer(transfer2.getConsensusTimestamp(), nodePaymentAmount, nodeId), new CryptoTransfer(transfer2.getConsensusTimestamp(), treasuryPaymentAmount, treasuryId), // nft transfer
    new CryptoTransfer(transfer3.getConsensusTimestamp(), senderPaymentAmount, senderId), new CryptoTransfer(transfer3.getConsensusTimestamp(), receivedAmount, receiverId), new CryptoTransfer(transfer3.getConsensusTimestamp(), nodePaymentAmount, nodeId), new CryptoTransfer(transfer3.getConsensusTimestamp(), treasuryPaymentAmount, treasuryId), // token transfer
    new CryptoTransfer(transfer4.getConsensusTimestamp(), senderPaymentAmount, senderId), new CryptoTransfer(transfer4.getConsensusTimestamp(), receivedAmount, receiverId), new CryptoTransfer(transfer4.getConsensusTimestamp(), nodePaymentAmount, nodeId), new CryptoTransfer(transfer4.getConsensusTimestamp(), treasuryPaymentAmount, treasuryId), // all transfers
    new CryptoTransfer(transfer5.getConsensusTimestamp(), senderPaymentAmount, senderId), new CryptoTransfer(transfer5.getConsensusTimestamp(), receivedAmount, receiverId), new CryptoTransfer(transfer5.getConsensusTimestamp(), nodePaymentAmount, nodeId), new CryptoTransfer(transfer5.getConsensusTimestamp(), treasuryPaymentAmount, treasuryId)));
    persistNonFeeTransfers(List.of(// assessed custom fee only transfer
    domainBuilder.nonFeeTransfer().customize(n -> n.consensusTimestamp(transfer1.getConsensusTimestamp()).amount(senderPaymentAmount).entityId(senderId)).get(), domainBuilder.nonFeeTransfer().customize(n -> n.amount(receivedAmount).consensusTimestamp(transfer1.getConsensusTimestamp()).entityId(receiverId)).get(), // crypto only transfer
    domainBuilder.nonFeeTransfer().customize(n -> n.amount(senderPaymentAmount).consensusTimestamp(transfer2.getConsensusTimestamp()).entityId(senderId)).get(), domainBuilder.nonFeeTransfer().customize(n -> n.amount(receivedAmount).consensusTimestamp(transfer2.getConsensusTimestamp()).entityId(receiverId)).get(), // nft transfer
    domainBuilder.nonFeeTransfer().customize(n -> n.amount(senderPaymentAmount).consensusTimestamp(transfer3.getConsensusTimestamp()).entityId(senderId)).get(), domainBuilder.nonFeeTransfer().customize(n -> n.amount(receivedAmount).consensusTimestamp(transfer3.getConsensusTimestamp()).entityId(receiverId)).get(), // token transfer
    domainBuilder.nonFeeTransfer().customize(n -> n.amount(senderPaymentAmount).consensusTimestamp(transfer4.getConsensusTimestamp()).entityId(senderId)).get(), domainBuilder.nonFeeTransfer().customize(n -> n.amount(receivedAmount).consensusTimestamp(transfer4.getConsensusTimestamp()).entityId(receiverId)).get(), // all transfers
    domainBuilder.nonFeeTransfer().customize(n -> n.amount(senderPaymentAmount).consensusTimestamp(transfer5.getConsensusTimestamp()).entityId(senderId)).get(), domainBuilder.nonFeeTransfer().customize(n -> n.amount(receivedAmount).consensusTimestamp(transfer5.getConsensusTimestamp()).entityId(receiverId)).get()));
    persistNftTransfers(List.of(// nft transfer
    domainBuilder.nftTransfer().customize(n -> n.id(new NftTransferId(transfer3.getConsensusTimestamp(), 1L, tokenId)).payerAccountId(null).receiverAccountId(receiverId).senderAccountId(senderId)).get(), // all transfers
    domainBuilder.nftTransfer().customize(n -> n.id(new NftTransferId(transfer5.getConsensusTimestamp(), 2L, tokenId)).payerAccountId(null).receiverAccountId(receiverId).senderAccountId(senderId)).get()));
    persistTokenTransfers(List.of(// token transfer
    new TokenTransfer(transfer4.getConsensusTimestamp(), -receivedAmount, tokenId, senderId), new TokenTransfer(transfer4.getConsensusTimestamp(), receivedAmount, tokenId, receiverId), // all transfers
    new TokenTransfer(transfer5.getConsensusTimestamp(), -receivedAmount, tokenId, senderId), new TokenTransfer(transfer5.getConsensusTimestamp(), receivedAmount, tokenId, receiverId)));
    // when
    migrate();
    List<SharedTransfer> expectedAssessedCustomFeeTransfers = List.of(// assessed custom fee transfer
    new SharedTransfer(receivedAmount, transfer1.getConsensusTimestamp(), PAYER_ID, receiverId, senderId), new SharedTransfer(receivedAmount, transfer5.getConsensusTimestamp(), PAYER_ID, receiverId, senderId));
    List<SharedTransfer> expectedCryptoTransfers = List.of(// assessed custom fee transfer
    new SharedTransfer(senderPaymentAmount, transfer1.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer1.getConsensusTimestamp(), PAYER_ID, receiverId, null), new SharedTransfer(nodePaymentAmount, transfer1.getConsensusTimestamp(), PAYER_ID, nodeId, null), new SharedTransfer(treasuryPaymentAmount, transfer1.getConsensusTimestamp(), PAYER_ID, treasuryId, null), // crypto only transfer
    new SharedTransfer(senderPaymentAmount, transfer2.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer2.getConsensusTimestamp(), PAYER_ID, receiverId, null), new SharedTransfer(nodePaymentAmount, transfer2.getConsensusTimestamp(), PAYER_ID, nodeId, null), new SharedTransfer(treasuryPaymentAmount, transfer2.getConsensusTimestamp(), PAYER_ID, treasuryId, null), // nft transfer
    new SharedTransfer(senderPaymentAmount, transfer3.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer3.getConsensusTimestamp(), PAYER_ID, receiverId, null), new SharedTransfer(nodePaymentAmount, transfer3.getConsensusTimestamp(), PAYER_ID, nodeId, null), new SharedTransfer(treasuryPaymentAmount, transfer3.getConsensusTimestamp(), PAYER_ID, treasuryId, null), // token transfer
    new SharedTransfer(senderPaymentAmount, transfer4.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer4.getConsensusTimestamp(), PAYER_ID, receiverId, null), new SharedTransfer(nodePaymentAmount, transfer4.getConsensusTimestamp(), PAYER_ID, nodeId, null), new SharedTransfer(treasuryPaymentAmount, transfer4.getConsensusTimestamp(), PAYER_ID, treasuryId, null), // all transfers
    new SharedTransfer(senderPaymentAmount, transfer5.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer5.getConsensusTimestamp(), PAYER_ID, receiverId, null), new SharedTransfer(nodePaymentAmount, transfer5.getConsensusTimestamp(), PAYER_ID, nodeId, null), new SharedTransfer(treasuryPaymentAmount, transfer5.getConsensusTimestamp(), PAYER_ID, treasuryId, null));
    List<SharedTransfer> expectedNftTransfers = List.of(// nft transfer
    new SharedTransfer(1L, transfer3.getConsensusTimestamp(), PAYER_ID, receiverId, senderId), new SharedTransfer(2L, transfer5.getConsensusTimestamp(), PAYER_ID, receiverId, senderId));
    List<SharedTransfer> expectedNonFeeTransfers = List.of(// assessed custom fee only transfer
    new SharedTransfer(senderPaymentAmount, transfer1.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer1.getConsensusTimestamp(), PAYER_ID, receiverId, null), // crypto only transfer
    new SharedTransfer(senderPaymentAmount, transfer2.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer2.getConsensusTimestamp(), PAYER_ID, receiverId, null), // nft transfer
    new SharedTransfer(senderPaymentAmount, transfer3.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer3.getConsensusTimestamp(), PAYER_ID, receiverId, null), // token transfer
    new SharedTransfer(senderPaymentAmount, transfer4.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer4.getConsensusTimestamp(), PAYER_ID, receiverId, null), // token transfer
    new SharedTransfer(senderPaymentAmount, transfer5.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer5.getConsensusTimestamp(), PAYER_ID, receiverId, null));
    List<SharedTransfer> expectedTokenTransfers = List.of(// token transfer
    new SharedTransfer(-receivedAmount, transfer4.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer4.getConsensusTimestamp(), PAYER_ID, receiverId, null), // all transfer
    new SharedTransfer(-receivedAmount, transfer5.getConsensusTimestamp(), PAYER_ID, null, senderId), new SharedTransfer(receivedAmount, transfer5.getConsensusTimestamp(), PAYER_ID, receiverId, null));
    // then
    assertThat(findAssessedCustomFees()).containsExactlyInAnyOrderElementsOf(expectedAssessedCustomFeeTransfers);
    assertThat(findCryptoTransfers()).containsExactlyInAnyOrderElementsOf(expectedCryptoTransfers);
    assertThat(findNftTransfers()).containsExactlyInAnyOrderElementsOf(expectedNftTransfers);
    assertThat(findNonFeeTransfersAsSharedTransfers()).containsExactlyInAnyOrderElementsOf(expectedNonFeeTransfers);
    assertThat(findTokenTransfers()).containsExactlyInAnyOrderElementsOf(expectedTokenTransfers);
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) JdbcOperations(org.springframework.jdbc.core.JdbcOperations) EntityId(com.hedera.mirror.common.domain.entity.EntityId) NonFeeTransfer(com.hedera.mirror.common.domain.transaction.NonFeeTransfer) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TransactionRepository(com.hedera.mirror.importer.repository.TransactionRepository) StringUtils(org.apache.commons.lang3.StringUtils) EntityType(com.hedera.mirror.common.domain.entity.EntityType) TransactionType(com.hedera.mirror.common.domain.transaction.TransactionType) Value(org.springframework.beans.factory.annotation.Value) TOKEN(com.hedera.mirror.common.domain.entity.EntityType.TOKEN) ObjectUtils(org.apache.commons.lang3.ObjectUtils) NftTransfer(com.hedera.mirror.common.domain.token.NftTransfer) NftTransferRepository(com.hedera.mirror.importer.repository.NftTransferRepository) Tag(org.junit.jupiter.api.Tag) AssessedCustomFee(com.hedera.mirror.common.domain.transaction.AssessedCustomFee) EnabledIfV1(com.hedera.mirror.importer.EnabledIfV1) NonFeeTransferRepository(com.hedera.mirror.importer.repository.NonFeeTransferRepository) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) EntityIdEndec(com.hedera.mirror.common.domain.entity.EntityIdEndec) Range(com.google.common.collect.Range) Resource(javax.annotation.Resource) CryptoTransfer(com.hedera.mirror.common.domain.transaction.CryptoTransfer) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) TestPropertySource(org.springframework.test.context.TestPropertySource) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) PostgreSQLGuavaRangeType(com.vladmihalcea.hibernate.type.range.guava.PostgreSQLGuavaRangeType) PreparedStatement(java.sql.PreparedStatement) File(java.io.File) TokenTransferRepository(com.hedera.mirror.importer.repository.TokenTransferRepository) Entity(com.hedera.mirror.common.domain.entity.Entity) Test(org.junit.jupiter.api.Test) IntegrationTest(com.hedera.mirror.importer.IntegrationTest) List(java.util.List) EntityRepository(com.hedera.mirror.importer.repository.EntityRepository) CryptoTransferRepository(com.hedera.mirror.importer.repository.CryptoTransferRepository) Data(lombok.Data) NftTransferId(com.hedera.mirror.common.domain.token.NftTransferId) INSUFFICIENT_TX_FEE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INSUFFICIENT_TX_FEE) AllArgsConstructor(lombok.AllArgsConstructor) NoArgsConstructor(lombok.NoArgsConstructor) TokenTransfer(com.hedera.mirror.common.domain.token.TokenTransfer) EntityId(com.hedera.mirror.common.domain.entity.EntityId) Entity(com.hedera.mirror.common.domain.entity.Entity) NftTransferId(com.hedera.mirror.common.domain.token.NftTransferId) TokenTransfer(com.hedera.mirror.common.domain.token.TokenTransfer) CryptoTransfer(com.hedera.mirror.common.domain.transaction.CryptoTransfer) AssessedCustomFee(com.hedera.mirror.common.domain.transaction.AssessedCustomFee) Test(org.junit.jupiter.api.Test) IntegrationTest(com.hedera.mirror.importer.IntegrationTest)

Example 12 with SUCCESS

use of com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS in project hedera-services by hashgraph.

the class FileCreateTransitionLogicTest method happyPathFlows.

@Test
void happyPathFlows() {
    // setup:
    InOrder inOrder = inOrder(hfs, txnCtx, sigImpactHistorian);
    givenTxnCtxCreating(EnumSet.allOf(ValidProperty.class));
    // and:
    given(hfs.create(any(), any(), any())).willReturn(created);
    // when:
    subject.doStateTransition();
    // then:
    inOrder.verify(txnCtx).activePayer();
    inOrder.verify(hfs).create(argThat(bytes -> Arrays.equals(contents, bytes)), argThat(info -> info.getWacl().toString().equals(hederaWacl.toString()) && info.getExpiry() == expiry && memo.equals(info.getMemo())), argThat(genesis::equals));
    inOrder.verify(txnCtx).setCreated(created);
    inOrder.verify(txnCtx).setStatus(SUCCESS);
    inOrder.verify(sigImpactHistorian).markEntityChanged(created.getFileNum());
}
Also used : StateView(com.hedera.services.context.primitives.StateView) BeforeEach(org.junit.jupiter.api.BeforeEach) OK(com.hederahashgraph.api.proto.java.ResponseCodeEnum.OK) Arrays(java.util.Arrays) HFileMeta(com.hedera.services.files.HFileMeta) TieredHederaFs(com.hedera.services.files.TieredHederaFs) BDDMockito.inOrder(org.mockito.BDDMockito.inOrder) Duration(com.hederahashgraph.api.proto.java.Duration) TransactionContext(com.hedera.services.context.TransactionContext) BDDMockito.any(org.mockito.BDDMockito.any) BDDMockito.verify(org.mockito.BDDMockito.verify) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) BDDMockito.given(org.mockito.BDDMockito.given) CONTENTS(com.hedera.services.txns.file.FileCreateTransitionLogicTest.ValidProperty.CONTENTS) EXPIRY(com.hedera.services.txns.file.FileCreateTransitionLogicTest.ValidProperty.EXPIRY) KEY(com.hedera.services.txns.file.FileCreateTransitionLogicTest.ValidProperty.KEY) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) PlatformTxnAccessor(com.hedera.services.utils.PlatformTxnAccessor) AccountID(com.hederahashgraph.api.proto.java.AccountID) EnumSet(java.util.EnumSet) TxnHandlingScenario(com.hedera.test.factories.scenarios.TxnHandlingScenario) FileID(com.hederahashgraph.api.proto.java.FileID) FileCreateTransactionBody(com.hederahashgraph.api.proto.java.FileCreateTransactionBody) InOrder(org.mockito.InOrder) BDDMockito.willThrow(org.mockito.BDDMockito.willThrow) INVALID_ZERO_BYTE_IN_STRING(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_ZERO_BYTE_IN_STRING) SigImpactHistorian(com.hedera.services.ledger.SigImpactHistorian) TransactionID(com.hederahashgraph.api.proto.java.TransactionID) FAIL_INVALID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.FAIL_INVALID) HederaFs(com.hedera.services.files.HederaFs) Instant(java.time.Instant) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) OptionValidator(com.hedera.services.txns.validation.OptionValidator) IdUtils(com.hedera.test.utils.IdUtils) ByteString(com.google.protobuf.ByteString) Test(org.junit.jupiter.api.Test) MiscUtils(com.hedera.services.utils.MiscUtils) INVALID_FILE_WACL(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_FILE_WACL) Key(com.hederahashgraph.api.proto.java.Key) JKey(com.hedera.services.legacy.core.jproto.JKey) AUTORENEW_DURATION_NOT_IN_RANGE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.AUTORENEW_DURATION_NOT_IN_RANGE) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) BDDMockito.argThat(org.mockito.BDDMockito.argThat) BDDMockito.mock(org.mockito.BDDMockito.mock) KeyTree(com.hedera.test.factories.keys.KeyTree) INVALID_EXPIRATION_TIME(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_EXPIRATION_TIME) InOrder(org.mockito.InOrder) Test(org.junit.jupiter.api.Test)

Example 13 with SUCCESS

use of com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS in project hedera-services by hashgraph.

the class FileUpdateTransitionLogicTest method happyPathFlows.

@Test
void happyPathFlows() {
    // setup:
    InOrder inOrder = inOrder(hfs, txnCtx, sigImpactHistorian);
    givenTxnCtxUpdating(EnumSet.allOf(UpdateTarget.class));
    // and:
    given(hfs.overwrite(any(), any())).willReturn(new SimpleUpdateResult(false, true, SUCCESS));
    given(hfs.setattr(any(), any())).willReturn(new SimpleUpdateResult(true, false, SUCCESS));
    given(hfs.getattr(nonSysFileTarget)).willReturn(oldAttr);
    // when:
    subject.doStateTransition();
    // then:
    inOrder.verify(hfs).overwrite(argThat(nonSysFileTarget::equals), argThat(bytes -> Arrays.equals(newContents, bytes)));
    inOrder.verify(hfs).setattr(argThat(nonSysFileTarget::equals), argThat(attr -> newAttr.toString().equals(attr.toString())));
    inOrder.verify(txnCtx).setStatus(SUCCESS);
    inOrder.verify(sigImpactHistorian).markEntityChanged(nonSysFileTarget.getFileNum());
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) OK(com.hederahashgraph.api.proto.java.ResponseCodeEnum.OK) Arrays(java.util.Arrays) HFileMeta(com.hedera.services.files.HFileMeta) BDDMockito.inOrder(org.mockito.BDDMockito.inOrder) StringValue(com.google.protobuf.StringValue) Duration(com.hederahashgraph.api.proto.java.Duration) BDDMockito.verify(org.mockito.BDDMockito.verify) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) BDDMockito.given(org.mockito.BDDMockito.given) PlatformTxnAccessor(com.hedera.services.utils.PlatformTxnAccessor) EnumSet(java.util.EnumSet) BDDMockito.willThrow(org.mockito.BDDMockito.willThrow) DecoderException(org.apache.commons.codec.DecoderException) BDDMockito.never(org.mockito.BDDMockito.never) SigImpactHistorian(com.hedera.services.ledger.SigImpactHistorian) Instant(java.time.Instant) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) OptionValidator(com.hedera.services.txns.validation.OptionValidator) ByteString(com.google.protobuf.ByteString) Test(org.junit.jupiter.api.Test) MiscUtils(com.hedera.services.utils.MiscUtils) JKey(com.hedera.services.legacy.core.jproto.JKey) AUTORENEW_DURATION_NOT_IN_RANGE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.AUTORENEW_DURATION_NOT_IN_RANGE) INVALID_FILE_ID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_FILE_ID) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) UNAUTHORIZED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.UNAUTHORIZED) EntityNumbers(com.hedera.services.config.EntityNumbers) INVALID_EXPIRATION_TIME(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_EXPIRATION_TIME) StateView(com.hedera.services.context.primitives.StateView) TieredHederaFs(com.hedera.services.files.TieredHederaFs) AUTHORIZATION_FAILED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.AUTHORIZATION_FAILED) TransactionContext(com.hedera.services.context.TransactionContext) MerkleNetworkContext(com.hedera.services.state.merkle.MerkleNetworkContext) BDDMockito.any(org.mockito.BDDMockito.any) ArgumentCaptor(org.mockito.ArgumentCaptor) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) FILE_DELETED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.FILE_DELETED) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) AccountID(com.hederahashgraph.api.proto.java.AccountID) TxnHandlingScenario(com.hedera.test.factories.scenarios.TxnHandlingScenario) Timestamp(com.hederahashgraph.api.proto.java.Timestamp) PREPARED_UPDATE_FILE_IS_IMMUTABLE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.PREPARED_UPDATE_FILE_IS_IMMUTABLE) FileUpdateTransactionBody(com.hederahashgraph.api.proto.java.FileUpdateTransactionBody) MAX_FILE_SIZE_EXCEEDED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.MAX_FILE_SIZE_EXCEEDED) FileID(com.hederahashgraph.api.proto.java.FileID) InOrder(org.mockito.InOrder) MockEntityNumbers(com.hedera.services.config.MockEntityNumbers) INVALID_ZERO_BYTE_IN_STRING(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_ZERO_BYTE_IN_STRING) TransactionID(com.hederahashgraph.api.proto.java.TransactionID) FAIL_INVALID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.FAIL_INVALID) HederaFs(com.hedera.services.files.HederaFs) IdUtils(com.hedera.test.utils.IdUtils) Key(com.hederahashgraph.api.proto.java.Key) SimpleUpdateResult(com.hedera.services.files.SimpleUpdateResult) BAD_ENCODING(com.hederahashgraph.api.proto.java.ResponseCodeEnum.BAD_ENCODING) BDDMockito.argThat(org.mockito.BDDMockito.argThat) BDDMockito.mock(org.mockito.BDDMockito.mock) InOrder(org.mockito.InOrder) SimpleUpdateResult(com.hedera.services.files.SimpleUpdateResult) Test(org.junit.jupiter.api.Test)

Example 14 with SUCCESS

use of com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS in project hedera-services by hashgraph.

the class ContractKeysHTSSuite method callForMintWithContractKey.

private HapiApiSpec callForMintWithContractKey() {
    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("callForMintWithContractKey").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("contractKey").shape(CONTRACT_KEY_SHAPE.signedWith(sigs(ON, theContract))), tokenUpdate(fungibleToken).supplyKey("contractKey"), 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 15 with SUCCESS

use of com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS in project hedera-services by hashgraph.

the class ContractMintHTSSuite method helloWorldFungibleMint.

private HapiApiSpec helloWorldFungibleMint() {
    final var hwMintInitcode = "hwMintInitcode";
    final var amount = 1_234_567L;
    final var fungibleToken = "fungibleToken";
    final var multiKey = "purpose";
    final var contractKey = "meaning";
    final var hwMint = "hwMint";
    final var firstMintTxn = "firstMintTxn";
    final var secondMintTxn = "secondMintTxn";
    final AtomicLong fungibleNum = new AtomicLong();
    return defaultHapiSpec("HelloWorldFungibleMint").given(newKeyNamed(multiKey), fileCreate(hwMintInitcode).path(ContractResources.HW_MINT_PATH), tokenCreate(fungibleToken).tokenType(TokenType.FUNGIBLE_COMMON).initialSupply(0).adminKey(multiKey).supplyKey(multiKey).exposingCreatedIdTo(idLit -> fungibleNum.set(asDotDelimitedLongArray(idLit)[2]))).when(sourcing(() -> contractCreate(hwMint, HW_MINT_CONS_ABI, fungibleNum.get()).bytecode(hwMintInitcode).gas(GAS_TO_OFFER))).then(contractCall(hwMint, HW_BRRR_CALL_ABI, amount).via(firstMintTxn).alsoSigningWithFullPrefix(multiKey), getTxnRecord(firstMintTxn).andAllChildRecords().logged(), getTokenInfo(fungibleToken).hasTotalSupply(amount), /* And now make the token contract-controlled so no explicit supply sig is required */
    newKeyNamed(contractKey).shape(DELEGATE_CONTRACT.signedWith(hwMint)), tokenUpdate(fungibleToken).supplyKey(contractKey), getTokenInfo(fungibleToken).logged(), contractCall(hwMint, HW_BRRR_CALL_ABI, amount).via(secondMintTxn), getTxnRecord(secondMintTxn).andAllChildRecords().logged(), getTokenInfo(fungibleToken).hasTotalSupply(2 * amount), childRecordsCheck(secondMintTxn, SUCCESS, recordWith().status(SUCCESS).newTotalSupply(2469134L).tokenTransfers(changingFungibleBalances().including(fungibleToken, DEFAULT_PAYER, amount))));
}
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

SUCCESS (com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS)27 List (java.util.List)21 HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)20 LogManager (org.apache.logging.log4j.LogManager)20 Logger (org.apache.logging.log4j.Logger)20 UtilVerbs.withOpContext (com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext)18 HapiApiSpec.defaultHapiSpec (com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec)16 HapiSpecOperation (com.hedera.services.bdd.spec.HapiSpecOperation)15 TxnVerbs.cryptoCreate (com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate)15 TxnVerbs.cryptoTransfer (com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer)13 ResponseCodeEnum (com.hederahashgraph.api.proto.java.ResponseCodeEnum)11 TxnVerbs.tokenCreate (com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenCreate)10 CustomSpecAssert.allRunFor (com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor)10 AccountID (com.hederahashgraph.api.proto.java.AccountID)10 OK (com.hederahashgraph.api.proto.java.ResponseCodeEnum.OK)10 ByteString (com.google.protobuf.ByteString)9 TxnVerbs.fileCreate (com.hedera.services.bdd.spec.transactions.TxnVerbs.fileCreate)9 TxnVerbs.tokenAssociate (com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenAssociate)9 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)9 TokenMovement.moving (com.hedera.services.bdd.spec.transactions.token.TokenMovement.moving)8