Search in sources :

Example 1 with NftTransfer

use of com.hedera.mirror.common.domain.token.NftTransfer in project hedera-mirror-node by hashgraph.

the class SqlEntityListenerTest method getNftTransfer.

private NftTransfer getNftTransfer(long consensusTimestamp, String tokenId, long serialNumber, String receiverId, String senderId) {
    NftTransfer nftTransfer = new NftTransfer();
    nftTransfer.setId(new NftTransferId(consensusTimestamp, serialNumber, EntityId.of(tokenId, TOKEN)));
    nftTransfer.setReceiverAccountId(EntityId.of(receiverId, ACCOUNT));
    nftTransfer.setSenderAccountId(EntityId.of(senderId, ACCOUNT));
    nftTransfer.setPayerAccountId(TRANSACTION_PAYER);
    return nftTransfer;
}
Also used : NftTransfer(com.hedera.mirror.common.domain.token.NftTransfer) NftTransferId(com.hedera.mirror.common.domain.token.NftTransferId)

Example 2 with NftTransfer

use of com.hedera.mirror.common.domain.token.NftTransfer in project hedera-mirror-node by hashgraph.

the class NftTransferRepositoryTest method saveMintTransfer.

@Test
void saveMintTransfer() {
    NftTransfer nftTransfer = new NftTransfer();
    nftTransfer.setId(new NftTransferId(1, 1, EntityId.of("0.0.1", EntityType.TOKEN)));
    nftTransfer.setReceiverAccountId(EntityId.of("0.0.2", EntityType.ACCOUNT));
    nftTransfer.setPayerAccountId(PAYER_ACCOUNT_ID);
    NftTransfer saved = repository.save(nftTransfer);
    assertThat(repository.findById(saved.getId())).contains(saved);
}
Also used : NftTransfer(com.hedera.mirror.common.domain.token.NftTransfer) NftTransferId(com.hedera.mirror.common.domain.token.NftTransferId) Test(org.junit.jupiter.api.Test)

Example 3 with NftTransfer

use of com.hedera.mirror.common.domain.token.NftTransfer in project hedera-mirror-node by hashgraph.

the class NftTransferRepositoryTest method save.

@Test
void save() {
    NftTransfer nftTransfer = new NftTransfer();
    nftTransfer.setId(new NftTransferId(1, 1, EntityId.of("0.0.1", EntityType.TOKEN)));
    nftTransfer.setReceiverAccountId(EntityId.of("0.0.2", EntityType.ACCOUNT));
    nftTransfer.setSenderAccountId(EntityId.of("0.0.3", EntityType.ACCOUNT));
    nftTransfer.setPayerAccountId(PAYER_ACCOUNT_ID);
    NftTransfer saved = repository.save(nftTransfer);
    assertThat(repository.findById(saved.getId())).contains(saved);
}
Also used : NftTransfer(com.hedera.mirror.common.domain.token.NftTransfer) NftTransferId(com.hedera.mirror.common.domain.token.NftTransferId) Test(org.junit.jupiter.api.Test)

Example 4 with NftTransfer

use of com.hedera.mirror.common.domain.token.NftTransfer in project hedera-mirror-node by hashgraph.

the class NftTransferRepositoryTest method saveBurnTransfer.

@Test
void saveBurnTransfer() {
    NftTransfer nftTransfer = new NftTransfer();
    nftTransfer.setId(new NftTransferId(1, 1, EntityId.of("0.0.1", EntityType.TOKEN)));
    nftTransfer.setSenderAccountId(EntityId.of("0.0.3", EntityType.ACCOUNT));
    nftTransfer.setPayerAccountId(PAYER_ACCOUNT_ID);
    NftTransfer saved = repository.save(nftTransfer);
    assertThat(repository.findById(saved.getId())).contains(saved);
}
Also used : NftTransfer(com.hedera.mirror.common.domain.token.NftTransfer) NftTransferId(com.hedera.mirror.common.domain.token.NftTransferId) Test(org.junit.jupiter.api.Test)

Example 5 with NftTransfer

use of com.hedera.mirror.common.domain.token.NftTransfer in project hedera-mirror-node by hashgraph.

the class SupportDeletedTokenDissociateMigrationTest method nftTransfer.

private NftTransfer nftTransfer(long consensusTimestamp, EntityId receiver, EntityId sender, long serialNumber, EntityId tokenId) {
    NftTransfer nftTransfer = new NftTransfer();
    nftTransfer.setId(new NftTransferId(consensusTimestamp, serialNumber, tokenId));
    nftTransfer.setReceiverAccountId(receiver);
    nftTransfer.setSenderAccountId(sender);
    return nftTransfer;
}
Also used : NftTransfer(com.hedera.mirror.common.domain.token.NftTransfer) NftTransferId(com.hedera.mirror.common.domain.token.NftTransferId)

Aggregations

NftTransfer (com.hedera.mirror.common.domain.token.NftTransfer)14 NftTransferId (com.hedera.mirror.common.domain.token.NftTransferId)8 Test (org.junit.jupiter.api.Test)8 IntegrationTest (com.hedera.mirror.importer.IntegrationTest)4 EntityId (com.hedera.mirror.common.domain.entity.EntityId)3 EntityType (com.hedera.mirror.common.domain.entity.EntityType)3 Nft (com.hedera.mirror.common.domain.token.Nft)3 NftId (com.hedera.mirror.common.domain.token.NftId)3 List (java.util.List)3 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 ByteString (com.google.protobuf.ByteString)2 DomainBuilder (com.hedera.mirror.common.domain.DomainBuilder)2 Contract (com.hedera.mirror.common.domain.contract.Contract)2 CryptoAllowance (com.hedera.mirror.common.domain.entity.CryptoAllowance)2 Entity (com.hedera.mirror.common.domain.entity.Entity)2 ACCOUNT (com.hedera.mirror.common.domain.entity.EntityType.ACCOUNT)2 TOKEN (com.hedera.mirror.common.domain.entity.EntityType.TOKEN)2 NftAllowance (com.hedera.mirror.common.domain.entity.NftAllowance)2 TokenAllowance (com.hedera.mirror.common.domain.entity.TokenAllowance)2