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

Commit 693ffd6

Browse files
authored
Support network arg for adding signatures to transaction
1 parent 529722a commit 693ffd6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stellar-dotnet-sdk/TransactionBase.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public void Sign(byte[] preimage)
111111
/// </summary>
112112
/// <param name="publicKey">The public key of the signer</param>
113113
/// <param name="signature">The base64 value of the signature XDR</param>
114-
public void Sign(string publicKey, string signature)
114+
/// <param name="network">The network <see cref="Network"/> the transaction will be sent to.</param>
115+
public void Sign(string publicKey, string signature, Network network = null)
115116
{
116117
if (publicKey == null)
117118
throw new ArgumentNullException(nameof(publicKey), "public key cannot be null");
@@ -138,7 +139,7 @@ public void Sign(string publicKey, string signature)
138139
throw new ArgumentException("Invalid public key", nameof(publicKey));
139140
}
140141

141-
if (!keyPair.Verify(Hash(), signatureObj.InnerValue))
142+
if (!keyPair.Verify(Hash(network), signatureObj.InnerValue))
142143
throw new ArgumentException("Invalid signature", nameof(signature));
143144

144145
var decoratedSignature = new DecoratedSignature
@@ -196,4 +197,4 @@ public string ToEnvelopeXdrBase64(TransactionXdrVersion version = TransactionXdr
196197
}
197198

198199
}
199-
}
200+
}

0 commit comments

Comments
 (0)