Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temp Fix Annotations/Warnings #3196

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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