Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Support network arg for adding signatures to transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
raymens committed Mar 8, 2023
1 parent 529722a commit 693ffd6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stellar-dotnet-sdk/TransactionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public void Sign(byte[] preimage)
/// </summary>
/// <param name="publicKey">The public key of the signer</param>
/// <param name="signature">The base64 value of the signature XDR</param>
public void Sign(string publicKey, string signature)
/// <param name="network">The network <see cref="Network"/> the transaction will be sent to.</param>
public void Sign(string publicKey, string signature, Network network = null)
{
if (publicKey == null)
throw new ArgumentNullException(nameof(publicKey), "public key cannot be null");
Expand All @@ -138,7 +139,7 @@ public void Sign(string publicKey, string signature)
throw new ArgumentException("Invalid public key", nameof(publicKey));
}

if (!keyPair.Verify(Hash(), signatureObj.InnerValue))
if (!keyPair.Verify(Hash(network), signatureObj.InnerValue))
throw new ArgumentException("Invalid signature", nameof(signature));

var decoratedSignature = new DecoratedSignature
Expand Down Expand Up @@ -196,4 +197,4 @@ public string ToEnvelopeXdrBase64(TransactionXdrVersion version = TransactionXdr
}

}
}
}

0 comments on commit 693ffd6

Please sign in to comment.