Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hawthorne-abendsen committed Jul 23, 2020
1 parent 4378a40 commit 61be805
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Centaurus.Common/Centaurus.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.7.82"/>
<PackageReference Include="NLog" Version="4.6.7"/>
<PackageReference Include="stellar-dotnet-sdk" Version="3.0.13"/>
<PackageReference Include="CommandLineParser" Version="2.7.82" />
<PackageReference Include="NLog" Version="4.6.7" />
<PackageReference Include="stellar-dotnet-sdk" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Centaurus.Xdr\Centaurus.Xdr.csproj"/>
<ProjectReference Include="..\Centaurus.Xdr\Centaurus.Xdr.csproj" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions Centaurus.Common/Stellar/AccountData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public AccountData(KeyPair keyPair, long sequenceNumber)
if (sequenceNumber < 1)
throw new ArgumentNullException(nameof(sequenceNumber));
SequenceNumber = sequenceNumber;
MuxedAccount = new MuxedAccountMed25519(KeyPair, 0);
}

public string AccountId => KeyPair.AccountId;
Expand All @@ -23,6 +24,8 @@ public AccountData(KeyPair keyPair, long sequenceNumber)

public long IncrementedSequenceNumber => SequenceNumber + 1;

public IAccountId MuxedAccount { get; }

public void IncrementSequenceNumber()
{
SequenceNumber++;
Expand Down
2 changes: 1 addition & 1 deletion Centaurus.Common/Stellar/TransactionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static Transaction BuildBumpSequenceTransaction(TransactionBuilderOptions

public static Transaction BuildTransaction(TransactionBuilderOptions options, params Operation[] operations)
{
var builder = new Transaction.Builder(options.Source);
var builder = new TransactionBuilder(options.Source);
builder.SetFee(options.Fee);
if (!string.IsNullOrWhiteSpace(options.Memo))
builder.AddMemo(Memo.Text(options.Memo));
Expand Down
2 changes: 1 addition & 1 deletion Centaurus.Domain/Constellation/ConstellationInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private async Task<long> BuildAndConfigureVault(stellar_dotnet_sdk.responses.Acc

var sourceAccount = await Global.StellarNetwork.Server.Accounts.Account(Global.Settings.KeyPair.AccountId);

var transactionBuilder = new Transaction.Builder(sourceAccount);
var transactionBuilder = new TransactionBuilder(sourceAccount);
transactionBuilder.SetFee(10_000);

var existingTrustlines = vaultAccount.Balances
Expand Down
2 changes: 1 addition & 1 deletion Centaurus.Domain/Ledger/LedgerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private void AddVaultPayments(ref List<PaymentBase> ledgerPayments, Transaction
//TODO: add only success or if transaction hash is in pending withdrawals
for (var i = 0; i < transaction.Operations.Length; i++)
{
if (PaymentsHelper.FromOperationResponse(transaction.Operations[i].ToOperationBody(), source, res, transaction.Hash(), out PaymentBase payment))
if (PaymentsHelper.FromOperationResponse(transaction.Operations[i].ToOperationBody(), source.SigningKey, res, transaction.Hash(), out PaymentBase payment))
ledgerPayments.Add(payment);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override Task<ResultMessage> Process(MessageEnvelope envelope, EffectProc
if (payment.TransactionHash == null)//if TransactionHash is not null than it's test
{
var outputStream = new stellar_dotnet_sdk.xdr.XdrDataOutputStream();
stellar_dotnet_sdk.xdr.Transaction.Encode(outputStream, transaction.ToXdr());
stellar_dotnet_sdk.xdr.Transaction.Encode(outputStream, transaction.ToXdrV1());

payment.TransactionXdr = outputStream.ToArray();
payment.TransactionHash = transaction.Hash();
Expand Down
2 changes: 1 addition & 1 deletion Centaurus.Domain/helpers/PaymentsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static bool FromOperationResponse(Operation.OperationBody operation, stel
return result;

var amount = operation.PaymentOp.Amount.InnerValue;
var destKeypair = stellar_dotnet_sdk.KeyPair.FromXdrPublicKey(operation.PaymentOp.Destination.InnerValue);
var destKeypair = stellar_dotnet_sdk.KeyPair.FromPublicKey(operation.PaymentOp.Destination.Ed25519.InnerValue);
if (Global.Constellation.Vault.Equals((RawPubKey)destKeypair.PublicKey))
payment = new Deposit
{
Expand Down
10 changes: 5 additions & 5 deletions Centaurus.Test.Client/Centaurus.Test.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0"/>
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="stellar-dotnet-sdk" Version="3.0.13"/>
<PackageReference Include="stellar-dotnet-sdk" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Centaurus.Common\Centaurus.Common.csproj"/>
<ProjectReference Include="..\Centaurus.Domain\Centaurus.Domain.csproj"/>
<ProjectReference Include="..\Centaurus.Models\Centaurus.Models.csproj"/>
<ProjectReference Include="..\Centaurus.Common\Centaurus.Common.csproj" />
<ProjectReference Include="..\Centaurus.Domain\Centaurus.Domain.csproj" />
<ProjectReference Include="..\Centaurus.Models\Centaurus.Models.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Centaurus.Test.Domain/BaseQuantumHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task LedgerQuantumTest(int ledgerFrom, int ledgerTo, int amount, in
{
client1StartBalanceAmount = clientAccountBalance.Amount;

var transactionBuilder = new Transaction.Builder(Global.VaultAccount.GetAccount());
var transactionBuilder = new TransactionBuilder(Global.VaultAccount.GetAccount());
transactionBuilder.AddOperation(
new PaymentOperation.Builder(
withdrawalDest,
Expand Down
12 changes: 6 additions & 6 deletions Centaurus.Test.Domain/Centaurus.Test.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<None Remove="appsettings.json"/>
<None Remove="appsettings.json" />
</ItemGroup>

<ItemGroup>
Expand All @@ -24,18 +24,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.12.0"/>
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0"/>
<PackageReference Include="stellar-dotnet-sdk" Version="3.0.13"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="stellar-dotnet-sdk" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Centaurus.Domain\Centaurus.Domain.csproj"/>
<ProjectReference Include="..\Centaurus.Test.Utils\Centaurus.Test.Utils.csproj"/>
<ProjectReference Include="..\Centaurus.Domain\Centaurus.Domain.csproj" />
<ProjectReference Include="..\Centaurus.Test.Utils\Centaurus.Test.Utils.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Centaurus/Centaurus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="CommandLineParser" Version="2.7.82" />
<PackageReference Include="NLog" Version="4.6.7" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.8.6" />
<PackageReference Include="stellar-dotnet-sdk" Version="3.0.13" />
<PackageReference Include="stellar-dotnet-sdk" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 61be805

Please sign in to comment.