use of com.hedera.mirror.common.domain.token.NftId in project hedera-mirror-node by hashgraph.
the class NftRepositoryTest method updateAccountIdMissingNft.
@Test
void updateAccountIdMissingNft() {
NftId nftId = new NftId(1L, EntityId.of("0.0.1", EntityType.TOKEN));
EntityId accountId = EntityId.of("0.0.10", EntityType.ACCOUNT);
nftRepository.transferNftOwnership(nftId, accountId, 3L);
assertThat(nftRepository.findById(nftId)).isNotPresent();
}
use of com.hedera.mirror.common.domain.token.NftId in project hedera-mirror-node by hashgraph.
the class NftRepositoryTest method nft.
private Nft nft(String tokenId, long serialNumber, long consensusTimestamp) {
Nft nft = new Nft();
nft.setAccountId(EntityId.of("0.0.1", EntityType.ACCOUNT));
nft.setCreatedTimestamp(consensusTimestamp);
nft.setId(new NftId(serialNumber, EntityId.of(tokenId, EntityType.TOKEN)));
nft.setMetadata(new byte[] { 1 });
nft.setModifiedTimestamp(consensusTimestamp);
return nft;
}
use of com.hedera.mirror.common.domain.token.NftId in project hedera-mirror-node by hashgraph.
the class DomainBuilder method nft.
public DomainWrapper<Nft, Nft.NftBuilder> nft() {
var createdTimestamp = timestamp();
var builder = Nft.builder().accountId(entityId(ACCOUNT)).createdTimestamp(createdTimestamp).deleted(false).id(new NftId(id(), entityId(TOKEN))).metadata(bytes(16)).modifiedTimestamp(createdTimestamp);
return new DomainWrapperImpl<>(builder, builder::build);
}
use of com.hedera.mirror.common.domain.token.NftId in project hedera-mirror-node by hashgraph.
the class BatchUpserterTest method getNft.
private Nft getNft(String tokenId, long serialNumber, String accountId, Long createdTimestamp, long modifiedTimeStamp, String metadata, Boolean deleted) {
Nft nft = new Nft();
nft.setAccountId(accountId == null ? null : EntityId.of(accountId, EntityType.ACCOUNT));
nft.setCreatedTimestamp(createdTimestamp);
nft.setDeleted(deleted);
nft.setId(new NftId(serialNumber, EntityId.of(tokenId, TOKEN)));
nft.setMetadata(metadata == null ? null : metadata.getBytes(StandardCharsets.UTF_8));
nft.setModifiedTimestamp(modifiedTimeStamp);
return nft;
}
use of com.hedera.mirror.common.domain.token.NftId in project hedera-mirror-node by hashgraph.
the class NftRepositoryTest method updateDeletedMissingNft.
@Test
void updateDeletedMissingNft() {
NftId nftId = new NftId(1L, EntityId.of("0.0.1", EntityType.TOKEN));
nftRepository.burnOrWipeNft(nftId, 1L);
assertThat(nftRepository.findById(nftId)).isNotPresent();
}
Aggregations