public void ShouldSendTransferWithInputs() { List <Input> inputList = new List <Input>(); List <Transfer> transfers = new List <Transfer>(); GetBalancesAndFormatResponse rsp = _iotaApi.GetInputs(TEST_SEED3, 2, 0, 0, 1); //TODO(guojiancong): rep.Inputs.Count == 0 ??? inputList.AddRange(rsp.Inputs); AddressRequest addressRequest = new AddressRequest(TEST_SEED3, 2) { Checksum = true }; string address = _iotaApi.GenerateNewAddresses(addressRequest).Addresses[0]; transfers.Add(new Transfer(address, 1, TEST_MESSAGE, TEST_TAG)); // validate Inputs to true would mean we have to spent all balance in once. Now we double spent but its devnet SendTransferResponse str = _iotaApi.SendTransfer(TEST_SEED3, 2, DEPTH_DEV, MIN_WEIGHT_MAGNITUDE_DEV, transfers.ToArray(), inputList.ToArray(), null, false, true, null); Assert.IsNotNull(str.Results, "Sending transfer should have returned multiple transactions"); }
public void ShouldPrepareTransferWithInputs() { List <Transfer> transfers = new List <Transfer>(); GetBalancesAndFormatResponse rsp = _iotaApi.GetInputs(TEST_SEED1, 2, 0, 10, 0); List <Input> inputList = new List <Input>(rsp.Inputs); transfers.Add(new Transfer(TEST_ADDRESS_WITH_CHECKSUM_SECURITY_LEVEL_2, 1, TEST_MESSAGE, TEST_TAG)); List <string> trytes = _iotaApi.PrepareTransfers(TEST_SEED1, 2, transfers.ToArray(), null, inputList.ToArray(), null, true); Assert.IsNotNull(trytes, "prepareTransfers should throw an error on failure"); Assert.IsFalse(trytes.Count == 0, "prepareTransfers should throw an error on failure"); Transaction first = new Transaction(trytes[0]); Assert.AreEqual(first.LastIndex, first.CurrentIndex, "prepareTransfers should have reversed bundle order for attachToTangle"); }