Skip to content

Commit

Permalink
Fixes (#3196)
Browse files Browse the repository at this point in the history
  • Loading branch information
cschuchardt88 authored Apr 18, 2024
1 parent b2b1150 commit 13905e1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/Neo/Cryptography/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public static byte[] AES256Encrypt(this byte[] plainData, byte[] key, byte[] non
var cipherBytes = new byte[plainData.Length];
if (!IsOSX)
{
#pragma warning disable SYSLIB0053 // Type or member is obsolete
using var cipher = new AesGcm(key);
#pragma warning restore SYSLIB0053 // Type or member is obsolete
cipher.Encrypt(nonce, plainData, cipherBytes, tag, associatedData);
}
else
Expand Down Expand Up @@ -188,7 +190,9 @@ public static byte[] AES256Decrypt(this byte[] encryptedData, byte[] key, byte[]
var decryptedData = new byte[cipherBytes.Length];
if (!IsOSX)
{
#pragma warning disable SYSLIB0053 // Type or member is obsolete
using var cipher = new AesGcm(key);
#pragma warning restore SYSLIB0053 // Type or member is obsolete
cipher.Decrypt(nonce, cipherBytes, tag, decryptedData, associatedData);
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/Neo/NeoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static NeoSystem()
/// <param name="settings">The protocol settings of the <see cref="NeoSystem"/>.</param>
/// <param name="storageProvider">The storage engine used to create the <see cref="IStoreProvider"/> objects. If this parameter is <see langword="null"/>, a default in-memory storage engine will be used.</param>
/// <param name="storagePath">The path of the storage. If <paramref name="storageProvider"/> is the default in-memory storage engine, this parameter is ignored.</param>
public NeoSystem(ProtocolSettings settings, string? storageProvider = null, string? storagePath = null) :
public NeoSystem(ProtocolSettings settings, string storageProvider = null, string storagePath = null) :
this(settings, StoreFactory.GetStoreProvider(storageProvider ?? nameof(MemoryStore))
?? throw new ArgumentException($"Can't find the storage provider {storageProvider}", nameof(storageProvider)), storagePath)
{
Expand All @@ -128,7 +128,7 @@ public NeoSystem(ProtocolSettings settings, string? storageProvider = null, stri
/// <param name="settings">The protocol settings of the <see cref="NeoSystem"/>.</param>
/// <param name="storageProvider">The <see cref="IStoreProvider"/> to use.</param>
/// <param name="storagePath">The path of the storage. If <paramref name="storageProvider"/> is the default in-memory storage engine, this parameter is ignored.</param>
public NeoSystem(ProtocolSettings settings, IStoreProvider storageProvider, string? storagePath = null)
public NeoSystem(ProtocolSettings settings, IStoreProvider storageProvider, string storagePath = null)
{
this.Settings = settings;
this.GenesisBlock = CreateGenesisBlock(settings);
Expand Down
2 changes: 1 addition & 1 deletion src/Neo/Persistence/StoreFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void RegisterProvider(IStoreProvider provider)
/// </summary>
/// <param name="name">Name</param>
/// <returns>Store provider</returns>
public static IStoreProvider? GetStoreProvider(string name)
public static IStoreProvider GetStoreProvider(string name)
{
if (providers.TryGetValue(name, out var provider))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Neo/ProtocolSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public record ProtocolSettings
Hardforks = EnsureOmmitedHardforks(new Dictionary<Hardfork, uint>()).ToImmutableDictionary()
};

public static ProtocolSettings? Custom { get; set; }
public static ProtocolSettings Custom { get; set; }

/// <summary>
/// Loads the <see cref="ProtocolSettings"/> at the specified path.
Expand Down

0 comments on commit 13905e1

Please sign in to comment.