From fcbf479cb5522d532dcdf46c51e5baba7d47fda3 Mon Sep 17 00:00:00 2001 From: Shargon Date: Mon, 17 Oct 2022 00:42:40 -0700 Subject: [PATCH 1/4] Close #2820 (#2821) --- src/Neo/SmartContract/ApplicationEngine.Runtime.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo/SmartContract/ApplicationEngine.Runtime.cs b/src/Neo/SmartContract/ApplicationEngine.Runtime.cs index ad20031195..9fba368b20 100644 --- a/src/Neo/SmartContract/ApplicationEngine.Runtime.cs +++ b/src/Neo/SmartContract/ApplicationEngine.Runtime.cs @@ -206,7 +206,7 @@ protected internal void RuntimeLoadScript(byte[] script, CallFlags callFlags, Ar throw new ArgumentOutOfRangeException(nameof(callFlags)); ExecutionContextState state = CurrentContext.GetState(); - 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; From 77ee2cc5b6ea371efdf3be506b173c6304b0fc01 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Mon, 24 Oct 2022 21:20:01 +0800 Subject: [PATCH 2/4] Plugin file watcher only reminds user to restart node (#2823) * init * deleted --- src/Neo/Plugins/Plugin.cs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Neo/Plugins/Plugin.cs b/src/Neo/Plugins/Plugin.cs index fa8818d8ec..c3c66ced8a 100644 --- a/src/Neo/Plugins/Plugin.cs +++ b/src/Neo/Plugins/Plugin.cs @@ -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; } @@ -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; } } From 0172d6b2be35b2b9b4ffaea9b8598373e435de35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 19:58:30 -0700 Subject: [PATCH 3/4] Bump Akka from 1.4.40 to 1.4.46 in /src/Neo (#2830) Bumps [Akka](https://github.com/akkadotnet/akka.net) from 1.4.40 to 1.4.46. - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md) - [Commits](https://github.com/akkadotnet/akka.net/compare/1.4.40...1.4.46) --- updated-dependencies: - dependency-name: Akka dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Neo/Neo.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo/Neo.csproj b/src/Neo/Neo.csproj index d24abf4249..256c9a247a 100644 --- a/src/Neo/Neo.csproj +++ b/src/Neo/Neo.csproj @@ -10,7 +10,7 @@ - + From f88d4f8f97018492713907554b89f9e0fbafb916 Mon Sep 17 00:00:00 2001 From: Erik Zhang Date: Tue, 6 Dec 2022 17:02:29 +0800 Subject: [PATCH 4/4] 3.5.0 (#2832) --- src/Directory.Build.props | 2 +- src/Neo/Neo.csproj | 2 +- src/Neo/SmartContract/ApplicationEngine.OpCodePrices.cs | 2 ++ tests/Directory.Build.props | 6 +++--- tests/Neo.UnitTests/Neo.UnitTests.csproj | 4 ++-- tests/Neo.UnitTests/SmartContract/Native/UT_StdLib.cs | 2 +- tests/Neo.UnitTests/VM/UT_Helper.cs | 8 ++++---- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 30baaac568..c107e19bfa 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,7 +3,7 @@ 2015-2022 The Neo Project - 3.4.0 + 3.5.0 The Neo Project net6.0 https://github.com/neo-project/neo diff --git a/src/Neo/Neo.csproj b/src/Neo/Neo.csproj index 256c9a247a..a671c484ad 100644 --- a/src/Neo/Neo.csproj +++ b/src/Neo/Neo.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Neo/SmartContract/ApplicationEngine.OpCodePrices.cs b/src/Neo/SmartContract/ApplicationEngine.OpCodePrices.cs index 8681b3df7a..68f9568155 100644 --- a/src/Neo/SmartContract/ApplicationEngine.OpCodePrices.cs +++ b/src/Neo/SmartContract/ApplicationEngine.OpCodePrices.cs @@ -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, diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index ba2678873c..734a0f50c6 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -7,11 +7,11 @@ - - + + - + diff --git a/tests/Neo.UnitTests/Neo.UnitTests.csproj b/tests/Neo.UnitTests/Neo.UnitTests.csproj index b199f84c04..b415956da2 100644 --- a/tests/Neo.UnitTests/Neo.UnitTests.csproj +++ b/tests/Neo.UnitTests/Neo.UnitTests.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/tests/Neo.UnitTests/SmartContract/Native/UT_StdLib.cs b/tests/Neo.UnitTests/SmartContract/Native/UT_StdLib.cs index 8879c828b5..8342e15824 100644 --- a/tests/Neo.UnitTests/SmartContract/Native/UT_StdLib.cs +++ b/tests/Neo.UnitTests/SmartContract/Native/UT_StdLib.cs @@ -290,7 +290,7 @@ public void Json_Serialize() Assert.IsTrue(engine.ResultStack.Pop().GetString() == "{\"key\":\"value\"}"); Assert.IsTrue(engine.ResultStack.Pop().GetString() == "null"); Assert.IsTrue(engine.ResultStack.Pop().GetString() == "\"test\""); - Assert.IsTrue(engine.ResultStack.Pop().GetString() == "1"); + Assert.IsTrue(engine.ResultStack.Pop().GetString() == "true"); Assert.IsTrue(engine.ResultStack.Pop().GetString() == "5"); } diff --git a/tests/Neo.UnitTests/VM/UT_Helper.cs b/tests/Neo.UnitTests/VM/UT_Helper.cs index 444584cd8e..539c5df028 100644 --- a/tests/Neo.UnitTests/VM/UT_Helper.cs +++ b/tests/Neo.UnitTests/VM/UT_Helper.cs @@ -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; @@ -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()); } @@ -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()); } @@ -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;