Skip to content

Commit

Permalink
refactored i128,u128,1256,u256
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfriend77 committed Nov 26, 2024
1 parent ee8d5eb commit cd27dbe
Show file tree
Hide file tree
Showing 10 changed files with 2,642 additions and 94 deletions.
7 changes: 4 additions & 3 deletions Substrate.NetApi.Test/TypeConverters/BaseTypesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using System.Numerics;

namespace Substrate.NetApi.Test
{
Expand Down Expand Up @@ -248,9 +249,9 @@ public void BaseComTest()
Assert.AreNotEqual(baseComFromValue.Value, new BaseCom<U64>(new CompactInteger(new U64(20))).Value);
Assert.AreEqual(baseComFromValue.TypeSize, new BaseCom<U64>(new CompactInteger(new U64(20))).TypeSize);

Assert.AreEqual(baseComFromValue.Bytes, new BaseCom<U128>(new CompactInteger(new U128(10))).Bytes);
Assert.AreEqual(baseComFromValue.Value, new BaseCom<U128>(new CompactInteger(new U128(10))).Value);
Assert.AreEqual(baseComFromValue.TypeSize, new BaseCom<U128>(new CompactInteger(new U128(10))).TypeSize);
Assert.AreEqual(baseComFromValue.Bytes, new BaseCom<U128>(new CompactInteger((U128) new BigInteger(10))).Bytes);
Assert.AreEqual(baseComFromValue.Value, new BaseCom<U128>(new CompactInteger((U128)new BigInteger(10))).Value);
Assert.AreEqual(baseComFromValue.TypeSize, new BaseCom<U128>(new CompactInteger((U128)new BigInteger(10))).TypeSize);

// Test explicit conversion from CompactInteger to BaseCom
var compactInt = new CompactInteger(new U64(10));
Expand Down
Loading

0 comments on commit cd27dbe

Please sign in to comment.