Search in sources :

Example 31 with AccountID

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

the class EntityRecordItemListenerCryptoTest method groupCryptoTransfersByAccountId.

private void groupCryptoTransfersByAccountId(TransactionRecord.Builder recordBuilder, List<AccountAmount.Builder> amountsToBeAdded) {
    var accountAmounts = recordBuilder.getTransferListBuilder().getAccountAmountsBuilderList();
    var transfers = new HashMap<AccountID, Long>();
    Stream.concat(accountAmounts.stream(), amountsToBeAdded.stream()).forEach(accountAmount -> transfers.compute(accountAmount.getAccountID(), (k, v) -> {
        long currentValue = (v == null) ? 0 : v;
        return currentValue + accountAmount.getAmount();
    }));
    TransferList.Builder transferListBuilder = TransferList.newBuilder();
    transfers.entrySet().forEach(entry -> {
        AccountAmount accountAmount = AccountAmount.newBuilder().setAccountID(entry.getKey()).setAmount(entry.getValue()).build();
        transferListBuilder.addAccountAmounts(accountAmount);
    });
    recordBuilder.setTransferList(transferListBuilder);
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) CryptoAllowanceRepository(com.hedera.mirror.importer.repository.CryptoAllowanceRepository) EntityId(com.hedera.mirror.common.domain.entity.EntityId) NonFeeTransfer(com.hedera.mirror.common.domain.transaction.NonFeeTransfer) ContractRepository(com.hedera.mirror.importer.repository.ContractRepository) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) StringValue(com.google.protobuf.StringValue) Duration(com.hederahashgraph.api.proto.java.Duration) RecordParserProperties(com.hedera.mirror.importer.parser.record.RecordParserProperties) UtilityTest(com.hedera.mirror.importer.util.UtilityTest) CryptoDeleteLiveHashTransactionBody(com.hederahashgraph.api.proto.java.CryptoDeleteLiveHashTransactionBody) KeyList(com.hederahashgraph.api.proto.java.KeyList) NftAllowanceRepository(com.hedera.mirror.importer.repository.NftAllowanceRepository) TestUtils(com.hedera.mirror.importer.TestUtils) Utility(com.hedera.mirror.importer.util.Utility) RecordItemBuilder(com.hedera.mirror.importer.parser.domain.RecordItemBuilder) CryptoCreateTransactionBody(com.hederahashgraph.api.proto.java.CryptoCreateTransactionBody) CryptoUpdateTransactionBody(com.hederahashgraph.api.proto.java.CryptoUpdateTransactionBody) Collection(java.util.Collection) Resource(javax.annotation.Resource) CryptoTransfer(com.hedera.mirror.common.domain.transaction.CryptoTransfer) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) ByteString(com.google.protobuf.ByteString) Test(org.junit.jupiter.api.Test) AccountAmount(com.hederahashgraph.api.proto.java.AccountAmount) List(java.util.List) Nft(com.hedera.mirror.common.domain.token.Nft) RealmID(com.hederahashgraph.api.proto.java.RealmID) Stream(java.util.stream.Stream) ShardID(com.hederahashgraph.api.proto.java.ShardID) NftRemoveAllowance(com.hederahashgraph.api.proto.java.NftRemoveAllowance) StakingRewardTransfer(com.hedera.mirror.common.domain.transaction.StakingRewardTransfer) Optional(java.util.Optional) AccountIdConverter(com.hedera.mirror.common.converter.AccountIdConverter) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem) ErrataType(com.hedera.mirror.common.domain.transaction.ErrataType) Transaction(com.hederahashgraph.api.proto.java.Transaction) TransactionRecord(com.hederahashgraph.api.proto.java.TransactionRecord) NftId(com.hedera.mirror.common.domain.token.NftId) CsvSource(org.junit.jupiter.params.provider.CsvSource) Contract(com.hedera.mirror.common.domain.contract.Contract) PartialDataAction(com.hedera.mirror.importer.parser.PartialDataAction) BoolValue(com.google.protobuf.BoolValue) HashMap(java.util.HashMap) EnumSource(org.junit.jupiter.params.provider.EnumSource) NftAllowance(com.hederahashgraph.api.proto.java.NftAllowance) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) SignedTransaction(com.hederahashgraph.api.proto.java.SignedTransaction) AliasNotFoundException(com.hedera.mirror.importer.exception.AliasNotFoundException) LinkedList(java.util.LinkedList) AccountID(com.hederahashgraph.api.proto.java.AccountID) LiveHash(com.hedera.mirror.common.domain.transaction.LiveHash) Timestamp(com.hederahashgraph.api.proto.java.Timestamp) TransferList(com.hederahashgraph.api.proto.java.TransferList) NftRepository(com.hedera.mirror.importer.repository.NftRepository) TokenAllowanceRepository(com.hedera.mirror.importer.repository.TokenAllowanceRepository) Int32Value(com.google.protobuf.Int32Value) IterableAssert(org.assertj.core.api.IterableAssert) DomainUtils(com.hedera.mirror.common.util.DomainUtils) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) TransactionID(com.hederahashgraph.api.proto.java.TransactionID) DisplayName(org.junit.jupiter.api.DisplayName) Entity(com.hedera.mirror.common.domain.entity.Entity) Consumer(java.util.function.Consumer) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) TokenID(com.hederahashgraph.api.proto.java.TokenID) Assertions(org.junit.jupiter.api.Assertions) Condition(org.assertj.core.api.Condition) CryptoAddLiveHashTransactionBody(com.hederahashgraph.api.proto.java.CryptoAddLiveHashTransactionBody) HashMap(java.util.HashMap) TransferList(com.hederahashgraph.api.proto.java.TransferList) AccountAmount(com.hederahashgraph.api.proto.java.AccountAmount)

