Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashuaidehao committed Dec 14, 2022
2 parents ec73b0d + f88d4f8 commit a985eb3
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<Copyright>2015-2022 The Neo Project</Copyright>
<VersionPrefix>3.4.0</VersionPrefix>
<VersionPrefix>3.5.0</VersionPrefix>
<Authors>The Neo Project</Authors>
<TargetFramework>net6.0</TargetFramework>
<PackageProjectUrl>https://github.com/neo-project/neo</PackageProjectUrl>
Expand Down
4 changes: 2 additions & 2 deletions src/Neo/Neo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Akka" Version="1.4.40" />
<PackageReference Include="Akka" Version="1.4.46" />
<PackageReference Include="BouncyCastle.NetCore" Version="1.9.0" />
<PackageReference Include="K4os.Compression.LZ4" Version="1.2.16" />
<PackageReference Include="Neo.VM" Version="3.4.0" />
<PackageReference Include="Neo.VM" Version="3.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 4 additions & 14 deletions src/Neo/Plugins/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ static Plugin()
{
EnableRaisingEvents = true,
IncludeSubdirectories = true,
NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.LastWrite | NotifyFilters.Size,
NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.CreationTime | NotifyFilters.LastWrite | NotifyFilters.Size,
};
configWatcher.Changed += ConfigWatcher_Changed;
configWatcher.Created += ConfigWatcher_Changed;
configWatcher.Renamed += ConfigWatcher_Changed;
configWatcher.Deleted += ConfigWatcher_Changed;
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
}

Expand All @@ -102,20 +104,8 @@ private static void ConfigWatcher_Changed(object sender, FileSystemEventArgs e)
switch (GetExtension(e.Name))
{
case ".json":
try
{
Plugins.FirstOrDefault(p => p.ConfigFile == e.FullPath)?.Configure();
}
catch (FormatException) { }
break;
case ".dll":
if (e.ChangeType != WatcherChangeTypes.Created) return;
if (GetDirectoryName(GetDirectoryName(e.FullPath)) != PluginsDirectory) return;
try
{
LoadPlugin(Assembly.Load(File.ReadAllBytes(e.FullPath)));
}
catch { }
Utility.Log(nameof(Plugin), LogLevel.Warning, $"File {e.Name} is {e.ChangeType}, please restart node.");
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Neo/SmartContract/ApplicationEngine.OpCodePrices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ partial class ApplicationEngine
[OpCode.PUSHINT64] = 1 << 0,
[OpCode.PUSHINT128] = 1 << 2,
[OpCode.PUSHINT256] = 1 << 2,
[OpCode.PUSHT] = 1 << 0,
[OpCode.PUSHF] = 1 << 0,
[OpCode.PUSHA] = 1 << 2,
[OpCode.PUSHNULL] = 1 << 0,
[OpCode.PUSHDATA1] = 1 << 3,
Expand Down
2 changes: 1 addition & 1 deletion src/Neo/SmartContract/ApplicationEngine.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected internal void RuntimeLoadScript(byte[] script, CallFlags callFlags, Ar
throw new ArgumentOutOfRangeException(nameof(callFlags));

ExecutionContextState state = CurrentContext.GetState<ExecutionContextState>();
ExecutionContext context = LoadScript(script, configureState: p =>
ExecutionContext context = LoadScript(new Script(script, true), configureState: p =>
{
p.CallingContext = CurrentContext;
p.CallFlags = callFlags & state.CallFlags & CallFlags.ReadOnly;
Expand Down
6 changes: 3 additions & 3 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions tests/Neo.UnitTests/Neo.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Akka.TestKit" Version="1.4.40" />
<PackageReference Include="Akka.TestKit.Xunit2" Version="1.4.40" />
<PackageReference Include="Akka.TestKit" Version="1.4.46" />
<PackageReference Include="Akka.TestKit.Xunit2" Version="1.4.46" />
<PackageReference Include="Moq" Version="4.18.2" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion tests/Neo.UnitTests/SmartContract/Native/UT_StdLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public void Json_Serialize()
Assert.IsTrue(engine.ResultStack.Pop<ByteString>().GetString() == "{\"key\":\"value\"}");
Assert.IsTrue(engine.ResultStack.Pop<ByteString>().GetString() == "null");
Assert.IsTrue(engine.ResultStack.Pop<ByteString>().GetString() == "\"test\"");
Assert.IsTrue(engine.ResultStack.Pop<ByteString>().GetString() == "1");
Assert.IsTrue(engine.ResultStack.Pop<ByteString>().GetString() == "true");
Assert.IsTrue(engine.ResultStack.Pop<ByteString>().GetString() == "5");
}

Expand Down
8 changes: 4 additions & 4 deletions tests/Neo.UnitTests/VM/UT_Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void TestEmitAppCall3()
ScriptBuilder sb = new ScriptBuilder();
sb.EmitDynamicCall(UInt160.Zero, "AAAAA", true);
byte[] tempArray = new byte[38];
tempArray[0] = (byte)OpCode.PUSH1;
tempArray[0] = (byte)OpCode.PUSHT;
tempArray[1] = (byte)OpCode.PUSH1;//arg.Length
tempArray[2] = (byte)OpCode.PACK;
tempArray[3] = (byte)OpCode.PUSH15;//(byte)CallFlags.All;
Expand Down Expand Up @@ -344,7 +344,7 @@ private void TestEmitPush2Boolean()
ScriptBuilder sb = new ScriptBuilder();
sb.EmitPush(new ContractParameter(ContractParameterType.Boolean));
byte[] tempArray = new byte[1];
tempArray[0] = (byte)OpCode.PUSH0;
tempArray[0] = (byte)OpCode.PUSHF;
CollectionAssert.AreEqual(tempArray, sb.ToArray());
}

Expand Down Expand Up @@ -531,7 +531,7 @@ private void TestEmitPush3Bool()
ScriptBuilder sb = new ScriptBuilder();
sb.EmitPush(true);
byte[] tempArray = new byte[1];
tempArray[0] = (byte)OpCode.PUSH1;
tempArray[0] = (byte)OpCode.PUSHT;
CollectionAssert.AreEqual(tempArray, sb.ToArray());
}

Expand All @@ -541,7 +541,7 @@ public void TestEmitSysCall()
ScriptBuilder sb = new ScriptBuilder();
sb.EmitSysCall(0, true);
byte[] tempArray = new byte[6];
tempArray[0] = (byte)OpCode.PUSH1;
tempArray[0] = (byte)OpCode.PUSHT;
tempArray[1] = (byte)OpCode.SYSCALL;
tempArray[2] = 0x00;
tempArray[3] = 0x00;
Expand Down

0 comments on commit a985eb3

Please sign in to comment.