Don't expose generic List and use IList instead
authorCryptoManiac <balthazar@yandex.ru>
Sat, 15 Aug 2015 12:52:21 +0000 (15:52 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Sat, 15 Aug 2015 12:52:21 +0000 (15:52 +0300)
Novacoin/Hash160.cs
Novacoin/Hash256.cs
Novacoin/ScriptOpcode.cs
Novacoin/WrappedList.cs

index a611e6c..eb4e9e4 100644 (file)
@@ -30,7 +30,7 @@ namespace Novacoin
         /// Initializes a new instance of Hash160 class with first 20 bytes from supplied list
         /// </summary>
         /// <param name="bytesList">List of bytes</param>
-        public Hash160(List<byte> bytesList)
+        public Hash160(IList<byte> bytesList)
         {
             hashBytes = bytesList.Take<byte>(hashSize).ToArray<byte>();
         }
index 8a4f983..6803ac1 100644 (file)
@@ -31,7 +31,7 @@ namespace Novacoin
         /// Initializes a new instance of Hash256 class with first 32 bytes from supplied list
         /// </summary>
         /// <param name="bytesList">List of bytes</param>
-        public Hash256(List<byte> bytesList)
+        public Hash256(IList<byte> bytesList)
         {
             hashBytes = bytesList.Take<byte>(hashSize).ToArray<byte>();
         }
index a56ddb5..0790c4c 100644 (file)
@@ -381,7 +381,7 @@ namespace Novacoin
                 case opcodetype.OP_CHECKMULTISIGVERIFY:
                     return "OP_CHECKMULTISIGVERIFY";
 
-                // expanson
+                // expansion
                 case opcodetype.OP_NOP1:
                     return "OP_NOP1";
                 case opcodetype.OP_NOP2:
@@ -512,7 +512,7 @@ namespace Novacoin
         /// </summary>
         /// <param name="bytesList">List of value bytes.</param>
         /// <returns>Formatted value.</returns>
-        public static string ValueString(List<byte> bytesList)
+        public static string ValueString(IList<byte> bytesList)
         {
             StringBuilder sb = new StringBuilder();
 
@@ -545,10 +545,10 @@ namespace Novacoin
         /// </summary>
         /// <param name="stackList">List of stack items.</param>
         /// <returns>Formatted value.</returns>
-        public static string StackString(List<List<byte>> stackList)
+        public static string StackString(IList<IList<byte>> stackList)
         {
             StringBuilder sb = new StringBuilder();
-            foreach(List<byte> bytesList in stackList)
+            foreach(IList<byte> bytesList in stackList)
             {
                 sb.Append(ValueString(bytesList));
             }
index 83a85bb..11d6756 100644 (file)
@@ -26,15 +26,15 @@ namespace Novacoin
     public class WrappedList<T>
     {
         private int Index;
-        private List<T> Elements;
+        private IList<T> Elements;
 
-        public WrappedList(List<T> List, int Start)
+        public WrappedList(IList<T> List, int Start)
         {
             Elements = List;
             Index = Start;
         }
 
-        public WrappedList(List<T> List)
+        public WrappedList(IList<T> List)
         {
             Elements = List;
             Index = 0;