This line of code is redundant because the while loop condition already checks the success variable, and the loop will not continue if success is true.
Code Snippet
public IEnumerator TrackTransaction(string transactionHash)
{
var success = false;
const float timeout = 30f; // seconds
var timestamp = Time.time;
// keep making requests until time out or success
while (!success && Time.time - timestamp < timeout)
{
if (success) break; <---
Logger.LogDebug($"Checking tx status: {transactionHash}");
yield return TezosSingleton.Instance.GetOperationStatus(result =>
{
if (result != null)
success = JsonSerializer.Deserialize<bool>(result);
}, transactionHash);
yield return new WaitForSecondsRealtime(3);
}
ContractCallInjectionResult result;
result.success = success;
result.transactionHash = transactionHash;
ContractCallCompleted?.Invoke(JsonUtility.ToJson(result));
}
Additional Context
This fix will not affect the functionality of the method.
Issue Definition
This line of code is redundant because the while loop condition already checks the success variable, and the loop will not continue if success is true.
Code Snippet
Additional Context
This fix will not affect the functionality of the method.