Search in sources :

Example 1 with UnclaimedRadixEngineAddress

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

the class EntityHandlerTest method retrieve_non_existent_token_on_genesis.

@Test
public void retrieve_non_existent_token_on_genesis() throws Exception {
    // Arrange
    start();
    // Act
    var tokenAddress = REAddr.ofHashedKey(selfKey(), "test");
    var request = new EntityRequest().networkIdentifier(new NetworkIdentifier().network("localnet")).entityIdentifier(coreModelMapper.entityIdentifier(tokenAddress, "test"));
    var response = handleRequestWithExpectedResponse(sut, request, EntityResponse.class);
    // Assert
    var stateAccumulator = response.getStateIdentifier().getTransactionAccumulator();
    var genesisAccumulator = genesis.getProof().getAccumulatorState().getAccumulatorHash().asBytes();
    assertThat(stateAccumulator).isEqualTo(Bytes.toHexString(genesisAccumulator));
    assertThat(response.getBalances()).isEmpty();
    assertThat(response.getDataObjects()).containsExactly(new UnclaimedRadixEngineAddress().type(SubstateTypeMapping.getName(SubstateTypeId.UNCLAIMED_READDR)));
}
Also used : EntityRequest(com.radixdlt.api.core.openapitools.model.EntityRequest) NetworkIdentifier(com.radixdlt.api.core.openapitools.model.NetworkIdentifier) UnclaimedRadixEngineAddress(com.radixdlt.api.core.openapitools.model.UnclaimedRadixEngineAddress) ApiTest(com.radixdlt.api.ApiTest) Test(org.junit.Test)

Aggregations

ApiTest (com.radixdlt.api.ApiTest)1 EntityRequest (com.radixdlt.api.core.openapitools.model.EntityRequest)1 NetworkIdentifier (com.radixdlt.api.core.openapitools.model.NetworkIdentifier)1 UnclaimedRadixEngineAddress (com.radixdlt.api.core.openapitools.model.UnclaimedRadixEngineAddress)1 Test (org.junit.Test)1