Skip to content

Commit

Permalink
Merge branch 'master' into remove/plugin-applicationlogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim8y authored Dec 12, 2024
2 parents 4761349 + e0328e3 commit b4d79cd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 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
1 change: 1 addition & 0 deletions src/Neo/Persistence/ClonedCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected override bool ContainsInternal(StorageKey key)
return innerCache.Contains(key);
}

/// <inheritdoc/>
protected override StorageItem GetInternal(StorageKey key)
{
return innerCache[key].Clone();
Expand Down
3 changes: 2 additions & 1 deletion src/Neo/Persistence/DataCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ public bool Contains(StorageKey key)
/// Reads a specified entry from the underlying storage.
/// </summary>
/// <param name="key">The key of the entry.</param>
/// <returns>The data of the entry. Or <see langword="null"/> if the entry doesn't exist.</returns>
/// <returns>The data of the entry. Or throw <see cref="KeyNotFoundException"/> if the entry doesn't exist.</returns>
/// <exception cref="KeyNotFoundException">If the entry doesn't exist.</exception>
protected abstract StorageItem GetInternal(StorageKey key);

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/Neo/Persistence/SnapshotCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void Dispose()
snapshot?.Dispose();
}

/// <inheritdoc/>
protected override StorageItem GetInternal(StorageKey key)
{
byte[] value = store.TryGet(key.ToArray());
Expand Down

0 comments on commit b4d79cd

Please sign in to comment.