Example 32 with AccountID

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

the class EntityRecordItemListenerCryptoTest method cryptoDeleteAllowance.

@Test
void cryptoDeleteAllowance() {
    // given
    var delegatingSpender = EntityId.of(recordItemBuilder.accountId());
    var ownerAccountId = EntityId.of(recordItemBuilder.accountId());
    var spender1 = EntityId.of(recordItemBuilder.accountId());
    var spender2 = EntityId.of(recordItemBuilder.accountId());
    var tokenId1 = EntityId.of(recordItemBuilder.tokenId());
    var tokenId2 = EntityId.of(recordItemBuilder.tokenId());
    List<NftRemoveAllowance> nftRemoveAllowances = List.of(NftRemoveAllowance.newBuilder().setOwner(AccountID.newBuilder().setAccountNum(ownerAccountId.getEntityNum())).setTokenId(TokenID.newBuilder().setTokenNum(tokenId1.getEntityNum())).addSerialNumbers(1L).addSerialNumbers(2L).build(), NftRemoveAllowance.newBuilder().setOwner(AccountID.newBuilder().setAccountNum(ownerAccountId.getEntityNum())).setTokenId(TokenID.newBuilder().setTokenNum(tokenId2.getEntityNum())).addSerialNumbers(1L).addSerialNumbers(2L).addSerialNumbers(2L).build());
    RecordItem recordItem = recordItemBuilder.cryptoDeleteAllowance().transactionBody(b -> b.clearNftAllowances().addAllNftAllowances(nftRemoveAllowances)).build();
    var nft1 = Nft.builder().accountId(ownerAccountId).createdTimestamp(10L).deleted(false).id(new NftId(1L, tokenId1)).modifiedTimestamp(recordItem.getConsensusTimestamp()).build();
    var nft2 = Nft.builder().accountId(ownerAccountId).createdTimestamp(11L).deleted(false).id(new NftId(2L, tokenId1)).modifiedTimestamp(recordItem.getConsensusTimestamp()).build();
    var nft3 = Nft.builder().accountId(ownerAccountId).createdTimestamp(12L).deleted(false).id(new NftId(1L, tokenId2)).modifiedTimestamp(recordItem.getConsensusTimestamp()).build();
    var nft4 = Nft.builder().accountId(ownerAccountId).createdTimestamp(13L).deleted(false).id(new NftId(2L, tokenId2)).modifiedTimestamp(recordItem.getConsensusTimestamp()).build();
    List<Nft> nftsWithAllowance = Stream.of(nft1.toBuilder().delegatingSpender(delegatingSpender).modifiedTimestamp(15L).spender(spender1), nft2.toBuilder().modifiedTimestamp(16L).spender(spender2), nft3.toBuilder().modifiedTimestamp(17L).spender(spender1), nft4.toBuilder().modifiedTimestamp(18L).spender(spender2)).map(Nft.NftBuilder::build).collect(Collectors.toList());
    nftRepository.saveAll(nftsWithAllowance);
    // when
    parseRecordItemAndCommit(recordItem);
    // then
    assertAll(() -> assertEquals(0, entityRepository.count()), () -> assertTransactionAndRecord(recordItem.getTransactionBody(), recordItem.getRecord()), () -> assertThat(nftRepository.findAll()).containsExactlyInAnyOrder(nft1, nft2, nft3, nft4));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) CryptoAllowanceRepository(com.hedera.mirror.importer.repository.CryptoAllowanceRepository) EntityId(com.hedera.mirror.common.domain.entity.EntityId) NonFeeTransfer(com.hedera.mirror.common.domain.transaction.NonFeeTransfer) ContractRepository(com.hedera.mirror.importer.repository.ContractRepository) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) StringValue(com.google.protobuf.StringValue) Duration(com.hederahashgraph.api.proto.java.Duration) RecordParserProperties(com.hedera.mirror.importer.parser.record.RecordParserProperties) UtilityTest(com.hedera.mirror.importer.util.UtilityTest) CryptoDeleteLiveHashTransactionBody(com.hederahashgraph.api.proto.java.CryptoDeleteLiveHashTransactionBody) KeyList(com.hederahashgraph.api.proto.java.KeyList) NftAllowanceRepository(com.hedera.mirror.importer.repository.NftAllowanceRepository) TestUtils(com.hedera.mirror.importer.TestUtils) Utility(com.hedera.mirror.importer.util.Utility) RecordItemBuilder(com.hedera.mirror.importer.parser.domain.RecordItemBuilder) CryptoCreateTransactionBody(com.hederahashgraph.api.proto.java.CryptoCreateTransactionBody) CryptoUpdateTransactionBody(com.hederahashgraph.api.proto.java.CryptoUpdateTransactionBody) Collection(java.util.Collection) Resource(javax.annotation.Resource) CryptoTransfer(com.hedera.mirror.common.domain.transaction.CryptoTransfer) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) ByteString(com.google.protobuf.ByteString) Test(org.junit.jupiter.api.Test) AccountAmount(com.hederahashgraph.api.proto.java.AccountAmount) List(java.util.List) Nft(com.hedera.mirror.common.domain.token.Nft) RealmID(com.hederahashgraph.api.proto.java.RealmID) Stream(java.util.stream.Stream) ShardID(com.hederahashgraph.api.proto.java.ShardID) NftRemoveAllowance(com.hederahashgraph.api.proto.java.NftRemoveAllowance) StakingRewardTransfer(com.hedera.mirror.common.domain.transaction.StakingRewardTransfer) Optional(java.util.Optional) AccountIdConverter(com.hedera.mirror.common.converter.AccountIdConverter) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem) ErrataType(com.hedera.mirror.common.domain.transaction.ErrataType) Transaction(com.hederahashgraph.api.proto.java.Transaction) TransactionRecord(com.hederahashgraph.api.proto.java.TransactionRecord) NftId(com.hedera.mirror.common.domain.token.NftId) CsvSource(org.junit.jupiter.params.provider.CsvSource) Contract(com.hedera.mirror.common.domain.contract.Contract) PartialDataAction(com.hedera.mirror.importer.parser.PartialDataAction) BoolValue(com.google.protobuf.BoolValue) HashMap(java.util.HashMap) EnumSource(org.junit.jupiter.params.provider.EnumSource) NftAllowance(com.hederahashgraph.api.proto.java.NftAllowance) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) SignedTransaction(com.hederahashgraph.api.proto.java.SignedTransaction) AliasNotFoundException(com.hedera.mirror.importer.exception.AliasNotFoundException) LinkedList(java.util.LinkedList) AccountID(com.hederahashgraph.api.proto.java.AccountID) LiveHash(com.hedera.mirror.common.domain.transaction.LiveHash) Timestamp(com.hederahashgraph.api.proto.java.Timestamp) TransferList(com.hederahashgraph.api.proto.java.TransferList) NftRepository(com.hedera.mirror.importer.repository.NftRepository) TokenAllowanceRepository(com.hedera.mirror.importer.repository.TokenAllowanceRepository) Int32Value(com.google.protobuf.Int32Value) IterableAssert(org.assertj.core.api.IterableAssert) DomainUtils(com.hedera.mirror.common.util.DomainUtils) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) TransactionID(com.hederahashgraph.api.proto.java.TransactionID) DisplayName(org.junit.jupiter.api.DisplayName) Entity(com.hedera.mirror.common.domain.entity.Entity) Consumer(java.util.function.Consumer) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) TokenID(com.hederahashgraph.api.proto.java.TokenID) Assertions(org.junit.jupiter.api.Assertions) Condition(org.assertj.core.api.Condition) CryptoAddLiveHashTransactionBody(com.hederahashgraph.api.proto.java.CryptoAddLiveHashTransactionBody) NftRemoveAllowance(com.hederahashgraph.api.proto.java.NftRemoveAllowance) NftId(com.hedera.mirror.common.domain.token.NftId) Nft(com.hedera.mirror.common.domain.token.Nft) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem) UtilityTest(com.hedera.mirror.importer.util.UtilityTest) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 33 with AccountID

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

