Search in sources :

Example 1 with MempoolTransactionRequest

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

the class MempoolTransactionHandlerTest method retrieving_invalid_hash_should_throw.

@Test
public void retrieving_invalid_hash_should_throw() throws Exception {
    // Arrange
    start();
    // Act
    var request = new MempoolTransactionRequest().networkIdentifier(new NetworkIdentifier().network("localnet")).transactionIdentifier(new TransactionIdentifier().hash("badbad"));
    var response = handleRequestWithExpectedResponse(sut, request, UnexpectedError.class);
    // Assert
    assertThat(response.getDetails()).isInstanceOf(InvalidTransactionHashError.class);
}
Also used : MempoolTransactionRequest(com.radixdlt.api.core.openapitools.model.MempoolTransactionRequest) TransactionIdentifier(com.radixdlt.api.core.openapitools.model.TransactionIdentifier) NetworkIdentifier(com.radixdlt.api.core.openapitools.model.NetworkIdentifier) ApiTest(com.radixdlt.api.ApiTest) Test(org.junit.Test)

Example 2 with MempoolTransactionRequest

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

the class MempoolTransactionHandlerTest method retrieving_transaction_not_in_mempool_should_throw.

@Test
public void retrieving_transaction_not_in_mempool_should_throw() throws Exception {
    // Arrange
    start();
    var accountAddress = REAddr.ofPubKeyAccount(self);
    var otherAddress = REAddr.ofPubKeyAccount(PrivateKeys.ofNumeric(2).getPublicKey());
    var signedTxn = buildSignedTxn(accountAddress, otherAddress);
    // Act
    var request = new MempoolTransactionRequest().networkIdentifier(new NetworkIdentifier().network("localnet")).transactionIdentifier(coreModelMapper.transactionIdentifier(signedTxn.getId()));
    var response = handleRequestWithExpectedResponse(sut, request, UnexpectedError.class);
    // Assert
    assertThat(response.getDetails()).isInstanceOf(TransactionNotFoundError.class);
}
Also used : MempoolTransactionRequest(com.radixdlt.api.core.openapitools.model.MempoolTransactionRequest) NetworkIdentifier(com.radixdlt.api.core.openapitools.model.NetworkIdentifier) ApiTest(com.radixdlt.api.ApiTest) Test(org.junit.Test)

Aggregations

ApiTest (com.radixdlt.api.ApiTest)2 MempoolTransactionRequest (com.radixdlt.api.core.openapitools.model.MempoolTransactionRequest)2 NetworkIdentifier (com.radixdlt.api.core.openapitools.model.NetworkIdentifier)2 Test (org.junit.Test)2 TransactionIdentifier (com.radixdlt.api.core.openapitools.model.TransactionIdentifier)1