diff --git a/src/Neo/Cryptography/Helper.cs b/src/Neo/Cryptography/Helper.cs index 840b6ebb7b..a087620034 100644 --- a/src/Neo/Cryptography/Helper.cs +++ b/src/Neo/Cryptography/Helper.cs @@ -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 @@ -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 diff --git a/src/Neo/NeoSystem.cs b/src/Neo/NeoSystem.cs index 1303770a3f..bfed791509 100644 --- a/src/Neo/NeoSystem.cs +++ b/src/Neo/NeoSystem.cs @@ -116,7 +116,7 @@ static NeoSystem() /// The protocol settings of the . /// The storage engine used to create the objects. If this parameter is , a default in-memory storage engine will be used. /// The path of the storage. If is the default in-memory storage engine, this parameter is ignored. - 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) { @@ -128,7 +128,7 @@ public NeoSystem(ProtocolSettings settings, string? storageProvider = null, stri /// The protocol settings of the . /// The to use. /// The path of the storage. If is the default in-memory storage engine, this parameter is ignored. - 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); diff --git a/src/Neo/Persistence/StoreFactory.cs b/src/Neo/Persistence/StoreFactory.cs index 2764366f06..6fee81e9f3 100644 --- a/src/Neo/Persistence/StoreFactory.cs +++ b/src/Neo/Persistence/StoreFactory.cs @@ -36,7 +36,7 @@ public static void RegisterProvider(IStoreProvider provider) /// /// Name /// Store provider - public static IStoreProvider? GetStoreProvider(string name) + public static IStoreProvider GetStoreProvider(string name) { if (providers.TryGetValue(name, out var provider)) { diff --git a/src/Neo/ProtocolSettings.cs b/src/Neo/ProtocolSettings.cs index 1b7367a6a2..c3d8232afd 100644 --- a/src/Neo/ProtocolSettings.cs +++ b/src/Neo/ProtocolSettings.cs @@ -120,7 +120,7 @@ public record ProtocolSettings Hardforks = EnsureOmmitedHardforks(new Dictionary()).ToImmutableDictionary() }; - public static ProtocolSettings? Custom { get; set; } + public static ProtocolSettings Custom { get; set; } /// /// Loads the at the specified path.