the class EntityRecordItemListenerTokenTest method tokenTransfersMustHaveCorrectIsApprovalValue.

@Test
void tokenTransfersMustHaveCorrectIsApprovalValue() {
    // given
    createAndAssociateToken(TOKEN_ID, FUNGIBLE_COMMON, SYMBOL, CREATE_TIMESTAMP, ASSOCIATE_TIMESTAMP, PAYER2, false, false, false, INITIAL_SUPPLY);
    TokenID tokenId2 = TokenID.newBuilder().setTokenNum(7).build();
    createTokenEntity(tokenId2, FUNGIBLE_COMMON, "MIRROR", 10L, false, false, false);
    AccountID accountId = AccountID.newBuilder().setAccountNum(1).build();
    TokenTransferList transferList1 = TokenTransferList.newBuilder().setToken(TOKEN_ID).addTransfers(AccountAmount.newBuilder().setAccountID(PAYER).setAmount(-1000).build()).addTransfers(AccountAmount.newBuilder().setAccountID(PAYER2).setAmount(-100).build()).addTransfers(AccountAmount.newBuilder().setAccountID(accountId).setAmount(1000).build()).build();
    TokenTransferList transferList2 = TokenTransferList.newBuilder().setToken(tokenId2).addTransfers(AccountAmount.newBuilder().setAccountID(PAYER).setAmount(333).build()).addTransfers(AccountAmount.newBuilder().setAccountID(accountId).setAmount(-333).build()).build();
    List<TokenTransferList> transferLists = List.of(transferList1, transferList2);
    // when
    Transaction transaction = buildTransaction(builder -> {
        TokenTransferList bodyTransferList1 = TokenTransferList.newBuilder().setToken(TOKEN_ID).addTransfers(AccountAmount.newBuilder().setAccountID(PAYER).setAmount(-600).setIsApproval(true).build()).addTransfers(AccountAmount.newBuilder().setAccountID(PAYER2).setAmount(-100).setIsApproval(true).build()).addTransfers(AccountAmount.newBuilder().setAccountID(accountId).setAmount(-333).build()).build();
        builder.getCryptoTransferBuilder().addTokenTransfers(bodyTransferList1);
    });
    insertAndParseTransaction(TRANSFER_TIMESTAMP, transaction, builder -> {
        builder.addAllTokenTransferLists(transferLists);
    });
    // then
    assertTokenTransferInRepository(TOKEN_ID, PAYER, TRANSFER_TIMESTAMP, -1000, true);
    assertTokenTransferInRepository(TOKEN_ID, PAYER2, TRANSFER_TIMESTAMP, -100, true);
    assertTokenTransferInRepository(TOKEN_ID, accountId, TRANSFER_TIMESTAMP, 1000);
    assertTokenTransferInRepository(tokenId2, PAYER, TRANSFER_TIMESTAMP, 333);
    assertTokenTransferInRepository(tokenId2, accountId, TRANSFER_TIMESTAMP, -333);
}
Also used : TokenTransferList(com.hederahashgraph.api.proto.java.TokenTransferList) AccountID(com.hederahashgraph.api.proto.java.AccountID) Transaction(com.hederahashgraph.api.proto.java.Transaction) TokenID(com.hederahashgraph.api.proto.java.TokenID) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 34 with AccountID

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

