use of com.hedera.mirror.common.domain.contract.Contract in project hedera-mirror-node by hashgraph.
the class HistoricalAccountInfoMigrationTest method existingEntitiesAfterReset.
@Test
void existingEntitiesAfterReset() throws Exception {
Entity entity1 = createEntity(ACCOUNT_ID1, EntityType.ACCOUNT, true);
Entity entity2 = createEntity(ACCOUNT_ID2, EntityType.ACCOUNT, true);
Entity entity3 = createEntity(ACCOUNT_ID3, EntityType.ACCOUNT, true);
Contract contract1 = createEntity(CONTRACT_ID1, EntityType.CONTRACT, true);
historicalAccountInfoMigration.doMigrate();
assertThat(contractRepository.findAll()).containsExactlyInAnyOrder(contract1);
assertThat(entityRepository.findAll()).containsExactlyInAnyOrder(entity1, entity2, entity3);
}
use of com.hedera.mirror.common.domain.contract.Contract in project hedera-mirror-node by hashgraph.
the class HistoricalAccountInfoMigrationTest method existingEntitiesWrongType.
@Test
void existingEntitiesWrongType() throws Exception {
Entity entity1 = createEntity(ACCOUNT_ID1, EntityType.ACCOUNT, true);
Entity entity2 = createEntity(ACCOUNT_ID2, EntityType.ACCOUNT, true);
Entity entity3 = createEntity(ACCOUNT_ID3, EntityType.ACCOUNT, true);
Entity entity4 = createEntity(CONTRACT_ID1, EntityType.ACCOUNT, true);
historicalAccountInfoMigration.doMigrate();
assertThat(contractRepository.findAll()).hasSize(CONTRACT_COUNT).first().returns(EntityType.CONTRACT, Contract::getType).returns(entity4.getNum(), Contract::getNum);
assertThat(entityRepository.findAll()).containsExactlyInAnyOrder(entity1, entity2, entity3);
}
use of com.hedera.mirror.common.domain.contract.Contract in project hedera-mirror-node by hashgraph.
the class EntityIdServiceImplTest method lookupContractCreate2EvmAddressDeleted.
@Test
void lookupContractCreate2EvmAddressDeleted() {
Contract contract = domainBuilder.contract().customize((b) -> b.deleted(true)).persist();
assertThrows(AliasNotFoundException.class, () -> entityIdService.lookup(getProtoContractId(contract)));
}
use of com.hedera.mirror.common.domain.contract.Contract in project hedera-mirror-node by hashgraph.
the class EntityIdServiceImplTest method storeContract.
@ParameterizedTest
@CsvSource(value = { "false", "," })
void storeContract(Boolean deleted) {
Contract contract = domainBuilder.contract().customize(c -> c.deleted(deleted)).get();
entityIdService.notify(contract);
assertThat(entityIdService.lookup(getProtoContractId(contract))).isEqualTo(contract.toEntityId());
}
use of com.hedera.mirror.common.domain.contract.Contract in project hedera-mirror-node by hashgraph.
the class EntityIdServiceImplTest method storeContractDeleted.
@Test
void storeContractDeleted() {
Contract contract = domainBuilder.contract().customize(c -> c.deleted(true)).get();
entityIdService.notify(contract);
assertThrows(AliasNotFoundException.class, () -> entityIdService.lookup(getProtoContractId(contract)));
}
Aggregations