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

Commit

Permalink
Added SubmitTransaction FeeBump overloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirbyrawr committed Dec 22, 2020
1 parent a259df8 commit 91e4106
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
27 changes: 27 additions & 0 deletions stellar-dotnet-sdk-test/ServerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,33 @@ public async Task TestSubmitFeeBumpTransactionEnvelopeBase64()
Assert.IsNull(response.SubmitTransactionResponseExtras);
}

[TestMethod]
public async Task TestSubmitFeeBumpTransactionWithoutOptions()
{
var json = File.ReadAllText(Path.Combine("testdata", "serverSuccess.json"));
When().Returns(ResponseMessage(HttpOk, json));

var response = await _server.SubmitTransaction(BuildFeeBumpTransaction());
Assert.IsTrue(response.IsSuccess());
Assert.AreEqual(response.Ledger, (uint)826150);
Assert.AreEqual(response.Hash, "2634d2cf5adcbd3487d1df042166eef53830115844fdde1588828667bf93ff42");
Assert.IsNull(response.SubmitTransactionResponseExtras);
}

[TestMethod]
public async Task TestSubmitFeeBumpTransactionWithOptions()
{
var json = File.ReadAllText(Path.Combine("testdata", "serverSuccess.json"));
When().Returns(ResponseMessage(HttpOk, json));

var response = await _server.SubmitTransaction(
BuildFeeBumpTransaction(), new SubmitTransactionOptions { SkipMemoRequiredCheck = false });
Assert.IsTrue(response.IsSuccess());
Assert.AreEqual(response.Ledger, (uint)826150);
Assert.AreEqual(response.Hash, "2634d2cf5adcbd3487d1df042166eef53830115844fdde1588828667bf93ff42");
Assert.IsNull(response.SubmitTransactionResponseExtras);
}

[TestMethod]
public async Task TestSubmitTransactionWithoutOptions()
{
Expand Down
12 changes: 12 additions & 0 deletions stellar-dotnet-sdk/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ public Task<SubmitTransactionResponse> SubmitTransaction(string transactionEnvel
return SubmitTransaction(transactionEnvelopeBase64, options);
}

public Task<SubmitTransactionResponse> SubmitTransaction(FeeBumpTransaction feeBump)
{
var options = new SubmitTransactionOptions { FeeBumpTransaction = true };
return SubmitTransaction(feeBump.ToEnvelopeXdrBase64(), options);
}

public Task<SubmitTransactionResponse> SubmitTransaction(FeeBumpTransaction feeBump, SubmitTransactionOptions options)
{
options.FeeBumpTransaction = true;
return SubmitTransaction(feeBump.ToEnvelopeXdrBase64(), options);
}

/// <summary>
/// Submit a transaction to the network.
///
Expand Down

0 comments on commit 91e4106

Please sign in to comment.