Skip to content

Commit

Permalink
Rename vairable in constructor to make it more reader friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
BellringerQuinn committed Dec 18, 2023
1 parent 16f485f commit 7a16823
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Numerics;
using Sequence.Transactions;
using UnityEngine;
using UnityEngine.Serialization;
using StringExtensions = Sequence.Utils.StringExtensions;

namespace Sequence.WaaS
Expand All @@ -13,8 +14,8 @@ public class Transaction
{
public static readonly string WaaSZeroAddress = "0x0000000000000000000000000000000000000000";
public uint chainId;
public string from;
public string to;
[FormerlySerializedAs("from")] public string fromAddress;
[FormerlySerializedAs("to")] public string toAddress;
public string autoGas;
public BigInteger? nonce;
public string value;
Expand All @@ -24,15 +25,15 @@ public class Transaction
public string[] tokenIds;
public string[] tokenAmounts;

public Transaction(uint chainId, string from, string to, string autoGas = null, BigInteger? nonce = null, string value = null, string calldata = null, string tokenAddress = null, string tokenAmount = null, string[] tokenIds = null, string[] tokenAmounts = null)
public Transaction(uint chainId, string fromAddress, string toAddress, string autoGas = null, BigInteger? nonce = null, string value = null, string calldata = null, string tokenAddress = null, string tokenAmount = null, string[] tokenIds = null, string[] tokenAmounts = null)
{
this.chainId = chainId;
this.from = from;
if (to == StringExtensions.ZeroAddress)
this.fromAddress = fromAddress;
if (toAddress == StringExtensions.ZeroAddress)
{
to = WaaSZeroAddress;
toAddress = WaaSZeroAddress;
}
this.to = to;
this.toAddress = toAddress;
this.autoGas = autoGas;
this.nonce = nonce;
this.value = value;
Expand All @@ -43,15 +44,15 @@ public Transaction(uint chainId, string from, string to, string autoGas = null,
this.tokenAmounts = tokenAmounts;
}

public Transaction(Chain chainId, string from, string to, string autoGas = null, BigInteger? nonce = null, string value = null, string calldata = null, string tokenAddress = null, string tokenAmount = null, string[] tokenIds = null, string[] tokenAmounts = null)
public Transaction(Chain chainId, string fromAddress, string toAddress, string autoGas = null, BigInteger? nonce = null, string value = null, string calldata = null, string tokenAddress = null, string tokenAmount = null, string[] tokenIds = null, string[] tokenAmounts = null)
{
this.chainId = (uint)chainId;
this.from = from;
if (to == StringExtensions.ZeroAddress)
this.fromAddress = fromAddress;
if (toAddress == StringExtensions.ZeroAddress)
{
to = WaaSZeroAddress;
toAddress = WaaSZeroAddress;
}
this.to = to;
this.toAddress = toAddress;
this.autoGas = autoGas;
this.nonce = nonce;
this.value = value;
Expand Down

0 comments on commit 7a16823

Please sign in to comment.