From 693ffd6a1aee1ece294a381d081dea3bbb23962e Mon Sep 17 00:00:00 2001 From: Raymen Scholten Date: Wed, 8 Mar 2023 13:01:51 +0100 Subject: [PATCH] Support network arg for adding signatures to transaction --- stellar-dotnet-sdk/TransactionBase.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stellar-dotnet-sdk/TransactionBase.cs b/stellar-dotnet-sdk/TransactionBase.cs index 42ea39df..0e34f68e 100644 --- a/stellar-dotnet-sdk/TransactionBase.cs +++ b/stellar-dotnet-sdk/TransactionBase.cs @@ -111,7 +111,8 @@ public void Sign(byte[] preimage) /// /// The public key of the signer /// The base64 value of the signature XDR - public void Sign(string publicKey, string signature) + /// The network the transaction will be sent to. + public void Sign(string publicKey, string signature, Network network = null) { if (publicKey == null) throw new ArgumentNullException(nameof(publicKey), "public key cannot be null"); @@ -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 @@ -196,4 +197,4 @@ public string ToEnvelopeXdrBase64(TransactionXdrVersion version = TransactionXdr } } -} \ No newline at end of file +}