Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charge for size and witnesses #791

Merged
merged 63 commits into from
Jun 23, 2019
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
dd427c7
Fee= VerificationCost+ApplicationCost
shargon May 29, 2019
fe9a505
NetworkFee for verification
shargon May 30, 2019
7cda593
Clean
shargon May 30, 2019
d690f7b
Clean
shargon May 30, 2019
481f182
Merge branch 'master' into tx-fee
shargon May 30, 2019
1a1247a
Update
shargon May 31, 2019
72ad07a
Merge branch 'master' into tx-fee
shargon Jun 1, 2019
c0675d0
Remove priority from Policy and MemoryPool
shargon Jun 2, 2019
e8cc7a6
Fix CalculateFee
shargon Jun 3, 2019
a3775cb
Allow to cancel transactions with more Gas
shargon Jun 3, 2019
408b836
Merge branch 'master' into tx-fee
shargon Jun 6, 2019
d08d311
Revert change
shargon Jun 6, 2019
fa51de3
Add Cosigners
shargon Jun 6, 2019
777b479
some fixes
erikzhang Jun 10, 2019
8a5a56f
Merge pull request #12 from shargon/add-cosigners
shargon Jun 11, 2019
355d521
Merge branch 'master' into tx-fee
shargon Jun 11, 2019
c62898c
Merge branch 'master' into tx-fee
vncoelho Jun 11, 2019
685e9f3
Merge branch 'master' into tx-fee
vncoelho Jun 11, 2019
555d370
Merge branch 'master' into tx-fee
shargon Jun 12, 2019
1eeaa2a
Merge branch 'master' into tx-fee
erikzhang Jun 13, 2019
7dda436
Update Transaction.cs
shargon Jun 13, 2019
838a72b
format
erikzhang Jun 13, 2019
57a70b8
fix overflow
erikzhang Jun 13, 2019
cba0157
Merge branch 'master' into tx-fee
igormcoelho Jun 14, 2019
d483153
Merge branch 'master' into tx-fee
shargon Jun 15, 2019
43e61e7
fix `Wallet.MakeTransaction()`
erikzhang Jun 15, 2019
206876e
fix `Transaction.CalculateFees()`
erikzhang Jun 15, 2019
6d0dad2
remove contract get from verification
igormcoelho Jun 15, 2019
37c668d
Revert "remove contract get from verification"
erikzhang Jun 16, 2019
945d9ff
Merge branch 'master' into tx-fee
shargon Jun 17, 2019
d10b452
Fix fee calculation
erikzhang Jun 19, 2019
267e22a
Merge branch 'master' into tx-fee
erikzhang Jun 19, 2019
9e9dafb
fix
erikzhang Jun 19, 2019
fb764e7
fix tests
erikzhang Jun 19, 2019
c0022c9
Update MemoryPool.cs
erikzhang Jun 19, 2019
bcb765d
fix tests
erikzhang Jun 19, 2019
00ada69
Merge branch 'master' into tx-fee
shargon Jun 20, 2019
1021dd6
UT - Good calculation!
shargon Jun 20, 2019
6eb94ef
Merge branch 'master' into tx-fee
shargon Jun 20, 2019
ae38243
Clean
shargon Jun 20, 2019
1b0a2df
Revert Nep5Token.cs
erikzhang Jun 20, 2019
071cee5
Revert conditional
shargon Jun 20, 2019
cd61b98
Improve readability
shargon Jun 20, 2019
5840174
Revert "Improve readability"
shargon Jun 20, 2019
7fc2809
Possible fix for unit test
shargon Jun 20, 2019
72782c7
Error verbosity
shargon Jun 20, 2019
3121228
Add using for ApplicationEngine
shargon Jun 20, 2019
85527bf
Fix unit test
shargon Jun 20, 2019
b2a638d
more readable merkleroot test
igormcoelho Jun 20, 2019
9ac9412
Sample for multisig contract
shargon Jun 21, 2019
1ce9d16
Sign ut
shargon Jun 21, 2019
9179080
Signed!
shargon Jun 21, 2019
1f36f84
Same format for single signature unit test
shargon Jun 21, 2019
fc3e729
Prevent create unwanted objects
shargon Jun 21, 2019
e484fbe
format
erikzhang Jun 21, 2019
5bbfd02
Remove `snapshot` from `MakeTransaction()`
erikzhang Jun 21, 2019
63f24fc
Rename
erikzhang Jun 21, 2019
ff1d71e
format
erikzhang Jun 21, 2019
13ae9a1
Merge branch 'master' into tx-fee
igormcoelho Jun 21, 2019
70ccc77
using json based NEP6Wallet import
igormcoelho Jun 21, 2019
dd39152
at least using read serializable array
igormcoelho Jun 21, 2019
ccad415
revert last commit
igormcoelho Jun 21, 2019
5c1db4e
Merge branch 'master' into tx-fee
erikzhang Jun 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions neo.UnitTests/Extensions/Nep5NativeContractExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,26 @@ public static class Nep5NativeContractExtensions
{
internal class ManualWitness : IVerifiable
{
private readonly UInt160 _hashForVerify;
private readonly UInt160[] _hashForVerify;

public Witness Witness
public Witness[] Witnesses
{
get => throw new NotImplementedException();
set => throw new NotImplementedException();
}

public int Size => 0;

public ManualWitness(UInt160 hashForVerify)
public ManualWitness(params UInt160[] hashForVerify)
{
_hashForVerify = hashForVerify;
_hashForVerify = hashForVerify ?? new UInt160[0];
}

public void Deserialize(BinaryReader reader) { }

public void DeserializeUnsigned(BinaryReader reader) { }

public UInt160 GetScriptHashForVerification(Persistence.Snapshot snapshot)
{
return _hashForVerify;
}
public UInt160[] GetScriptHashesForVerifying(Persistence.Snapshot snapshot) => _hashForVerify;

public void Serialize(BinaryWriter writer) { }

Expand Down
16 changes: 10 additions & 6 deletions neo.UnitTests/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public static Transaction GetTransaction()
Script = new byte[1],
Sender = UInt160.Zero,
Attributes = new TransactionAttribute[0],
Witness = new Witness
Witnesses = new Witness[]{ new Witness
{
InvocationScript = new byte[0],
VerificationScript = new byte[0]
}
} }
};
}

