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

Protocol 13 Support #266

Merged
merged 2 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions stellar-dotnet-sdk-test/AccountTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ public void TestWithStringArgumentIsKeyPair()
Assert.AreEqual(account.KeyPair.AccountId, keypair.AccountId);
}

[TestMethod]
public void TestWithMuxedAccount()
{
var keypair = KeyPair.Random();
var muxed = new MuxedAccountMed25519(keypair, 10);
var account = new Account(muxed, 7);
Assert.AreNotEqual(account.AccountId, keypair.AccountId);
Assert.AreEqual(account.AccountId, muxed.AccountId);
Assert.AreEqual(account.KeyPair.AccountId, keypair.AccountId);
}

[TestMethod]
public void TestGetIncrementedSequenceNumber()
{
Expand Down
15 changes: 8 additions & 7 deletions stellar-dotnet-sdk-test/FeeBumpTransactionTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Security.Cryptography;
using dotnetstandard_bip32;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using stellar_dotnet_sdk;

Expand Down Expand Up @@ -119,12 +120,11 @@ public void TestFromEnvelopeXdr()
[TestMethod]
public void TestMuxedAccounts()
{
var originalXdr =
"AAAABQAAAQAAAAAAAAAAAOBIkbYY5QzL8f2UfKNhk7DK7LK0fzLTBZqhzn3ov5sSAAAAAAAAAMgAAAACAAAAAHN2/eiOTNYcwPspSheGs/HQYfXy8cpXRl+qkyIRuUbWAAAAZAAAAAAAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAD0hhcHB5IGJpcnRoZGF5IQAAAAABAAAAAAAAAAEAAAAA4EiRthjlDMvx/ZR8o2GTsMrssrR/MtMFmqHOfei/mxIAAAAAAAAABKgXyAAAAAAAAAAAARG5RtYAAABAr3fcOe3WnFeWx/UHkJifzU8vF5izH4yJX0QZsx1R8Rx0NZTJLIiR3Ml5+OlHl6N1dWn8peiwaY1RD4OsgGXODQAAAAAAAAAA";
var tx = TransactionBuilder.FromEnvelopeXdr(originalXdr);
var muxed = new MuxedAccountMed25519(FeeSource, 0);
var tx = TransactionBuilder.BuildFeeBumpTransaction(muxed, InnerTransaction, 100);
var xdr = tx.ToUnsignedEnvelopeXdr();
var txMuxed = MuxedAccount.FromXdrMuxedAccount(xdr.FeeBump.Tx.FeeSource);
Assert.IsNotNull(txMuxed.Address);
Assert.AreEqual(muxed.Address, txMuxed.Address);
}

[TestMethod]
Expand All @@ -146,22 +146,23 @@ public void TestTransactionHash()
var innerTx = CreateInnerTransaction(100, network);

Assert.AreEqual(
"fa21347ad5eafa4d6ef5355184984b12f2ce8d6762c40f4547f70dcddffb9cb1",
"95dcf35a43a1a05bcd50f3eb148b31127829a9460dc32a17c4a7f7c4677409d4",
Util.BytesToHex(innerTx.Hash(network)).ToLowerInvariant());

var feeSource = KeyPair.FromAccountId("GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3");
var feeBumpTx = TransactionBuilder.BuildFeeBumpTransaction(feeSource, innerTx, 200);

Assert.AreEqual(
"76a83f93acad3aaabfbc5d1739192d7f9b6f3707c9cab5a1254e10aaa81a1272",
"382b1588ee8b315177a34ae96ebcaeb81c0ad3e04fee7c6b5a583b826517e1e4",
Util.BytesToHex(feeBumpTx.Hash(network)).ToLowerInvariant());
}

