Skip to content

Commit

Permalink
Reduce changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed May 2, 2020
1 parent 8d7a6e5 commit a523a02
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/Neo.Compiler.MSIL/Optimizer/Parser_UseShortAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ public void Parse(List<INefItem> 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;

Expand Down
1 change: 0 additions & 1 deletion src/Neo.SmartContract.Framework/OpCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ public enum OpCode : byte
{
#region Constants


PUSHINT8 = 0x00,
PUSHINT16 = 0x01,
PUSHINT32 = 0x02,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
</None>
</ItemGroup>



<ItemGroup>

<Compile Update="UnitTest_TypeConvert.cs">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Compile>
Expand All @@ -45,7 +42,6 @@
<None Update="TestClasses_VB\Contract_Return1.vb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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();
Expand All @@ -79,7 +77,6 @@ public void Test_CreateCallDestroy()
[TestMethod]
public void Test_Update()
{

// Create

var script = _engine.Build("./TestClasses/Contract_CreateAndUpdate.cs");
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit a523a02

Please sign in to comment.