use of com.radixdlt.api.core.openapitools.model.ConstructionHashRequest in project radixdlt by radixdlt.
the class ConstructionHashHandlerTest method handling_construction_hash_should_return_hash.
@Test
public void handling_construction_hash_should_return_hash() throws Exception {
// Arrange
start();
// Act
var txn = Txn.create(Bytes.fromHexString("deadbeef"));
var request = new ConstructionHashRequest().networkIdentifier(new NetworkIdentifier().network("localnet")).signedTransaction("deadbeef");
var response = handleRequestWithExpectedResponse(sut, request, ConstructionHashResponse.class);
// Assert
assertThat(response.getTransactionIdentifier()).isEqualTo(coreModelMapper.transactionIdentifier(txn.getId()));
}
use of com.radixdlt.api.core.openapitools.model.ConstructionHashRequest in project radixdlt by radixdlt.
the class ConstructionHashHandlerTest method invalid_hex_should_throw.
@Test
public void invalid_hex_should_throw() throws Exception {
// Arrange
start();
// Act
var request = new ConstructionHashRequest().networkIdentifier(new NetworkIdentifier().network("localnet")).signedTransaction("this_is_not_hex");
var response = handleRequestWithExpectedResponse(sut, request, UnexpectedError.class);
// Assert
assertThat(response.getDetails()).isInstanceOf(InvalidHexError.class);
}
Aggregations