diff --git a/src/Neo/VM/Helper.cs b/src/Neo/Extensions/SmartContract/ContractParameterExtensions.cs similarity index 91% rename from src/Neo/VM/Helper.cs rename to src/Neo/Extensions/SmartContract/ContractParameterExtensions.cs index 8a1bc2b01b..d60b61eaf2 100644 --- a/src/Neo/VM/Helper.cs +++ b/src/Neo/Extensions/SmartContract/ContractParameterExtensions.cs @@ -1,6 +1,6 @@ // Copyright (C) 2015-2024 The Neo Project. // -// Helper.cs file belongs to the neo project and is free +// ContractParameterExtensions.cs file belongs to the neo project and is free // software distributed under the MIT software license, see the // accompanying file LICENSE in the main directory of the // repository or http://www.opensource.org/licenses/mit-license.php @@ -10,8 +10,6 @@ // modifications are permitted. using Neo.Cryptography.ECC; -using Neo.Extensions; -using Neo.Json; using Neo.SmartContract; using Neo.VM.Types; using System; @@ -20,12 +18,9 @@ using System.Numerics; using Array = Neo.VM.Types.Array; -namespace Neo.VM +namespace Neo.Extensions { - /// - /// A helper class related to NeoVM. - /// - public static class Helper + public static class ContractParameterExtensions { /// /// Converts the to a . @@ -46,7 +41,7 @@ private static StackItem ToStackItem(ContractParameter parameter, List<(StackIte { case ContractParameterType.Array: if (context is null) - context = new List<(StackItem, ContractParameter)>(); + context = []; else (stackItem, _) = context.FirstOrDefault(p => ReferenceEquals(p.Item2, parameter)); if (stackItem is null) @@ -57,7 +52,7 @@ private static StackItem ToStackItem(ContractParameter parameter, List<(StackIte break; case ContractParameterType.Map: if (context is null) - context = new List<(StackItem, ContractParameter)>(); + context = []; else (stackItem, _) = context.FirstOrDefault(p => ReferenceEquals(p.Item2, parameter)); if (stackItem is null)