Skip to content

Commit 533adad

Browse files
authored
SDK warning fixes (#1267)
* warning fixes added SDK warning fixes. * fixes fixes * fixes fixes
1 parent a74ac94 commit 533adad

12 files changed

Lines changed: 25 additions & 58 deletions

File tree

Packages/io.chainsafe.web3-unity.ramp/Editor.meta

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/io.chainsafe.web3-unity.ramp/Runtime/Scripts/RampExchangerWebGL.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using AOT;
77
using ChainSafe.Gaming.Evm.Signers;
88
using ChainSafe.Gaming.Web3;
9+
#nullable enable
910

1011
namespace ChainSafe.Gaming.Exchangers.Ramp
1112
{
@@ -27,8 +28,8 @@ private delegate void OffRampSaleCallback(int requestId, string createdAt, strin
2728
private static readonly Dictionary<int, TaskCompletionSource<OffRampSaleData>> sellTaskMap = new();
2829
private static readonly Dictionary<int, TaskCompletionSource<RampTransactionData>> purchaseOrSellTaskMap = new();
2930

30-
public event Action<OnRampPurchaseData> OnRampPurchaseCreated;
31-
public event Action<OffRampSaleData> OffRampSaleCreated;
31+
public event Action<OnRampPurchaseData>? OnRampPurchaseCreated;
32+
public event Action<OffRampSaleData>? OffRampSaleCreated;
3233

3334
private readonly IRampExchangerConfig config;
3435
private readonly ISigner signer;

Packages/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Types/ECPointArithmetic.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Org.BouncyCastle.Math;
22
using Org.BouncyCastle.Math.EC;
33
using Org.BouncyCastle.Math.Field;
4+
#nullable enable
45

56
public class ECPointArithmetic
67
{
@@ -13,7 +14,6 @@ public class ECPointArithmetic
1314
private BigInteger? zinv;
1415
private BigInteger one = BigInteger.One;
1516
private BigInteger zero = BigInteger.Zero;
16-
private bool infinity;
1717

1818
public ECPointArithmetic(ECCurve ec, BigInteger x, BigInteger y, BigInteger z)
1919
{
@@ -33,7 +33,6 @@ public ECPointArithmetic(ECCurve ec, BigInteger x, BigInteger y, BigInteger z)
3333
this.z = z;
3434
}
3535
this.zinv = null;
36-
infinity = false;
3736
}
3837

3938
public BigInteger getX()
@@ -106,7 +105,7 @@ public ECPointArithmetic add(ECPointArithmetic b)
106105
{
107106
return this;
108107
}
109-
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null);
108+
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null!);
110109
// u = Y2 * Z1 - Y1 * Z2
111110
BigInteger u = b.y.Multiply(this.z).Subtract(this.y.Multiply(b.z)).Mod(this.ef.Characteristic);
112111
// v = X2 * Z1 - X1 * Z2
@@ -118,8 +117,7 @@ public ECPointArithmetic add(ECPointArithmetic b)
118117
{
119118
return this.twice(); // this == b, so double
120119
}
121-
122-
infinity = true; // this = -b, so infinity
120+
123121
return R;
124122
}
125123

@@ -152,10 +150,9 @@ public ECPointArithmetic twice()
152150
{
153151
return this;
154152
}
155-
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null);
153+
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null!);
156154
if (this.y.SignValue == 0)
157155
{
158-
infinity = true;
159156
return R;
160157
}
161158

@@ -196,10 +193,9 @@ public ECPointArithmetic multiply(BigInteger k)
196193
return this;
197194
}
198195

199-
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null);
196+
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null!);
200197
if (k.SignValue == 0)
201198
{
202-
infinity = true;
203199
return R;
204200
}
205201

Packages/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Types/MfaSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#nullable enable
2+
13
public class MfaSettings
24
{
35
public MfaSetting? deviceShareFactor { get; set; }

Packages/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
public class Web3AuthOptions
66
{
7-
public string clientId { get; set; }
7+
public string? clientId { get; set; }
88
public Web3Auth.Network network { get; set; }
99

1010
public Web3Auth.BuildEnv buildEnv { get; set; } = Web3Auth.BuildEnv.PRODUCTION;
11-
public Uri redirectUrl { get; set; }
11+
public Uri? redirectUrl { get; set; }
1212
public string sdkUrl
1313
{
1414
get

Packages/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Web3Auth.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ public void setOptions(Web3AuthOptions web3AuthOptions, bool rememberMe = false)
123123
if (this.web3AuthOptions.clientId != null)
124124
this.initParams["clientId"] = this.web3AuthOptions.clientId;
125125

126-
if (this.web3AuthOptions.buildEnv != null)
127-
this.initParams["buildEnv"] = this.web3AuthOptions.buildEnv.ToString().ToLower();
126+
this.initParams["buildEnv"] = this.web3AuthOptions.buildEnv.ToString().ToLower();
128127

129128
this.initParams["network"] = this.web3AuthOptions.network.ToString().ToLower();
130129

Packages/io.chainsafe.web3-unity/Editor/WebGLResourceEmbedding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class WebGLResourceEmbedding : IPreprocessBuildWithReport
99
public int callbackOrder => 1;
1010
public void OnPreprocessBuild(BuildReport report)
1111
{
12-
PlayerSettings.SetPropertyBool("useEmbeddedResources", true, BuildTargetGroup.WebGL);
12+
PlayerSettings.WebGL.useEmbeddedResources = true;
1313
}
1414
}
1515
#endif

Packages/io.chainsafe.web3-unity/Runtime/Plugins/WebSocket/CSWebSocket.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void Awake()
3838
}
3939
}
4040

41-
public class WaitForUpdate : CustomYieldInstruction
41+
public class WaitForUpdates : CustomYieldInstruction
4242
{
4343
public override bool keepWaiting
4444
{
@@ -697,7 +697,7 @@ public async Task Receive()
697697
}
698698
finally
699699
{
700-
await new WaitForUpdate();
700+
await new WaitForUpdates();
701701
OnClose?.Invoke(closeCode);
702702
}
703703
}

Packages/io.chainsafe.web3-unity/Runtime/Scripts/IPFS/UploadPlatforms.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77

88
public class UploadPlatforms
99
{
10-
10+
1111
#region Fields
1212

13+
#if UNITY_WEBGL && !UNITY_EDITOR
1314
public static event EventHandler<byte[]> ImageSelected;
15+
#endif
1416

1517
#endregion
16-
18+
1719
#region Methods
1820

1921
/// <summary>

Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/Dialog/LocalWalletButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private void Awake()
4343
);
4444
}
4545

46-
public async void Set(WalletModel data, string walletIconEndpoint, HttpHeader[] httpHeaders, Action onClick)
46+
public void Set(WalletModel data, string walletIconEndpoint, HttpHeader[] httpHeaders, Action onClick)
4747
{
4848
walletData = data;
4949
this.walletIconEndpoint = walletIconEndpoint;

0 commit comments

Comments
 (0)