public void TestCalculateTransactionHash()
{
var expectedHash = UInt256.ParseHex("4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b");
var tx = Transaction.Create
(
version: 1,
inputs: ImmutableArray.Create(
new TxInput
(
prevTxHash: UInt256.Zero,
prevTxOutputIndex: 4294967295,
scriptSignature: "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73".HexToByteArray().ToImmutableArray(),
sequence: 4294967295
)),
outputs: ImmutableArray.Create(
new TxOutput
(
value: (UInt64)(50L * 100.MILLION()),
scriptPublicKey: "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac".HexToByteArray().ToImmutableArray()
)),
lockTime: 0
).Transaction;
Assert.AreEqual(expectedHash, tx.Hash);
}
}