use of com.radixdlt.api.core.openapitools.model.SubEntity in project radixdlt by radixdlt.
the class EntityHandlerTest method retrieve_invalid_sub_entity_should_throw.
@Test
public void retrieve_invalid_sub_entity_should_throw() throws Exception {
// Arrange
start();
// Act
var address = REAddr.ofPubKeyAccount(selfKey());
var invalidSubEntity = coreModelMapper.entityIdentifier(address).subEntity(new SubEntity().address("prepared_stakes"));
var request = new EntityRequest().networkIdentifier(new NetworkIdentifier().network("localnet")).entityIdentifier(invalidSubEntity);
var response = handleRequestWithExpectedResponse(sut, request, UnexpectedError.class);
// Assert
assertThat(response.getDetails()).isInstanceOf(InvalidSubEntityError.class);
}
use of com.radixdlt.api.core.openapitools.model.SubEntity in project radixdlt by radixdlt.
the class ConstructionBuildTransferStakeUnstakeTest method withdrawing_staked_tokens_should_fail.
@Test
public void withdrawing_staked_tokens_should_fail() throws Exception {
// Arrange
start();
// Act
var request = buildTransfer(coreModelMapper.nativeToken(), getStakeAmount().toSubunits(), coreModelMapper.entityIdentifier(self).subEntity(new SubEntity().address("system")), coreModelMapper.entityIdentifier(REAddr.ofPubKeyAccount(self)));
var response = handleRequestWithExpectedResponse(sut, request, UnexpectedError.class);
// Assert
assertThat(response.getDetails()).isInstanceOf(ResourceWithdrawOperationNotSupportedByEntityError.class);
}
Aggregations