-
Notifications
You must be signed in to change notification settings - Fork 102
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
Update dev-pack with last neo changes #146
Changes from all commits
855709b
3646d7f
eb53774
29003b9
8fcc2d8
7b91507
0c64481
bf647c2
361f2fd
2655430
cc4f58d
c615da7
e2ed02a
d631960
f3a303e
a8f875f
27a0cc7
0b9efb5
3368ebd
60de122
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Copyright>2016-2017 The Neo Project</Copyright> | ||
<Copyright>2016-2019 The Neo Project</Copyright> | ||
<AssemblyTitle>Neo.SmartContract.Framework</AssemblyTitle> | ||
<Version>2.9.3</Version> | ||
<Version>3.0.0-preview1</Version> | ||
<Authors>The Neo Project</Authors> | ||
<TargetFramework>netstandard1.6</TargetFramework> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<AssemblyName>Neo.SmartContract.Framework</AssemblyName> | ||
<PackageId>Neo.SmartContract.Framework</PackageId> | ||
<PackageTags>NEO;AntShares;Blockchain;Smart Contract;VM</PackageTags> | ||
<PackageProjectUrl>https:/neo-project/neo-devpack-dotnet</PackageProjectUrl> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<RepositoryType>git</RepositoryType> | ||
<RepositoryUrl>https:/neo-project/neo-devpack-dotnet.git</RepositoryUrl> | ||
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.6' ">1.6.0</NetStandardImplicitPackageVersion> | ||
<Company>The Neo Project</Company> | ||
<Description>Neo.SmartContract.Framework</Description> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard1.6|AnyCPU'"> | ||
<DefineConstants>RELEASE;NETSTANDARD1_6</DefineConstants> | ||
<DebugType>none</DebugType> | ||
<DebugSymbols>False</DebugSymbols> | ||
</PropertyGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Neo.Compiler.MSIL.Utils; | ||
using Neo.VM; | ||
using Neo.SmartContract; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Numerics; | ||
|
||
namespace Neo.Compiler.MSIL | ||
{ | ||
|
@@ -10,19 +13,33 @@ public class UnitTest_Shift | |
[TestMethod] | ||
public void Test_Shift() | ||
{ | ||
var list = new List<BigInteger>(); | ||
var method = new EventHandler<NotifyEventArgs>((sender, e) => list.Add(((VM.Types.Integer)((VM.Types.Array)e.State)[0]).ToBigInteger())); | ||
ApplicationEngine.Notify += method; | ||
|
||
var testengine = new TestEngine(); | ||
testengine.AddEntryScript("./TestClasses/Contract_shift.cs"); | ||
testengine.ScriptEntry.DumpNEF(); | ||
var result = testengine.ExecuteTestCaseStandard("testfunc"); | ||
ApplicationEngine.Notify -= method; | ||
|
||
CollectionAssert.AreEqual(new BigInteger[] { 16, 17179869184, 4, 0 }, list); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lightszero please take a look this, with int, we have a different result than BigInteger. it's this expected? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But integer result should be the same, because it should be converted to BigInteger. It's strange There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. We should treat the behavior of negative shifts as undefined and disallow it. |
||
} | ||
|
||
[TestMethod] | ||
public void Test_Shift_BigInteger() | ||
{ | ||
var list = new List<BigInteger>(); | ||
var method = new EventHandler<NotifyEventArgs>((sender, e) => list.Add(((VM.Types.Integer)((VM.Types.Array)e.State)[0]).ToBigInteger())); | ||
ApplicationEngine.Notify += method; | ||
|
||
var testengine = new TestEngine(); | ||
testengine.AddEntryScript("./TestClasses/Contract_shift_bigint.cs"); | ||
testengine.ScriptEntry.DumpNEF(); | ||
StackItem[] _params = new StackItem[] { "testfunc", new StackItem[0] }; | ||
var result = testengine.ExecuteTestCase(_params); | ||
var result = testengine.ExecuteTestCaseStandard("testfunc"); | ||
ApplicationEngine.Notify -= method; | ||
|
||
CollectionAssert.AreEqual(new BigInteger[] { 16, 4, 4, 16 }, list); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we supporting netstandard2.1 here. This is a CLI tool, it should just have the single 3.1 target framework
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it means that it is a library too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need it to be a library too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https:/neo-project/neo-compiler/pull/147#issue-252914432
This was the PR that turned neon into a library at the time. Maybe some developers have such a need. I do not know.