private Transaction CreateInnerTransaction(uint fee, Network network)
{
var source = KeyPair.FromSecretSeed("SCH27VUZZ6UAKB67BDNF6FA42YMBMQCBKXWGMFD5TZ6S5ZZCZFLRXKHS");
var destination =
KeyPair.FromAccountId("GCRMOGHI75GRWXBBRPFOBMVZ3HZFSEBAEY6JZ7YWV266VCXQOSEUCIWX");
MuxedAccountMed25519.FromMuxedAccountId(
"MCAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITKNOG");
var account = new Account(source, 2908908335136768L);
var innerTx = new TransactionBuilder(account)
.AddOperation(
Expand Down
19 changes: 19 additions & 0 deletions stellar-dotnet-sdk-test/MuxedAccountTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using stellar_dotnet_sdk;

namespace stellar_dotnet_sdk_test
{
[TestClass]
public class MuxedAccountTest
{
[TestMethod]
public void TestFromAccountId()
{
var muxed = MuxedAccountMed25519.FromMuxedAccountId(
"MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY");
Assert.AreEqual(1234UL, muxed.Id);
Assert.AreEqual("GAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSTVY", muxed.Key.Address);
Assert.AreEqual("MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY", muxed.Address);
}
}
}
16 changes: 16 additions & 0 deletions stellar-dotnet-sdk-test/ServerCheckMemoRequiredTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,22 @@ public async Task TestCheckFeeBumpTransaction()
await _server.CheckMemoRequired(tx);
}

[TestMethod]
public async Task TestSkipCheckIfDestinationIsMuxedAccount()
{
var accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA";

var muxed = MuxedAccountMed25519.FromMuxedAccountId(
"MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY");

var payment = new PaymentOperation
.Builder(muxed, new AssetTypeNative(), "100.500")
.Build();

var tx = BuildTransaction(accountId, new Operation[] { payment }, Memo.None(), skipDefaultOp: true);
await _server.CheckMemoRequired(tx);
}

private string BuildAccountResponse(string accountId, Dictionary<string, string> data = null)
{
var accountData = data ?? new Dictionary<string, string>();
Expand Down
36 changes: 36 additions & 0 deletions stellar-dotnet-sdk-test/StrKeyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ public void TestDecodeInvalidSeed()
StrKey.DecodeCheck(StrKey.VersionByte.SEED, seed);
}

[TestMethod]
public void TestDecodeEncodeMuxedAccount()
{
var address = "MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6";
var (id, key) = StrKey.DecodeStellarMuxedAccount(address);
Assert.IsTrue(StrKey.IsValidMuxedAccount(address));
Assert.AreEqual(0UL, id);
var encodedKey = StrKey.EncodeStellarAccountId(key);
Assert.AreEqual("GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ", encodedKey);
Assert.AreEqual(address, StrKey.EncodeStellarMuxedAccount(key, id));
}

[TestMethod]
public void TestDecodeEncodeMuxedAccountWithLargeId()
{
var address = "MCAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITKNOG";
var (id, key) = StrKey.DecodeStellarMuxedAccount(address);
Assert.IsTrue(StrKey.IsValidMuxedAccount(address));
Assert.AreEqual(9223372036854775808UL, id);
var encodedKey = StrKey.EncodeStellarAccountId(key);
Assert.AreEqual("GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ", encodedKey);
Assert.AreEqual(address, StrKey.EncodeStellarMuxedAccount(key, id));
}

[TestMethod]
public void IsValidEd25519PublicKey()
{
Expand All @@ -55,6 +79,18 @@ public void IsNotValidEd25519PublicKey(string address)
Assert.IsFalse(result);
}

[TestMethod]
//[DataRow("MCAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITKNOGA", DisplayName = "Invalid length (congruent to 6 mod 8)")]
[DataRow("MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITIADJPA", DisplayName = "Invalid length (base-32 decoding should yield 43 bytes, not 44)")]
[DataRow("M4AAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITIU2K", DisplayName = "Invalid algorithm (low 3 bits of version byte are 7)")]
//[DataRow("MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6", DisplayName = "Padding bytes are not allowed")]
[DataRow("MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL4", DisplayName = "Invalid checksum")]
public void IsNotValidMuxedAccount(string address)
{
var result = StrKey.IsValidMuxedAccount(address);
Assert.IsFalse(result);
}

[TestMethod]
public void IsValidEd25519SecretSeed()
{
Expand Down
129 changes: 114 additions & 15 deletions stellar-dotnet-sdk-test/TransactionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public void TestOldTransactionBuilder()

Assert.AreEqual(
"AAAAAF7FIiDToW1fOYUFBC0dmyufJbFTOa2GQESGz+S2h5ViAAAAZAAKVaMAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAA7eBSYbzcL5UKo7oXO24y1ckX+XuCtkDsyNHOp1n1bxAAAAAEqBfIAAAAAAAAAAABtoeVYgAAAEDLki9Oi700N60Lo8gUmEFHbKvYG4QSqXiLIt9T0ru2O5BphVl/jR9tYtHAD+UeDYhgXNgwUxqTEu1WukvEyYcD",
transaction.ToEnvelopeXdrBase64(TransactionBase.TransactionXdrVersion.V0));

Assert.AreEqual(
"AAAAAgAAAABexSIg06FtXzmFBQQtHZsrnyWxUzmthkBEhs/ktoeVYgAAAGQAClWjAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAO3gUmG83C+VCqO6FztuMtXJF/l7grZA7MjRzqdZ9W8QAAAABKgXyAAAAAAAAAAAAbaHlWIAAABAy5IvTou9NDetC6PIFJhBR2yr2BuEEql4iyLfU9K7tjuQaYVZf40fbWLRwA/lHg2IYFzYMFMakxLtVrpLxMmHAw==",
transaction.ToEnvelopeXdrBase64());

Assert.AreEqual(transaction.SourceAccount.AccountId, source.AccountId);
Expand All @@ -70,6 +74,10 @@ public void TestBuilderSuccessTestnet()

Assert.AreEqual(
"AAAAAF7FIiDToW1fOYUFBC0dmyufJbFTOa2GQESGz+S2h5ViAAAAZAAKVaMAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAA7eBSYbzcL5UKo7oXO24y1ckX+XuCtkDsyNHOp1n1bxAAAAAEqBfIAAAAAAAAAAABtoeVYgAAAEDLki9Oi700N60Lo8gUmEFHbKvYG4QSqXiLIt9T0ru2O5BphVl/jR9tYtHAD+UeDYhgXNgwUxqTEu1WukvEyYcD",
transaction.ToEnvelopeXdrBase64(TransactionBase.TransactionXdrVersion.V0));

Assert.AreEqual(
"AAAAAgAAAABexSIg06FtXzmFBQQtHZsrnyWxUzmthkBEhs/ktoeVYgAAAGQAClWjAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAO3gUmG83C+VCqO6FztuMtXJF/l7grZA7MjRzqdZ9W8QAAAABKgXyAAAAAAAAAAAAbaHlWIAAABAy5IvTou9NDetC6PIFJhBR2yr2BuEEql4iyLfU9K7tjuQaYVZf40fbWLRwA/lHg2IYFzYMFMakxLtVrpLxMmHAw==",
transaction.ToEnvelopeXdrBase64());

Assert.AreEqual(transaction.SourceAccount.AccountId, source.AccountId);
Expand Down Expand Up @@ -129,6 +137,10 @@ public void TestBuilderMemoText()

Assert.AreEqual(
"AAAAAF7FIiDToW1fOYUFBC0dmyufJbFTOa2GQESGz+S2h5ViAAAAZAAKVaMAAAABAAAAAAAAAAEAAAAMSGVsbG8gd29ybGQhAAAAAQAAAAAAAAAAAAAAAO3gUmG83C+VCqO6FztuMtXJF/l7grZA7MjRzqdZ9W8QAAAABKgXyAAAAAAAAAAAAbaHlWIAAABAxzofBhoayuUnz8t0T1UNWrTgmJ+lCh9KaeOGu2ppNOz9UGw0abGLhv+9oWQsstaHx6YjwWxL+8GBvwBUVWRlBQ==",
transaction.ToEnvelopeXdrBase64(TransactionBase.TransactionXdrVersion.V0));

Assert.AreEqual(
"AAAAAgAAAABexSIg06FtXzmFBQQtHZsrnyWxUzmthkBEhs/ktoeVYgAAAGQAClWjAAAAAQAAAAAAAAABAAAADEhlbGxvIHdvcmxkIQAAAAEAAAAAAAAAAAAAAADt4FJhvNwvlQqjuhc7bjLVyRf5e4K2QOzI0c6nWfVvEAAAAASoF8gAAAAAAAAAAAG2h5ViAAAAQMc6HwYaGsrlJ8/LdE9VDVq04JifpQofSmnjhrtqaTTs/VBsNGmxi4b/vaFkLLLWh8emI8FsS/vBgb8AVFVkZQU=",
transaction.ToEnvelopeXdrBase64());

var transaction2 = Transaction.FromEnvelopeXdr(transaction.ToEnvelopeXdr());
Expand Down Expand Up @@ -160,10 +172,7 @@ public void TestBuilderTimeBounds()
transaction.Sign(source);

// Convert transaction to binary XDR and back again to make sure timebounds are correctly de/serialized.
var bytes = transaction.ToEnvelopeXdrBase64().ToCharArray();
var xdrDataInputStream = new XdrDataInputStream(Convert.FromBase64CharArray(bytes, 0, bytes.Length));

var decodedTransaction = XdrTransaction.Decode(xdrDataInputStream);
var decodedTransaction = transaction.ToEnvelopeXdr().V1.Tx;

Assert.AreEqual(decodedTransaction.TimeBounds.MinTime.InnerValue.InnerValue, 42U);
Assert.AreEqual(decodedTransaction.TimeBounds.MaxTime.InnerValue.InnerValue, 1337U);
Expand Down Expand Up @@ -196,10 +205,7 @@ public void TestBuilderFee()
.Build();

// Convert transaction to binary XDR and back again to make sure fee is correctly de/serialized.
var bytes = transaction.ToUnsignedEnvelopeXdrBase64().ToCharArray();
var xdrDataInputStream = new XdrDataInputStream(Convert.FromBase64CharArray(bytes, 0, bytes.Length));

var decodedTransaction = XdrTransaction.Decode(xdrDataInputStream);
var decodedTransaction = transaction.ToUnsignedEnvelopeXdr().V1.Tx;

Assert.AreEqual(decodedTransaction.Fee.InnerValue, 173 * 2U);

Expand Down Expand Up @@ -238,7 +244,12 @@ public void TestBuilderSuccessPublic()

Assert.AreEqual(
"AAAAAF7FIiDToW1fOYUFBC0dmyufJbFTOa2GQESGz+S2h5ViAAAAZAAKVaMAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAA7eBSYbzcL5UKo7oXO24y1ckX+XuCtkDsyNHOp1n1bxAAAAAEqBfIAAAAAAAAAAABtoeVYgAAAEDzfR5PgRFim5Wdvq9ImdZNWGBxBWwYkQPa9l5iiBdtPLzAZv6qj+iOfSrqinsoF0XrLkwdIcZQVtp3VRHhRoUE",
transaction.ToEnvelopeXdrBase64(TransactionBase.TransactionXdrVersion.V0));

Assert.AreEqual(
"AAAAAgAAAABexSIg06FtXzmFBQQtHZsrnyWxUzmthkBEhs/ktoeVYgAAAGQAClWjAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAO3gUmG83C+VCqO6FztuMtXJF/l7grZA7MjRzqdZ9W8QAAAABKgXyAAAAAAAAAAAAbaHlWIAAABA830eT4ERYpuVnb6vSJnWTVhgcQVsGJED2vZeYogXbTy8wGb+qo/ojn0q6op7KBdF6y5MHSHGUFbad1UR4UaFBA==",
transaction.ToEnvelopeXdrBase64());

}

[TestMethod]
Expand Down Expand Up @@ -426,15 +437,80 @@ public void TestFromXdrWithMemoId()
[TestMethod]
public void TestTransactionWithMuxedAccount()
{
var originalXdr =
"AAAAAgAAAQAAAAAAAAAAAHN2/eiOTNYcwPspSheGs/HQYfXy8cpXRl+qkyIRuUbWAAAAZAAAAAAAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAD0hhcHB5IGJpcnRoZGF5IQAAAAABAAAAAAAAAAEAAAAA4EiRthjlDMvx/ZR8o2GTsMrssrR/MtMFmqHOfei/mxIAAAAAAAAABKgXyAAAAAAAAAAAAA==";
var tx = Transaction.FromEnvelopeXdr(originalXdr);
var xdr = tx.ToUnsignedEnvelopeXdrBase64(TransactionBase.TransactionXdrVersion.V1);
Assert.AreEqual(originalXdr, xdr);
var network = new Network("Standalone Network ; February 2017");
var source = KeyPair.FromSecretSeed(network.NetworkId);
var txSource = new MuxedAccountMed25519(source, 0);
var account = new Account(txSource, 7);
var destination = KeyPair.FromAccountId("GDQERENWDDSQZS7R7WKHZI3BSOYMV3FSWR7TFUYFTKQ447PIX6NREOJM");
var amount = "2000";
var asset = new AssetTypeNative();
var tx = new TransactionBuilder(account)
.SetFee(100)
.AddTimeBounds(new TimeBounds(0, 0))
.AddOperation(
new PaymentOperation.Builder(destination, asset, amount).Build())
.AddMemo(new MemoText("Happy birthday!"))
.Build();
var xdr = tx.ToUnsignedEnvelopeXdrBase64();
var back = TransactionBuilder.FromEnvelopeXdr(xdr) as Transaction;
Assert.IsNotNull(back);
Assert.AreEqual(tx.SourceAccount.Address, back.SourceAccount.Address);
CollectionAssert.AreEqual(tx.SourceAccount.PublicKey, back.SourceAccount.PublicKey);
Assert.AreEqual(txSource.Address, back.SourceAccount.Address);
}

[TestMethod]
public void TestSignatureBaseNoNetwork()
{
var network = new Network("Standalone Network ; February 2017");
var source = KeyPair.FromSecretSeed(network.NetworkId);
var txSource = new MuxedAccountMed25519(source, 0);
var account = new Account(txSource, 7);
var destination = KeyPair.FromAccountId("GDQERENWDDSQZS7R7WKHZI3BSOYMV3FSWR7TFUYFTKQ447PIX6NREOJM");
var amount = "2000";
var asset = new AssetTypeNative();
var tx = new TransactionBuilder(account)
.SetFee(100)
.AddTimeBounds(new TimeBounds(0, 0))
.AddOperation(
new PaymentOperation.Builder(destination, asset, amount).Build())
.AddMemo(new MemoText("Happy birthday!"))
.Build();

try
{
tx.SignatureBase(null);
}
catch (Exception e)
{
Assert.IsNotNull(e);
}
}

[TestMethod]
public void TestToXdrWithMuxedAccount()
{
var network = new Network("Standalone Network ; February 2017");
var source = KeyPair.FromSecretSeed(network.NetworkId);
var txSource = new MuxedAccountMed25519(source, 0);
var account = new Account(txSource, 7);
var destination = KeyPair.FromAccountId("GDQERENWDDSQZS7R7WKHZI3BSOYMV3FSWR7TFUYFTKQ447PIX6NREOJM");
var amount = "2000";
var asset = new AssetTypeNative();
var tx = new TransactionBuilder(account)
.SetFee(100)
.AddTimeBounds(new TimeBounds(0, 0))
.AddOperation(
new PaymentOperation.Builder(destination, asset, amount).Build())
.AddMemo(new MemoText("Happy birthday!"))
.Build();

try
{
tx.ToXdr();
}
catch (Exception e)
{
Assert.AreEqual(e.Message, "TransactionEnvelope V0 expects a KeyPair source account");
}
}

[TestMethod]
Expand Down Expand Up @@ -466,5 +542,28 @@ public void TestToUnsignedEnvelopeXdrWithSignatures()
Assert.AreEqual(e.Message, "Transaction must not be signed. Use ToEnvelopeXDR.");
}
}

