use of com.hedera.mirror.common.domain.token.NftTransferId 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;
}
use of com.hedera.mirror.common.domain.token.NftTransferId in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerTokenTest method assertNftTransferInRepository.
private void assertNftTransferInRepository(long consensusTimestamp, long serialNumber, TokenID tokenID, AccountID receiverId, AccountID senderId) {
EntityId receiver = receiverId != null ? EntityId.of(receiverId) : null;
EntityId sender = senderId != null ? EntityId.of(senderId) : null;
var id = new NftTransferId(consensusTimestamp, serialNumber, EntityId.of(tokenID));
assertThat(nftTransferRepository.findById(id)).get().returns(receiver, from(com.hedera.mirror.common.domain.token.NftTransfer::getReceiverAccountId)).returns(sender, from(com.hedera.mirror.common.domain.token.NftTransfer::getSenderAccountId));
}
use of com.hedera.mirror.common.domain.token.NftTransferId 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);
}
use of com.hedera.mirror.common.domain.token.NftTransferId 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);
}
use of com.hedera.mirror.common.domain.token.NftTransferId 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);
}
Aggregations