Exemplo n.º 1
0
        public void ShouldNotSendTransfer()
        {
            try
            {
                List <Transfer> transfers = new List <Transfer>
                {
                    // Address is spent
                    new Transfer(TEST_ADDRESS_WITH_CHECKSUM_SECURITY_LEVEL_2, 2, TEST_MESSAGE, TEST_TAG)
                };

                _iotaApi.SendTransfer(TEST_SEED1, 2, DEPTH, MIN_WEIGHT_MAGNITUDE_DEV, transfers.ToArray(), null, null,
                                      false, true,
                                      null);
                Assert.Fail("Transaction did not fail on spent address");
            }
            catch (ArgumentException e)
            {
                Assert.AreEqual(Constants.SENDING_TO_USED_ADDRESS_ERROR, e.Message,
                                "Message should say we try to use a used address");
            }
        }
Exemplo n.º 2
0
        public void ShouldSendTransfer()
        {
            Transfer[] transfers =
            {
                new Transfer(TEST_ADDRESS_WITH_CHECKSUM_SECURITY_LEVEL_2, 0, TEST_MESSAGE, TEST_TAG)
            };

            SendTransferResponse str =
                _iotaApi.SendTransfer(
                    TEST_SEED1, 2, DEPTH, MIN_WEIGHT_MAGNITUDE, transfers,
                    null, null, false, false, null);

            Assert.IsNotNull(str.Results);
        }