Expand Down Expand Up @@ -61,7 +61,8 @@ public static void SetupBlockWithValues(Block block, UInt256 val256, out UInt256
private static void setupBlockBaseWithValues(BlockBase bb, UInt256 val256, out UInt256 merkRootVal, out UInt160 val160, out uint timestampVal, out uint indexVal, out Witness scriptVal)
{
bb.PrevHash = val256;
merkRootVal = new UInt256(new byte[] { 242, 128, 130, 9, 63, 13, 149, 96, 141, 161, 52, 196, 148, 141, 241, 126, 172, 102, 108, 194, 91, 50, 128, 91, 64, 116, 127, 40, 58, 171, 158, 197 });
merkRootVal = UInt256.Parse("0xd841af3d6bd7adb4bca24306725f9aec363edb10de3cafc5f8cca948d7b0290f");

bb.MerkleRoot = merkRootVal;
timestampVal = new DateTime(1968, 06, 01, 0, 0, 0, DateTimeKind.Utc).ToTimestamp();
bb.Timestamp = timestampVal;
Expand All @@ -86,10 +87,13 @@ public static Transaction CreateRandomHashTransaction()
Script = randomBytes,
Sender = UInt160.Zero,
Attributes = new TransactionAttribute[0],
Witness = new Witness
Witnesses = new[]
{
InvocationScript = new byte[0],
VerificationScript = new byte[0]
new Witness
{
InvocationScript = new byte[0],
VerificationScript = new byte[0]
}
}
};
}
Expand Down
12 changes: 8 additions & 4 deletions neo.UnitTests/TestVerifiable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ namespace Neo.UnitTests
{
public class TestVerifiable : IVerifiable
{
private string testStr = "testStr";
private readonly string testStr = "testStr";

public Witness Witness { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public Witness[] Witnesses
{
get => throw new NotImplementedException();
set => throw new NotImplementedException();
}

public int Size => throw new NotImplementedException();

Expand All @@ -23,7 +27,7 @@ public void DeserializeUnsigned(BinaryReader reader)
throw new NotImplementedException();
}

public UInt160 GetScriptHashForVerification(Snapshot snapshot)
public UInt160[] GetScriptHashesForVerifying(Snapshot snapshot)
{
throw new NotImplementedException();
}
Expand All @@ -35,7 +39,7 @@ public void Serialize(BinaryWriter writer)

public void SerializeUnsigned(BinaryWriter writer)
{
writer.Write((string) testStr);
writer.Write((string)testStr);
}
}
}
66 changes: 18 additions & 48 deletions neo.UnitTests/UT_Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ public void Transactions_Get()
public void Header_Get()
{
UInt256 val256 = UInt256.Zero;
UInt256 merkRootVal;
UInt160 val160;
uint timestampVal, indexVal;
Witness scriptVal;
Transaction[] transactionsVal;
TestUtils.SetupBlockWithValues(uut, val256, out merkRootVal, out val160, out timestampVal, out indexVal, out scriptVal, out transactionsVal, 0);
TestUtils.SetupBlockWithValues(uut, val256, out var merkRootVal, out var val160, out var timestampVal, out var indexVal, out var scriptVal, out var transactionsVal, 0);

uut.Header.Should().NotBeNull();
uut.Header.PrevHash.Should().Be(val256);
Expand All @@ -47,46 +42,31 @@ public void Header_Get()
public void Size_Get()
{
UInt256 val256 = UInt256.Zero;
UInt256 merkRootVal;
UInt160 val160;
uint timestampVal, indexVal;
Witness scriptVal;
Transaction[] transactionsVal;
TestUtils.SetupBlockWithValues(uut, val256, out merkRootVal, out val160, out timestampVal, out indexVal, out scriptVal, out transactionsVal, 0);
// blockbase 4 + 32 + 32 + 4 + 4 + 20 + 3
TestUtils.SetupBlockWithValues(uut, val256, out var _, out var _, out var _, out var _, out var _, out var _, 0);
// blockbase 4 + 32 + 32 + 4 + 4 + 20 + 4
// block 9 + 1
uut.Size.Should().Be(109);
uut.Size.Should().Be(110);
}

[TestMethod]
public void Size_Get_1_Transaction()
{
UInt256 val256 = UInt256.Zero;
UInt256 merkRootVal;
UInt160 val160;
uint timestampVal, indexVal;
Witness scriptVal;
Transaction[] transactionsVal;
TestUtils.SetupBlockWithValues(uut, val256, out merkRootVal, out val160, out timestampVal, out indexVal, out scriptVal, out transactionsVal, 0);
TestUtils.SetupBlockWithValues(uut, val256, out var _, out var _, out var _, out var _, out var _, out var _, 0);

uut.Transactions = new[]
{
TestUtils.GetTransaction()
};

uut.Size.Should().Be(159);
uut.Size.Should().Be(161);
}

[TestMethod]
public void Size_Get_3_Transaction()
{
UInt256 val256 = UInt256.Zero;
UInt256 merkRootVal;
UInt160 val160;
uint timestampVal, indexVal;
Witness scriptVal;
Transaction[] transactionsVal;
TestUtils.SetupBlockWithValues(uut, val256, out merkRootVal, out val160, out timestampVal, out indexVal, out scriptVal, out transactionsVal, 0);
TestUtils.SetupBlockWithValues(uut, val256, out var _, out var _, out var _, out var _, out var _, out var _, 0);

uut.Transactions = new[]
{
Expand All @@ -95,19 +75,14 @@ public void Size_Get_3_Transaction()
TestUtils.GetTransaction()
};

uut.Size.Should().Be(259);
uut.Size.Should().Be(263);
}

[TestMethod]
public void Serialize()
{
UInt256 val256 = UInt256.Zero;
UInt256 merkRootVal;
UInt160 val160;
uint timestampVal, indexVal;
Witness scriptVal;
Transaction[] transactionsVal;
TestUtils.SetupBlockWithValues(uut, val256, out merkRootVal, out val160, out timestampVal, out indexVal, out scriptVal, out transactionsVal, 1);
TestUtils.SetupBlockWithValues(uut, val256, out var _, out var _, out var _, out var _, out var _, out var _, 1);

byte[] data;
using (MemoryStream stream = new MemoryStream())
Expand All @@ -119,7 +94,7 @@ public void Serialize()
}
}

