private static void SendToChain(string address, RestIotaRepository repository, string message) { Seed seed = new Seed(address); Transfer transfer = new Transfer { Address = new Address(address), Message = TryteString.FromUtf8String(message), ValueToTransfer = 0 }; Bundle bundle = new Bundle(); bundle.AddTransfer(transfer); int depth = 3; int minWeightMagnitude = 9; try { var sendTransfer = repository.SendTransfer(seed, bundle, SecurityLevel.Medium, depth, minWeightMagnitude); //TransactionHashList bundleTransactions = repository.FindTransactionsByBundles(new List<Hash> {bundle.Hash}); //foreach (Hash transactionsHash in bundleTransactions.Hashes) //{ // Hash hash = new Hash(transactionsHash.Value); // var transactionsTrytes = repository.GetTrytes(bundleTransactions.Hashes); // var transaction = Transaction.FromTrytes(transactionsTrytes[0], hash); //} TransactionHashList transactionsByAdress = repository.FindTransactionsByAddresses(new List <Address> { new Address(address) }); var transactionsTrytesAddress = repository.GetTrytes(transactionsByAdress.Hashes).First(); Hash hashAddress = new Hash(transactionsByAdress.Hashes[0].Value); Transaction transactionOne = Transaction.FromTrytes(transactionsTrytesAddress, hashAddress); TransactionTrytes transactionTrytes = new TransactionTrytes(""); TransactionTrytes test = transactionOne.ToTrytes(); var text = test.Value; } catch (Exception exception) { Console.WriteLine(exception); //throw; } }
public void TestTryteLengthIsLowerThanTransactionTryteLengthShouldPad() { var transactionTrytes = new TransactionTrytes("JKAHKJASH"); Assert.AreEqual(TransactionTrytes.Length, transactionTrytes.TrytesLength); }
public void TestTryteLengthIsBiggerThanTransactionTryteLengthShouldThrowException() { var transactionTrytes = new TransactionTrytes(string.Concat(Enumerable.Repeat("9", TransactionTrytes.Length + 1))); }