public void TxDeclarationTest() { var account1 = CreateAccount(); var account2 = CreateAccount(); var secret = Secret.GenerateSecret(); var declarations = new List <TxDeclaration>() { new MultiSignature(new [] { account1.Address, account2.Address }, 2), new HashLock(secret.ComputeSecretHash(SecretHashType.SHA3)), new TimeLock(123), new SecretRevelation(secret) }; var inputs = new List <TxInput>() { new TxInput(account1, Currency.BTC, Amount.FromWholeValue(10)), new TxInput(account2, Currency.LTC, Amount.FromWholeValue(30)), }; var outputs = new List <TxOutput>() { new TxOutput(account2, Currency.BTC, Amount.FromWholeValue(10)), new TxOutput(account1, Currency.LTC, Amount.FromWholeValue(30)), }; var transaction = new Transaction(declarations, inputs, outputs, TransactionMessage.Empty, DateTime.UtcNow.Ticks); var signed = new SignedTransaction(transaction); var readed = WriteRead <SignedTransaction, ByteStream>(stream => stream.Write(signed), stream => stream.ReadSignedTransaction()); Assert.IsTrue(signed.CompareSigned(readed)); }