Skip to content

Commit

Permalink
sep for cov
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed May 23, 2024
1 parent 838b9bf commit 735ebc3
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions Thirdweb/Thirdweb.Transactions/ThirdwebTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,28 @@ public static async Task<ThirdwebTransaction> Create(ThirdwebClient client, IThi
var address = await wallet.GetAddress();
txInput.From ??= address;
txInput.Data ??= "0x";
return address != txInput.From
? throw new ArgumentException("Transaction sender (from) must match wallet address")
: client == null
? throw new ArgumentNullException(nameof(client))
: wallet == null
? throw new ArgumentNullException(nameof(wallet))
: chainId == 0
? throw new ArgumentException("Invalid Chain ID")
: new ThirdwebTransaction(client, wallet, txInput, chainId);

if (address != txInput.From)
{
throw new ArgumentException("Transaction sender (from) must match wallet address");
}

if (client == null)
{
throw new ArgumentNullException(nameof(client));
}

if (wallet == null)
{
throw new ArgumentNullException(nameof(wallet));
}

if (chainId == 0)
{
throw new ArgumentException("Invalid Chain ID");
}

return new ThirdwebTransaction(client, wallet, txInput, chainId);
}

public override string ToString()
Expand Down

0 comments on commit 735ebc3

Please sign in to comment.