Add SmartCoin
MODIFY
MagicalCryptoWallet.Tests/RegTests.cs
MagicalCryptoWallet.Tests/RegTests.cs
@@ -364,8 +364,7 @@ namespace MagicalCryptoWallet.Tests
node.VersionHandshake(); // Start mempool service.
indexDownloader.Syncronize(requestInterval: TimeSpan.FromSeconds(3)); // Start index downloader service.
-
-
+ // ToDo: Write the actual tests here.
}
finally
{

MODIFY
MagicalCryptoWallet/Converters/HeightConverter.cs
MagicalCryptoWallet/Converters/HeightConverter.cs
@@ -17,7 +17,7 @@ namespace MagicalCryptoWallet.Converters
/// <inheritdoc />
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
- var value = ((long)reader.Value);
+ var value = long.Parse(reader.Value.ToString());
return new Height((int)value);
}

DELETE
MagicalCryptoWallet/Extensions/FastBitArrayExtensions.cs
-namespace NBitcoin
-{
- public static class FastBitArrayExtensions
- {
- public static byte[] ToByteArray(this FastBitArray me)
- {
- var byteCount = me.Length==0 ? 0 : (me.Length-1)/ 8 + 1;
- var bytes = new byte[byteCount];
- me.CopyTo(bytes, 0);
- return bytes;
- }
- }
-}
\ No newline at end of file

ADD
MagicalCryptoWallet/Extensions/NBitcoinExtensions.cs
+using MagicalCryptoWallet.Models;
+using System.Collections.Generic;
+
+namespace NBitcoin
+{
+ public static class NBitcoinExtensions
+ {
+ public static byte[] ToByteArray(this FastBitArray me)
+ {
+ var byteCount = me.Length==0 ? 0 : (me.Length-1)/ 8 + 1;
+ var bytes = new byte[byteCount];
+ me.CopyTo(bytes, 0);
+ return bytes;
+ }
+
+ public static TxoRef ToTxoRef(this OutPoint me) => new TxoRef(me);
+
+ public static IEnumerable<TxoRef> ToTxoRefs(this TxInList me)
+ {
+ foreach (var input in me)
+ {
+ yield return input.PrevOut.ToTxoRef();
+ }
+ }
+ }
+}
\ No newline at end of file

MODIFY
MagicalCryptoWallet/Models/SmartTransaction.cs
MagicalCryptoWallet/Models/SmartTransaction.cs
@@ -55,7 +55,6 @@ namespace MagicalCryptoWallet.Models
{
bool rc = false;
-
if (obj is SmartTransaction st)
{
rc = GetHash().Equals(st.GetHash());

Add SmartCoin