Search in sources :

Example 1 with AnnounceTransactionInfoDTO

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());
}
Also used : Account(io.nem.symbol.sdk.model.account.Account) PublicAccount(io.nem.symbol.sdk.model.account.PublicAccount) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) BigInteger(java.math.BigInteger) AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) TransactionAnnounceResponse(io.nem.symbol.sdk.model.transaction.TransactionAnnounceResponse) Cosignature(io.nem.symbol.sdk.openapi.vertx.model.Cosignature) AggregateTransactionCosignature(io.nem.symbol.sdk.model.transaction.AggregateTransactionCosignature) Test(org.junit.jupiter.api.Test)

Example 2 with AnnounceTransactionInfoDTO

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());
}
Also used : AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) TransactionAnnounceResponse(io.nem.symbol.sdk.model.transaction.TransactionAnnounceResponse) SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) Test(org.junit.jupiter.api.Test)

Example 3 with AnnounceTransactionInfoDTO

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());
}
Also used : AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) TransactionAnnounceResponse(io.nem.symbol.sdk.model.transaction.TransactionAnnounceResponse) SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) Test(org.junit.jupiter.api.Test)

Aggregations

CosignatureSignedTransaction (io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction)3 TransactionAnnounceResponse (io.nem.symbol.sdk.model.transaction.TransactionAnnounceResponse)3 AnnounceTransactionInfoDTO (io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO)3 Test (org.junit.jupiter.api.Test)3 SignedTransaction (io.nem.symbol.sdk.model.transaction.SignedTransaction)2 Account (io.nem.symbol.sdk.model.account.Account)1 PublicAccount (io.nem.symbol.sdk.model.account.PublicAccount)1 AggregateTransactionCosignature (io.nem.symbol.sdk.model.transaction.AggregateTransactionCosignature)1 Cosignature (io.nem.symbol.sdk.openapi.vertx.model.Cosignature)1 BigInteger (java.math.BigInteger)1