byte[] requiredData = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 128, 130, 9, 63, 13, 149, 96, 141, 161, 52, 196, 148, 141, 241, 126, 172, 102, 108, 194, 91, 50, 128, 91, 64, 116, 127, 40, 58, 171, 158, 197, 128, 171, 4, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 81, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
byte[] requiredData = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 41, 176, 215, 72, 169, 204, 248, 197, 175, 60, 222, 16, 219, 62, 54, 236, 154, 95, 114, 6, 67, 162, 188, 180, 173, 215, 107, 61, 175, 65, 216, 128, 171, 4, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 81, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0 };

data.Length.Should().Be(requiredData.Length);
for (int i = 0; i < data.Length; i++)
Expand All @@ -132,16 +107,11 @@ public void Serialize()
public void Deserialize()
{
UInt256 val256 = UInt256.Zero;
UInt256 merkRoot;
UInt160 val160;
uint timestampVal, indexVal;
Witness scriptVal;
Transaction[] transactionsVal;
TestUtils.SetupBlockWithValues(new Block(), val256, out merkRoot, out val160, out timestampVal, out indexVal, out scriptVal, out transactionsVal, 1);
TestUtils.SetupBlockWithValues(new Block(), val256, out var merkRoot, out var val160, out var timestampVal, out var indexVal, out var scriptVal, out var transactionsVal, 1);

uut.MerkleRoot = merkRoot; // need to set for deserialise to be valid

byte[] data = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 128, 130, 9, 63, 13, 149, 96, 141, 161, 52, 196, 148, 141, 241, 126, 172, 102, 108, 194, 91, 50, 128, 91, 64, 116, 127, 40, 58, 171, 158, 197, 128, 171, 4, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 81, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
byte[] data = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 41, 176, 215, 72, 169, 204, 248, 197, 175, 60, 222, 16, 219, 62, 54, 236, 154, 95, 114, 6, 67, 162, 188, 180, 173, 215, 107, 61, 175, 65, 216, 128, 171, 4, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 81, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 };
int index = 0;
using (MemoryStream ms = new MemoryStream(data, index, data.Length - index, false))
{
Expand Down Expand Up @@ -244,23 +214,23 @@ public void ToJson()

JObject jObj = uut.ToJson();
jObj.Should().NotBeNull();
jObj["hash"].AsString().Should().Be("0xe0b482b6e4c176c9af520dd7caa6d80a9aeaeb80d016e788c702b05f5ac5ba4b");
jObj["size"].AsNumber().Should().Be(159);
jObj["hash"].AsString().Should().Be("0x1d8642796276c8ce3c5c03b8984a1b593d99b49a63d830bb06f800b8c953be77");
jObj["size"].AsNumber().Should().Be(161);
jObj["version"].AsNumber().Should().Be(0);
jObj["previousblockhash"].AsString().Should().Be("0x0000000000000000000000000000000000000000000000000000000000000000");
jObj["merkleroot"].AsString().Should().Be("0xc59eab3a287f74405b80325bc26c66ac7ef18d94c434a18d60950d3f098280f2");
jObj["merkleroot"].AsString().Should().Be("0xd841af3d6bd7adb4bca24306725f9aec363edb10de3cafc5f8cca948d7b0290f");
jObj["time"].AsNumber().Should().Be(4244941696);
jObj["index"].AsNumber().Should().Be(0);
jObj["nextconsensus"].AsString().Should().Be("AFmseVrdL9f9oyCzZefL9tG6UbvhPbdYzM");

JObject scObj = jObj["witness"];
JObject scObj = ((JArray)jObj["witnesses"])[0];
scObj["invocation"].AsString().Should().Be("");
scObj["verification"].AsString().Should().Be("51");

jObj["tx"].Should().NotBeNull();
JArray txObj = (JArray)jObj["tx"];
txObj[0]["hash"].AsString().Should().Be("0x7647acf1ef8a841b87f2369398a0e9f0ccde0ed9e835d980657103da6da59580");
txObj[0]["size"].AsNumber().Should().Be(50);
txObj[0]["hash"].AsString().Should().Be("0x64ed4e0d79407c60bde534feb44fbbd19bd065282d27ecd3a1a7a647f66affa6");
txObj[0]["size"].AsNumber().Should().Be(51);
txObj[0]["version"].AsNumber().Should().Be(0);
((JArray)txObj[0]["attributes"]).Count.Should().Be(0);
txObj[0]["net_fee"].AsString().Should().Be("0");
Expand Down
2 changes: 1 addition & 1 deletion neo.UnitTests/UT_Consensus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void ConsensusService_Primary_Sends_PrepareRequest_After_OnStart()
// Creating proposed block
Header header = new Header();
TestUtils.SetupHeaderWithValues(header, UInt256.Zero, out UInt256 merkRootVal, out UInt160 val160, out uint timestampVal, out uint indexVal, out Witness scriptVal);
header.Size.Should().Be(100);
header.Size.Should().Be(101);

Console.WriteLine($"header {header} hash {header.Hash} timstamp {timestampVal}");

Expand Down
8 changes: 4 additions & 4 deletions neo.UnitTests/UT_Header.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public void Size_Get()
{
UInt256 val256 = UInt256.Zero;
TestUtils.SetupHeaderWithValues(uut, val256, out _, out _, out _, out _, out _);
// blockbase 4 + 32 + 32 + 4 + 4 + 20 + 3
// blockbase 4 + 32 + 32 + 4 + 4 + 20 + 4
// header 1
uut.Size.Should().Be(100);
uut.Size.Should().Be(101);
}

[TestMethod]
Expand All @@ -35,7 +35,7 @@ public void Deserialize()

uut.MerkleRoot = merkRoot; // need to set for deserialise to be valid

byte[] data = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 128, 130, 9, 63, 13, 149, 96, 141, 161, 52, 196, 148, 141, 241, 126, 172, 102, 108, 194, 91, 50, 128, 91, 64, 116, 127, 40, 58, 171, 158, 197, 128, 171, 4, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 81, 0 };
byte[] data = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 41, 176, 215, 72, 169, 204, 248, 197, 175, 60, 222, 16, 219, 62, 54, 236, 154, 95, 114, 6, 67, 162, 188, 180, 173, 215, 107, 61, 175, 65, 216, 128, 171, 4, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 81, 0 };
int index = 0;
using (MemoryStream ms = new MemoryStream(data, index, data.Length - index, false))
{
Expand Down Expand Up @@ -106,7 +106,7 @@ public void Serialize()
}
}

byte[] requiredData = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 128, 130, 9, 63, 13, 149, 96, 141, 161, 52, 196, 148, 141, 241, 126, 172, 102, 108, 194, 91, 50, 128, 91, 64, 116, 127, 40, 58, 171, 158, 197, 128, 171, 4, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 81, 0 };
byte[] requiredData = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 41, 176, 215, 72, 169, 204, 248, 197, 175, 60, 222, 16, 219, 62, 54, 236, 154, 95, 114, 6, 67, 162, 188, 180, 173, 215, 107, 61, 175, 65, 216, 128, 171, 4, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 81, 0 };

data.Length.Should().Be(requiredData.Length);
for (int i = 0; i < data.Length; i++)
Expand Down
Loading