From a523a0213837195eab64158926b6880a9424a5fd Mon Sep 17 00:00:00 2001 From: Shargon Date: Sat, 2 May 2020 11:02:09 +0200 Subject: [PATCH] Reduce changes --- src/Neo.Compiler.MSIL/Optimizer/Parser_UseShortAddress.cs | 4 ---- src/Neo.SmartContract.Framework/OpCode.cs | 1 - .../Neo.Compiler.MSIL.UnitTests.csproj | 4 ---- .../Services/Neo/ContractTest.cs | 6 +++--- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Neo.Compiler.MSIL/Optimizer/Parser_UseShortAddress.cs b/src/Neo.Compiler.MSIL/Optimizer/Parser_UseShortAddress.cs index 7d598baa3..215428435 100644 --- a/src/Neo.Compiler.MSIL/Optimizer/Parser_UseShortAddress.cs +++ b/src/Neo.Compiler.MSIL/Optimizer/Parser_UseShortAddress.cs @@ -37,10 +37,6 @@ public void Parse(List items) for (int x = 0; x < items.Count; x++) { if (!(items[x] is NefInstruction inst)) continue; - if (inst.OpCode == OpCode.TRY_L) - { - - } if (inst.OpCode == OpCode.PUSHA) continue; //PUSHA is not 8 bits if (inst.AddressSize != 4) continue; diff --git a/src/Neo.SmartContract.Framework/OpCode.cs b/src/Neo.SmartContract.Framework/OpCode.cs index a8457fe00..e563f4701 100644 --- a/src/Neo.SmartContract.Framework/OpCode.cs +++ b/src/Neo.SmartContract.Framework/OpCode.cs @@ -4,7 +4,6 @@ public enum OpCode : byte { #region Constants - PUSHINT8 = 0x00, PUSHINT16 = 0x01, PUSHINT32 = 0x02, diff --git a/tests/Neo.Compiler.MSIL.UnitTests/Neo.Compiler.MSIL.UnitTests.csproj b/tests/Neo.Compiler.MSIL.UnitTests/Neo.Compiler.MSIL.UnitTests.csproj index c788f95b3..aafd4b64e 100644 --- a/tests/Neo.Compiler.MSIL.UnitTests/Neo.Compiler.MSIL.UnitTests.csproj +++ b/tests/Neo.Compiler.MSIL.UnitTests/Neo.Compiler.MSIL.UnitTests.csproj @@ -29,10 +29,7 @@ - - - Never @@ -45,7 +42,6 @@ PreserveNewest - diff --git a/tests/Neo.SmartContract.Framework.UnitTests/Services/Neo/ContractTest.cs b/tests/Neo.SmartContract.Framework.UnitTests/Services/Neo/ContractTest.cs index 40f261c40..959e2d90a 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/Services/Neo/ContractTest.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/Services/Neo/ContractTest.cs @@ -55,7 +55,6 @@ public void Test_CreateCallDestroy() Assert.AreEqual(VMState.HALT, _engine.State); Assert.AreEqual(1, result.Count); - item = result.Pop(); Assert.IsInstanceOfType(item, typeof(Integer)); Assert.AreEqual(123, item.GetBigInteger()); @@ -67,7 +66,6 @@ public void Test_CreateCallDestroy() Assert.AreEqual(VMState.HALT, _engine.State); Assert.AreEqual(0, result.Count); - // Check again for failures _engine.Reset(); @@ -79,7 +77,6 @@ public void Test_CreateCallDestroy() [TestMethod] public void Test_Update() { - // Create var script = _engine.Build("./TestClasses/Contract_CreateAndUpdate.cs"); @@ -150,6 +147,7 @@ public void Test_Update() public void Test_CreateStandardAccount() { // Wrong pubKey + _engine.Reset(); var result = _engine.ExecuteTestCaseStandard("createStandardAccount", new byte[] { 0x01, 0x02 }); Assert.AreEqual(VMState.FAULT, _engine.State); @@ -158,6 +156,7 @@ public void Test_CreateStandardAccount() _engine.Reset(); // Good pubKey (compressed) + _engine.Reset(); result = _engine.ExecuteTestCaseStandard("createStandardAccount", new byte[] { 0x02, 0x48, 0x6f, 0xd1, 0x57, 0x02, 0xc4, 0x49, 0x0a, 0x26, 0x70, 0x31, 0x12, 0xa5, 0xcc, 0x1d, 0x09, 0x23, 0xfd, 0x69, 0x7a, 0x33, 0x40, 0x6b, 0xd5, 0xa1, 0xc0, 0x0e, 0x00, 0x13, 0xb0, 0x9a, 0x70 }); Assert.AreEqual(VMState.HALT, _engine.State); @@ -168,6 +167,7 @@ public void Test_CreateStandardAccount() Assert.AreEqual("8b67a062c232ce87dc65cc69391ea909e721cd98", item.GetSpan().ToHexString()); // Good pubKey (uncompressed) + _engine.Reset(); result = _engine.ExecuteTestCaseStandard("createStandardAccount", new byte[] { 0x04, 0x48, 0x6f, 0xd1, 0x57, 0x02, 0xc4, 0x49, 0x0a, 0x26, 0x70, 0x31, 0x12, 0xa5, 0xcc, 0x1d, 0x09, 0x23, 0xfd, 0x69, 0x7a, 0x33, 0x40, 0x6b, 0xd5, 0xa1, 0xc0, 0x0e, 0x00, 0x13, 0xb0, 0x9a, 0x70, 0x05, 0x43, 0x6c, 0x08, 0x2c, 0x2c, 0x88, 0x08, 0x5b, 0x4b, 0x53, 0xd5, 0x4c, 0x55, 0x66, 0xba, 0x44, 0x8d, 0x5c, 0x3e, 0x2a, 0x2a, 0x5c, 0x3a, 0x3e, 0xa5, 0x00, 0xe1, 0x40, 0x77, 0x55, 0x9c }); Assert.AreEqual(VMState.HALT, _engine.State);