the class ContractCreateTransactionHandlerTest method updateTransactionStakedAccountId.

@Test
void updateTransactionStakedAccountId() {
    // given
    final AccountID accountID = AccountID.newBuilder().setAccountNum(1L).build();
    var recordItem = recordItemBuilder.contractCreate().transactionBody(b -> b.clearAutoRenewAccountId().setDeclineReward(false).setStakedAccountId(accountID)).build();
    // when
    transactionHandler.updateTransaction(transaction(recordItem), recordItem);
    // then
    verify(entityListener).onContract(contracts.capture());
    assertThat(contracts.getValue()).isNotNull().returns(false, Contract::isDeclineReward).returns(accountID.getAccountNum(), Contract::getStakedAccountId).returns(-1L, Contract::getStakedNodeId).returns(Utility.getEpochDay(recordItem.getConsensusTimestamp()), Contract::getStakePeriodStart);
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) TransactionRecord(com.hederahashgraph.api.proto.java.TransactionRecord) BeforeEach(org.junit.jupiter.api.BeforeEach) Contract(com.hedera.mirror.common.domain.contract.Contract) PartialDataAction(com.hedera.mirror.importer.parser.PartialDataAction) EntityId(com.hedera.mirror.common.domain.entity.EntityId) Descriptors(com.google.protobuf.Descriptors) Mock(org.mockito.Mock) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) EnumSource(org.junit.jupiter.params.provider.EnumSource) EthereumTransactionParser(com.hedera.mirror.importer.parser.record.ethereum.EthereumTransactionParser) Captor(org.mockito.Captor) EntityType(com.hedera.mirror.common.domain.entity.EntityType) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) RecordParserProperties(com.hedera.mirror.importer.parser.record.RecordParserProperties) ArgumentCaptor(org.mockito.ArgumentCaptor) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) AliasNotFoundException(com.hedera.mirror.importer.exception.AliasNotFoundException) TestUtils(com.hedera.mirror.importer.TestUtils) Mockito.doReturn(org.mockito.Mockito.doReturn) AccountID(com.hederahashgraph.api.proto.java.AccountID) Utility(com.hedera.mirror.importer.util.Utility) ContractResult(com.hedera.mirror.common.domain.contract.ContractResult) DomainUtils(com.hedera.mirror.common.util.DomainUtils) FileID(com.hederahashgraph.api.proto.java.FileID) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) EntityIdEndec(com.hedera.mirror.common.domain.entity.EntityIdEndec) Range(com.google.common.collect.Range) Mockito.when(org.mockito.Mockito.when) AbstractEntity(com.hedera.mirror.common.domain.entity.AbstractEntity) StandardCharsets(java.nio.charset.StandardCharsets) Mockito.verify(org.mockito.Mockito.verify) TransactionReceipt(com.hederahashgraph.api.proto.java.TransactionReceipt) CONTRACT(com.hedera.mirror.common.domain.entity.EntityType.CONTRACT) ByteString(com.google.protobuf.ByteString) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) BytesValue(com.google.protobuf.BytesValue) List(java.util.List) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ContractCreateTransactionBody(com.hederahashgraph.api.proto.java.ContractCreateTransactionBody) EntityProperties(com.hedera.mirror.importer.parser.record.entity.EntityProperties) Assertions(org.junit.jupiter.api.Assertions) Message(com.google.protobuf.Message) ContractFunctionResult(com.hederahashgraph.api.proto.java.ContractFunctionResult) ACCOUNT(com.hedera.mirror.common.domain.entity.EntityType.ACCOUNT) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem) Transaction(com.hedera.mirror.common.domain.transaction.Transaction) AccountID(com.hederahashgraph.api.proto.java.AccountID) Contract(com.hedera.mirror.common.domain.contract.Contract) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 35 with AccountID

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

