public async Task Should_Announce_Aggregate_Transaction_Signed_Aggregate_Transaction()
        {
            var account = Account.GenerateNewAccount(Fixture.NetworkType);
            var mosaic  = NetworkCurrencyMosaic.CreateAbsolute(1);
            var message = PlainMessage.Create("c#__ SDK plain message test");
            var result  = await Fixture.AggregateTransfer(Fixture.SeedAccount, account.Address, mosaic, message, Fixture.GenerationHash);

            Log.WriteLine($"Transaction confirmed {result.TransactionInfo.Hash}");
            result.TransactionInfo.Hash.Should().NotBeNullOrWhiteSpace();
            result.TransactionType.Should().Be(EntityType.AGGREGATE_COMPLETE);
        }
        public async Task Should_Send_Money_From_Multsi_From_1To2_Cosignatory()
        {
            var recipient = Account.GenerateNewAccount(Fixture.NetworkType);

            Log.WriteLine($"MultiSig account {Fixture.MultiSigAccount}");
            Log.WriteLine($"Recipient account {recipient}");
            Log.WriteLine($"Cosignatory1 account {Fixture.Cosignatory1}");
            var transferTransaction = TransferTransaction.Create(
                Deadline.Create(),
                Recipient.From(recipient.Address),
                new List <Mosaic> {
                NetworkCurrencyMosaic.CreateAbsolute(10)
            },
                PlainMessage.Create("sending 10 prx.xpx"),
                Fixture.NetworkType);

            var aggregateTransaction = AggregateTransaction.CreateComplete(
                Deadline.Create(),
                new List <Transaction> {
                transferTransaction.ToAggregate(Fixture.MultiSigAccount.PublicAccount)
            },
                Fixture.NetworkType);

            var signedTransaction = Fixture.Cosignatory1.Sign(aggregateTransaction, Fixture.GenerationHash);

            var cosignatory1ConfirmedTx = Fixture.SiriusWebSocketClient.Listener
                                          .ConfirmedTransactionsGiven(Fixture.Cosignatory1.Address).Take(1)
                                          .Timeout(TimeSpan.FromSeconds(2000));

            Log.WriteLine($"Going to announce aggregate bonded transaction {signedTransaction.Hash}");
            await Fixture.SiriusClient.TransactionHttp.Announce(signedTransaction);

            var result = await cosignatory1ConfirmedTx;

            Thread.Sleep(5000);

            if (result.IsConfirmed())
            {
                var recipientAccountInfo = await Fixture.SiriusClient.AccountHttp.GetAccountInfo(recipient.Address);

                Log.WriteLine($"Recipient info {recipientAccountInfo.Address}");

                recipientAccountInfo.Mosaics.Should().HaveCount(1);
                recipientAccountInfo.Mosaics[0].Amount.Should().Be(10);
            }
        }
Exemplo n.º 3
0
        public void ShouldUploadWithTransactionMosaicsProvided()
        {
            var param = UploadParameter
                        .CreateForStringUpload(TestString, AccountPrivateKey1)
                        .WithTransactionMosaics(new List <Mosaic> {
                NetworkCurrencyMosaic.CreateAbsolute(2)
            })
                        .Build();

            var result = UnitUnderTest.Upload(param);

            var transaction = WaitForTransactionConfirmation(AccountPrivateKey1, result.TransactionHash);

            Assert.IsTrue(transaction is TransferTransaction);
            Assert.AreEqual((transaction as TransferTransaction).Mosaics.Count, 1);
            Assert.AreEqual((transaction as TransferTransaction).Mosaics[0].HexId, new MosaicId("0dc67fbe1cad29e3").HexId);
            Assert.AreEqual((transaction as TransferTransaction).Mosaics[0].Amount, (ulong)2);

            LogAndSaveResult(result, GetType().Name + ".ShouldUploadWithTransactionMosaicsProvided");
        }