Skip to content

SDK warning fixes #1267

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

Merged
merged 7 commits into from
Jan 9, 2025
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: 0 additions & 4 deletions Packages/io.chainsafe.web3-unity.ramp/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using AOT;
using ChainSafe.Gaming.Evm.Signers;
using ChainSafe.Gaming.Web3;
#nullable enable

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

public event Action<OnRampPurchaseData> OnRampPurchaseCreated;
public event Action<OffRampSaleData> OffRampSaleCreated;
public event Action<OnRampPurchaseData>? OnRampPurchaseCreated;
public event Action<OffRampSaleData>? OffRampSaleCreated;

private readonly IRampExchangerConfig config;
private readonly ISigner signer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Math.EC;
using Org.BouncyCastle.Math.Field;
#nullable enable

public class ECPointArithmetic
{
Expand All @@ -13,7 +14,6 @@ public class ECPointArithmetic
private BigInteger? zinv;
private BigInteger one = BigInteger.One;
private BigInteger zero = BigInteger.Zero;
private bool infinity;

public ECPointArithmetic(ECCurve ec, BigInteger x, BigInteger y, BigInteger z)
{
Expand All @@ -33,7 +33,6 @@ public ECPointArithmetic(ECCurve ec, BigInteger x, BigInteger y, BigInteger z)
this.z = z;
}
this.zinv = null;
infinity = false;
}

public BigInteger getX()
Expand Down Expand Up @@ -106,7 +105,7 @@ public ECPointArithmetic add(ECPointArithmetic b)
{
return this;
}
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null);
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null!);
// u = Y2 * Z1 - Y1 * Z2
BigInteger u = b.y.Multiply(this.z).Subtract(this.y.Multiply(b.z)).Mod(this.ef.Characteristic);
// v = X2 * Z1 - X1 * Z2
Expand All @@ -118,8 +117,7 @@ public ECPointArithmetic add(ECPointArithmetic b)
{
return this.twice(); // this == b, so double
}

infinity = true; // this = -b, so infinity

return R;
}

Expand Down Expand Up @@ -152,10 +150,9 @@ public ECPointArithmetic twice()
{
return this;
}
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null);
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null!);
if (this.y.SignValue == 0)
{
infinity = true;
return R;
}

Expand Down Expand Up @@ -196,10 +193,9 @@ public ECPointArithmetic multiply(BigInteger k)
return this;
}

ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null);
ECPointArithmetic R = new ECPointArithmetic(this.ec, zero, zero, null!);
if (k.SignValue == 0)
{
infinity = true;
return R;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

public class MfaSettings
{
public MfaSetting? deviceShareFactor { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

public class Web3AuthOptions
{
public string clientId { get; set; }
public string? clientId { get; set; }
public Web3Auth.Network network { get; set; }

public Web3Auth.BuildEnv buildEnv { get; set; } = Web3Auth.BuildEnv.PRODUCTION;
public Uri redirectUrl { get; set; }
public Uri? redirectUrl { get; set; }
public string sdkUrl
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ public void setOptions(Web3AuthOptions web3AuthOptions, bool rememberMe = false)
if (this.web3AuthOptions.clientId != null)
this.initParams["clientId"] = this.web3AuthOptions.clientId;

if (this.web3AuthOptions.buildEnv != null)
this.initParams["buildEnv"] = this.web3AuthOptions.buildEnv.ToString().ToLower();
this.initParams["buildEnv"] = this.web3AuthOptions.buildEnv.ToString().ToLower();

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class WebGLResourceEmbedding : IPreprocessBuildWithReport
public int callbackOrder => 1;
public void OnPreprocessBuild(BuildReport report)
{
PlayerSettings.SetPropertyBool("useEmbeddedResources", true, BuildTargetGroup.WebGL);
PlayerSettings.WebGL.useEmbeddedResources = true;
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Awake()
}
}

public class WaitForUpdate : CustomYieldInstruction
public class WaitForUpdates : CustomYieldInstruction
{
public override bool keepWaiting
{
Expand Down Expand Up @@ -697,7 +697,7 @@ public async Task Receive()
}
finally
{
await new WaitForUpdate();
await new WaitForUpdates();
OnClose?.Invoke(closeCode);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

public class UploadPlatforms
{

#region Fields

#if UNITY_WEBGL && !UNITY_EDITOR
public static event EventHandler<byte[]> ImageSelected;
#endif

#endregion

#region Methods

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void Awake()
);
}

public async void Set(WalletModel data, string walletIconEndpoint, HttpHeader[] httpHeaders, Action onClick)
public void Set(WalletModel data, string walletIconEndpoint, HttpHeader[] httpHeaders, Action onClick)
{
walletData = data;
this.walletIconEndpoint = walletIconEndpoint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Threading.Tasks;
using ChainSafe.Gaming.Evm.Unity;
Expand Down Expand Up @@ -32,7 +33,10 @@ public class WebSocketConnection : IJsonRpcConnection, IModule
public event EventHandler Closed;
public event EventHandler<Exception> ErrorReceived;
public event EventHandler<object> Opened;
// Disabled unused event warning, can't remove without altering IJsonRpcConnection.
#pragma warning disable CS0067
public event EventHandler<Exception> RegisterErrored;
#pragma warning restore CS0067

private WebSocket _socket;
private bool _disposed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,10 @@ public class EvmSample : MonoBehaviour, ISample

#endregion

#region Get Send Array

[Header("Array Calls")]
[SerializeField] private string methodArrayGet = "getStore";
[SerializeField] private string methodArraySend = "setStore";
[SerializeField]
private string[] stringArraySend =
{
"0xFb3aECf08940785D4fB3Ad87cDC6e1Ceb20e9aac",
"0x92d4040e4f3591e60644aaa483821d1bd87001e3"
};

#endregion

#region Sign Verify Sha3

[Header("Sign Verify SHA3 calls")]
[SerializeField] private string messageSign = "The right man in the wrong place can make all the difference in the world.";
[SerializeField] private string messageSignVerify = "A man chooses, a slave obeys.";
[SerializeField] private string messageSha = "It’s dangerous to go alone, take this!";

#endregion

Expand All @@ -74,23 +58,6 @@ public class EvmSample : MonoBehaviour, ISample

#endregion

#region Registered Contract

[Header("Registered Contract Call")]
[SerializeField] private string registeredContractName = "CsTestErc20";

#endregion

#region ECDSA

[Header("ECDSA Calls")]
[SerializeField] private string ecdsaKey = "0x78dae1a22c7507a4ed30c06172e7614eb168d3546c13856340771e63ad3c0081";
[SerializeField] private string ecdsaMessage = "This is a test message";
[SerializeField] private string transactionHash = "0x123456789";
[SerializeField] private string chainId = "11155111";

#endregion

#region Multi Call

[Header("MutliCall")]
Expand Down
Loading