Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move block-specific test transactions into subclasses

  • Loading branch information...
commit 54c04bda6435663844f69f24d9a82262c3247454 1 parent d6be1f6
@neoeinstein authored
View
4 xpdm.Bitcoin.Tests/Core/TransactionSignatureOperationsTest.cs
@@ -28,8 +28,8 @@ public IEnumerable<IDataItem> SignatureVerifyFactory
var sig = "3046022100f5746b0b254f5a37e75251459c7a23b6dfcb868ac7467edd9a6fdd1d969871be02210088948aea29b69161ca341c49c02686a81d8cbb73940f917fa0ed7154686d3e5b01";
var s = "OP_DUP OP_HASH160 02bf4b2889c6ada8190c252e70bde1a1909f9617 OP_EQUALVERIFY OP_CHECKSIG";
- yield return new DataRow(key, sig, s, new Transaction(Transactions.Block103958_Tx1_Serialized, 0), 0);
- yield return new DataRow(key, sig, s, Transactions.Block103958_Tx1, 0);
+ yield return new DataRow(key, sig, s, new Transaction(Transactions.Block103958.Tx1_Serialized, 0), 0);
+ yield return new DataRow(key, sig, s, Transactions.Block103958.Tx1, 0);
}
}
}
View
6 xpdm.Bitcoin.Tests/Factories/Core/Blocks.cs
@@ -26,9 +26,9 @@ public static class Blocks
Nonce = 3826166152,
Transactions =
{
- Transactions.Block103958_Tx0,
- Transactions.Block103958_Tx1,
- Transactions.Block103958_Tx2,
+ Transactions.Block103958.Tx0,
+ Transactions.Block103958.Tx1,
+ Transactions.Block103958.Tx2,
},
};
View
65 xpdm.Bitcoin.Tests/Factories/Core/Transactions.cs → ....Tests/Factories/Core/Transactions.Block103958.cs
@@ -2,15 +2,17 @@
namespace xpdm.Bitcoin.Tests.Factories.Core
{
- public static class Transactions
+ public static partial class Transactions
{
- public static readonly Hash256 Block103958_Tx0_Hash = Hash256.Parse("f2dedefe5222786abd6cb2223c89e50d590f234dbba69002d5ad5cd6e438abfd");
-
- public static readonly Transaction Block103958_Tx0 = new Transaction
+ public static class Block103958
{
- Version = 1,
- LockTime = 0,
- TransactionInputs =
+ public static readonly Hash256 Tx0_Hash = Hash256.Parse("f2dedefe5222786abd6cb2223c89e50d590f234dbba69002d5ad5cd6e438abfd");
+
+ public static readonly Transaction Tx0 = new Transaction
+ {
+ Version = 1,
+ LockTime = 0,
+ TransactionInputs =
{
new TransactionInput
{
@@ -19,7 +21,7 @@ public static class Transactions
SequenceNumber = uint.MaxValue,
},
},
- TransactionOutputs =
+ TransactionOutputs =
{
new TransactionOutput
{
@@ -27,15 +29,15 @@ public static class Transactions
Script = Script.Parse("044e65470b43854073a647bb88b337e1c4f0ea7553147805715674888a0030fe4c6dd5afec5317919fbab57cc3abfd11168ebdcce469acb5c1db345e8d79269302 OP_CHECKSIG"),
},
}
- };
+ };
- public static readonly Hash256 Block103958_Tx1_Hash = Hash256.Parse("ff954e099764d192c5bb531c9c14c18c230b0c0a63f02cd168a4ea94548c890f");
+ public static readonly Hash256 Tx1_Hash = Hash256.Parse("ff954e099764d192c5bb531c9c14c18c230b0c0a63f02cd168a4ea94548c890f");
- public static readonly Transaction Block103958_Tx1 = new Transaction
- {
- Version = 1,
- LockTime = 0,
- TransactionInputs =
+ public static readonly Transaction Tx1 = new Transaction
+ {
+ Version = 1,
+ LockTime = 0,
+ TransactionInputs =
{
new TransactionInput
{
@@ -68,7 +70,7 @@ public static class Transactions
SequenceNumber = uint.MaxValue,
},
},
- TransactionOutputs =
+ TransactionOutputs =
{
new TransactionOutput
{
@@ -76,9 +78,9 @@ public static class Transactions
Script = Script.Parse("OP_DUP OP_HASH160 9e35d93c7792bdcaad5697ddebf04353d9a5e196 OP_EQUALVERIFY OP_CHECKSIG"),
},
}
- };
+ };
- public static readonly byte[] Block103958_Tx1_Serialized = new byte[] {
+ public static readonly byte[] Tx1_Serialized = new byte[] {
0x01, 0x00, 0x00, 0x00, 0x03, 0x30, 0xf3, 0x70, 0x1f, 0x9b, 0xc4, 0x64, 0x55, 0x2f, 0x70, 0x49,
0x57, 0x91, 0x04, 0x08, 0x17, 0xce, 0x77, 0x7a, 0xd5, 0xed, 0xe1, 0x6e, 0x52, 0x9f, 0xcd, 0x0c,
0x0e, 0x94, 0x91, 0x56, 0x94, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00,
@@ -109,13 +111,13 @@ public static class Transactions
0x77, 0x92, 0xbd, 0xca, 0xad, 0x56, 0x97, 0xdd, 0xeb, 0xf0, 0x43, 0x53, 0xd9, 0xa5, 0xe1, 0x96,
0x88, 0xac, 0x00, 0x00, 0x00, 0x00 };
- public static readonly Hash256 Block103958_Tx2_Hash = Hash256.Parse("69ea9cf5e3e116cffe595d16b3258cd3508768fe3a1ce087ed8479f3d78ef91a");
+ public static readonly Hash256 Tx2_Hash = Hash256.Parse("69ea9cf5e3e116cffe595d16b3258cd3508768fe3a1ce087ed8479f3d78ef91a");
- public static readonly Transaction Block103958_Tx2 = new Transaction
- {
- Version = 1,
- LockTime = 0,
- TransactionInputs =
+ public static readonly Transaction Tx2 = new Transaction
+ {
+ Version = 1,
+ LockTime = 0,
+ TransactionInputs =
{
new TransactionInput
{
@@ -128,7 +130,7 @@ public static class Transactions
SequenceNumber = uint.MaxValue,
},
},
- TransactionOutputs =
+ TransactionOutputs =
{
new TransactionOutput
{
@@ -141,13 +143,14 @@ public static class Transactions
Script = Script.Parse("OP_DUP OP_HASH160 7fefa10049b41709fc930fb6582c8a1236ad15eb OP_EQUALVERIFY OP_CHECKSIG"),
},
}
- };
+ };
- static Transactions()
- {
- Block103958_Tx0.Freeze();
- Block103958_Tx1.Freeze();
- Block103958_Tx2.Freeze();
+ static Block103958()
+ {
+ Tx0.Freeze();
+ Tx1.Freeze();
+ Tx2.Freeze();
+ }
}
}
}
View
4 xpdm.Bitcoin.Tests/Scripting/ExecutionContextTest.cs
@@ -36,9 +36,9 @@ public static IEnumerable<IDataItem> ScriptTransactionTuples
{
yield return
new DataRow(
- Transactions.Block103958_Tx1.TransactionInputs[0].Script,
+ Transactions.Block103958.Tx1.TransactionInputs[0].Script,
"OP_DUP OP_HASH160 02bf4b2889c6ada8190c252e70bde1a1909f9617 OP_EQUALVERIFY OP_CHECKSIG",
- Transactions.Block103958_Tx1,
+ Transactions.Block103958.Tx1,
0);
}
}
View
2  xpdm.Bitcoin.Tests/xpdm.Bitcoin.Tests.csproj
@@ -76,7 +76,7 @@
<Compile Include="Factories\Core\Hash160Factory.cs" />
<Compile Include="Factories\Core\Hash256Factory.cs" />
<Compile Include="Factories\Core\TransactionOutpointFactory.cs" />
- <Compile Include="Factories\Core\Transactions.cs" />
+ <Compile Include="Factories\Core\Transactions.Block103958.cs" />
<Compile Include="Formatters\ByteArrayFormatter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Scripting\ExecutionContextTest.cs" />
Please sign in to comment.
Something went wrong with that request. Please try again.