the class ContractUpdateTransactionHandlerTest method updateTransactionStakedAccountId.

@Test
void updateTransactionStakedAccountId() {
    AccountID accountId = AccountID.newBuilder().setAccountNum(1L).build();
    RecordItem withStakedNodeIdSet = recordItemBuilder.contractUpdate().transactionBody(body -> body.clear().setStakedAccountId(accountId)).build();
    setupForContractUpdateTransactionTest(withStakedNodeIdSet, t -> assertThat(t).returns(1L, Contract::getStakedAccountId).returns(false, Contract::isDeclineReward).returns(-1L, Contract::getStakedNodeId).returns(Utility.getEpochDay(withStakedNodeIdSet.getConsensusTimestamp()), Contract::getStakePeriodStart));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BeforeEach(org.junit.jupiter.api.BeforeEach) Contract(com.hedera.mirror.common.domain.contract.Contract) PartialDataAction(com.hedera.mirror.importer.parser.PartialDataAction) EntityId(com.hedera.mirror.common.domain.entity.EntityId) BoolValue(com.google.protobuf.BoolValue) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) EnumSource(org.junit.jupiter.params.provider.EnumSource) ContractUpdateTransactionBody(com.hederahashgraph.api.proto.java.ContractUpdateTransactionBody) EntityType(com.hedera.mirror.common.domain.entity.EntityType) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) RecordParserProperties(com.hedera.mirror.importer.parser.record.RecordParserProperties) ContractID(com.hederahashgraph.api.proto.java.ContractID) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) AliasNotFoundException(com.hedera.mirror.importer.exception.AliasNotFoundException) AccountID(com.hederahashgraph.api.proto.java.AccountID) Utility(com.hedera.mirror.importer.util.Utility) RecordItemBuilder(com.hedera.mirror.importer.parser.domain.RecordItemBuilder) DomainUtils(com.hedera.mirror.common.util.DomainUtils) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) EntityIdEndec(com.hedera.mirror.common.domain.entity.EntityIdEndec) Range(com.google.common.collect.Range) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) CONTRACT(com.hedera.mirror.common.domain.entity.EntityType.CONTRACT) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Assertions(org.junit.jupiter.api.Assertions) ACCOUNT(com.hedera.mirror.common.domain.entity.EntityType.ACCOUNT) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem) Transaction(com.hedera.mirror.common.domain.transaction.Transaction) AccountID(com.hederahashgraph.api.proto.java.AccountID) Contract(com.hedera.mirror.common.domain.contract.Contract) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

