Skip to content

Commit

Permalink
[Move] Part-10 Classes into Different Library - Neo.Extensions (#…
Browse files Browse the repository at this point in the history
…3449)

* Part-1 `Neo.IO` - move

* Part-2

* Added `BigInteger` to `Neo.Extensions`

* Found more `BigInteger`

* Added `ByteArray` to `Neo.Extensions`

* Added `DateTime` Extensions to `Neo.Extensions`

* Added `HashSetExtensions`, `HashSetExtensions2`, `IpAddressExtensions`, `AssemblyExtensions`, `StringExtensdions`
Deleted `Helper.cs` file

* Added `ICollection`, `Memory`,  `String`, `Unsafe` extensions

* Adding `using`

* dotnet format

* Added more Extensions

* Move some methods

* Added Tests

* Added `tests` from `Part-2`

* Added `tests` for `PART-4`

* Added `tests` for `PART-5`

* Added the `Part` 7

* `PART-8`

* `PART-9`

* `PART-10`

* Revert some changes

---------

Co-authored-by: Shargon <[email protected]>
  • Loading branch information
cschuchardt88 and shargon authored Dec 12, 2024
1 parent d002a7d commit e0328e3
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand All @@ -20,12 +18,9 @@
using System.Numerics;
using Array = Neo.VM.Types.Array;

namespace Neo.VM
namespace Neo.Extensions
{
/// <summary>
/// A helper class related to NeoVM.
/// </summary>
public static class Helper
public static class ContractParameterExtensions
{
/// <summary>
/// Converts the <see cref="ContractParameter"/> to a <see cref="StackItem"/>.
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit e0328e3

Please sign in to comment.