[TestMethod]
public void TestTransactionFeeOverflow()
{
var source = KeyPair.Random();
var txSource = new MuxedAccountMed25519(source, 0);
var account = new Account(txSource, 7);
var destination = KeyPair.FromAccountId("GDQERENWDDSQZS7R7WKHZI3BSOYMV3FSWR7TFUYFTKQ447PIX6NREOJM");
var amount = "2000";
var asset = new AssetTypeNative();
Assert.ThrowsException<OverflowException>(() =>
{
var tx = new TransactionBuilder(account)
.SetFee(UInt32.MaxValue)
.AddTimeBounds(new TimeBounds(0, 0))
.AddOperation(
new PaymentOperation.Builder(destination, asset, amount).Build())
.AddOperation(
new PaymentOperation.Builder(destination, asset, amount).Build())
.Build();

});
}
}
}
23 changes: 23 additions & 0 deletions stellar-dotnet-sdk-test/WebAuthenticationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,29 @@ public void TestBuildChallengeTransactionWithOptions()
CheckOperation(back, clientAccountId.Address);
}

[TestMethod]
public void TestBuildChallengeTransactionFailsWithMuxedAccount()
{
var serverKeypair = KeyPair.Random();
var clientAccountId =
MuxedAccountMed25519.FromMuxedAccountId(
"MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY");
var anchorName = "NET";

var nonce = new byte[48];
Array.Clear(nonce, 0, nonce.Length);

var now = new DateTimeOffset();
var duration = TimeSpan.FromMinutes(10.0);

Assert.ThrowsException<InvalidWebAuthenticationException>(() =>
{
var tx = WebAuthentication
.BuildChallengeTransaction(serverKeypair, clientAccountId.Address, anchorName, nonce, now, duration,
Network.Test());
});
}

[TestMethod]
public void TestVerifyChallengeTransactionReturnsTrueForValidTransaction()
{
Expand Down
4 changes: 2 additions & 2 deletions stellar-dotnet-sdk-test/stellar-dotnet-sdk-test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@
<None Update="testdata\transactionPage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="testdata\transactionFeeBump.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<None Update="testdata\transactionFeeBump.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="testdata\transactionTransaction.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
Loading