AccountID (com.hederahashgraph.api.proto.java.AccountID)71 Test (org.junit.jupiter.api.Test)24 List (java.util.List)21 ByteString (com.google.protobuf.ByteString)20 Assertions (org.junit.jupiter.api.Assertions)20 HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)17 LogManager (org.apache.logging.log4j.LogManager)17 Logger (org.apache.logging.log4j.Logger)17 HapiApiSuite (com.hedera.services.bdd.suites.HapiApiSuite)16 HapiApiSpec.defaultHapiSpec (com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec)15 QueryVerbs.getTxnRecord (com.hedera.services.bdd.spec.queries.QueryVerbs.getTxnRecord)15 SUCCESS (com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS)15 QueryVerbs.getAccountInfo (com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountInfo)14 TransactionRecordAsserts.recordWith (com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith)13 QueryVerbs.getAccountBalance (com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance)13 TxnVerbs.cryptoCreate (com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate)13 TxnVerbs.cryptoTransfer (com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer)13 TxnVerbs.mintToken (com.hedera.services.bdd.spec.transactions.TxnVerbs.mintToken)13 HapiSpecSetup (com.hedera.services.bdd.spec.HapiSpecSetup)12 QueryVerbs.getScheduleInfo (com.hedera.services.bdd.spec.queries.QueryVerbs.getScheduleInfo)12