Search in sources :

Example 1 with ConstructionDeriveRequestMetadataExitingUnstakes

use of com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequestMetadataExitingUnstakes in project radixdlt by radixdlt.

the class ConstructionDeriveHandlerTest method derive_exiting_unstakes_should_return_entity_identifier.

@Test
public void derive_exiting_unstakes_should_return_entity_identifier() throws CoreApiException {
    // Arrange
    var publicKey = PrivateKeys.ofNumeric(2).getPublicKey();
    var validatorKey = PrivateKeys.ofNumeric(3).getPublicKey();
    long epochUnlock = 236L;
    start();
    // Act
    var request = new ConstructionDeriveRequest().networkIdentifier(networkIdentifier()).publicKey(coreModelMapper.publicKey(publicKey)).metadata(new ConstructionDeriveRequestMetadataExitingUnstakes().validator(coreModelMapper.entityIdentifier(validatorKey)).epochUnlock(epochUnlock).type("ExitingUnstakes"));
    var response = sut.handleRequest(request);
    // Assert
    assertThat(response.getEntityIdentifier()).isEqualTo(coreModelMapper.entityIdentifierExitingStake(REAddr.ofPubKeyAccount(publicKey), validatorKey, epochUnlock));
}
Also used : ConstructionDeriveRequest(com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequest) ConstructionDeriveRequestMetadataExitingUnstakes(com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequestMetadataExitingUnstakes) ApiTest(com.radixdlt.api.ApiTest) Test(org.junit.Test)

Aggregations

ApiTest (com.radixdlt.api.ApiTest)1 ConstructionDeriveRequest (com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequest)1 ConstructionDeriveRequestMetadataExitingUnstakes (com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequestMetadataExitingUnstakes)1 Test (org.junit.Test)1