use of io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionRepositoryVertxImplTest method announceAggregateBondedCosignature.
@Test
public void announceAggregateBondedCosignature() throws Exception {
Account signer = Account.generateNewAccount(networkType);
BigInteger version = AggregateTransactionCosignature.DEFAULT_VERSION;
CosignatureSignedTransaction signedTransaction = new CosignatureSignedTransaction(version, "aParentHash", "aSignature", signer.getPublicAccount());
AnnounceTransactionInfoDTO announceTransactionInfoDTO = new AnnounceTransactionInfoDTO();
announceTransactionInfoDTO.setMessage("SomeMessage");
ArgumentCaptor<Object> parameter = mockRemoteCall(announceTransactionInfoDTO);
TransactionAnnounceResponse response = repository.announceAggregateBondedCosignature(signedTransaction).toFuture().get();
Assertions.assertNotNull(response);
Assertions.assertEquals(announceTransactionInfoDTO.getMessage(), announceTransactionInfoDTO.getMessage());
Cosignature cosignature = (Cosignature) parameter.getValue();
Assertions.assertEquals(signedTransaction.getParentHash(), cosignature.getParentHash());
Assertions.assertEquals(signedTransaction.getSignature(), cosignature.getSignature());
Assertions.assertEquals(signedTransaction.getSigner().getPublicKey().toHex(), cosignature.getSignerPublicKey());
Assertions.assertEquals(signedTransaction.getVersion(), cosignature.getVersion());
}
use of io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionRepositoryVertxImplTest method shouldAnnounce.
@Test
public void shouldAnnounce() throws Exception {
SignedTransaction signedTransaction = getSignedTransaction();
AnnounceTransactionInfoDTO announceTransactionInfoDTO = new AnnounceTransactionInfoDTO();
announceTransactionInfoDTO.setMessage("SomeMessage");
mockRemoteCall(announceTransactionInfoDTO);
TransactionAnnounceResponse response = repository.announce(signedTransaction).toFuture().get();
Assertions.assertNotNull(response);
Assertions.assertEquals(announceTransactionInfoDTO.getMessage(), announceTransactionInfoDTO.getMessage());
}
use of io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionRepositoryVertxImplTest method shouldAnnounceAggregateBonded.
@Test
public void shouldAnnounceAggregateBonded() throws Exception {
SignedTransaction signedTransaction = getSignedTransaction();
AnnounceTransactionInfoDTO announceTransactionInfoDTO = new AnnounceTransactionInfoDTO();
announceTransactionInfoDTO.setMessage("SomeMessage");
mockRemoteCall(announceTransactionInfoDTO);
TransactionAnnounceResponse response = repository.announceAggregateBonded(signedTransaction).toFuture().get();
Assertions.assertNotNull(response);
Assertions.assertEquals(announceTransactionInfoDTO.getMessage(), announceTransactionInfoDTO.getMessage());
}
Aggregations