Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/block-core/angor
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony committed Oct 16, 2023
2 parents fa7dbb3 + 6241562 commit 04e8f0b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:

env:
PROJECT_NAME: 'Blockcore.AtomicSwaps'
SOLUTION_PATH: 'src/Blockcore.AtomicSwaps.sln'
PROJECT_PATH: 'src/Blockcore.AtomicSwaps.Server/Blockcore.AtomicSwaps.Server.csproj'
SOLUTION_PATH: 'src/Angor.sln'
PROJECT_PATH: 'src/Angor/Server/Angor.Server.csproj'
BUILD_CONFIGURATION: 'Release'

steps:
Expand Down
14 changes: 0 additions & 14 deletions src/Angor/Client/Pages/Recover.razor
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@

private async Task FindInvestments()
{
var network = _NetworkConfiguration.GetNetwork();

var trxs = await _IndexerService.GetInvestmentsAsync(project.ProjectIdentifier);

var trx = trxs.First(f => f.TransactionId == recoverySigs.TransactionId);
Expand Down Expand Up @@ -364,8 +362,6 @@

private async Task PrepareToRecoverCoins()
{
var network = _NetworkConfiguration.GetNetwork();

var operationResult = await notificationComponent.LongOperation(async () =>
{
var feeEstimation = await _WalletOperations.GetFeeEstimationAsync();
Expand Down Expand Up @@ -418,8 +414,6 @@
{
showRecoveryModal = false;

var network = _NetworkConfiguration.GetNetwork();

storage.AddOrUpdateSignatures(recoverySigs);

var response = await _WalletOperations.PublishTransactionAsync(network, recoveryTransaction);
Expand All @@ -442,8 +436,6 @@

private async Task PrepareToReleaseCoins()
{
var network = _NetworkConfiguration.GetNetwork();

var operationResult = await notificationComponent.LongOperation(async () =>
{
var feeEstimation = await _WalletOperations.GetFeeEstimationAsync();
Expand Down Expand Up @@ -484,8 +476,6 @@
{
showRecoveryReleaseModal = false;

var network = _NetworkConfiguration.GetNetwork();

storage.AddOrUpdateSignatures(recoverySigs);

var response = await _WalletOperations.PublishTransactionAsync(network, releaseRecoveryTransaction);
Expand All @@ -509,8 +499,6 @@

private async Task PrepareEndOfProjectCoins()
{
var network = _NetworkConfiguration.GetNetwork();

var operationResult = await notificationComponent.LongOperation(async () =>
{
var feeEstimation = await _WalletOperations.GetFeeEstimationAsync();
Expand Down Expand Up @@ -547,8 +535,6 @@
{
showEndOfProjectModal = false;

var network = _NetworkConfiguration.GetNetwork();

storage.AddOrUpdateSignatures(recoverySigs);

var response = await _WalletOperations.PublishTransactionAsync(network, endOfProjectTransaction);
Expand Down
8 changes: 5 additions & 3 deletions src/Angor/Client/Pages/Wallet.razor
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@

<div class="mb-3">
<span class="fs-4">Confirmed balance: </span>
<span class="fs-3"><strong> @Money.Satoshis(localAccountInfo.TotalBalance).ToUnit(MoneyUnit.BTC) BTC</strong></span> <!-- replace this with actual balance -->
<span class="fs-3"><strong> @Money.Satoshis(localAccountInfo.TotalBalance).ToUnit(MoneyUnit.BTC) @symbol</strong></span> <!-- replace this with actual balance -->
</div>

@if (localAccountInfo.TotalUnConfirmedBalance > 0)
{
<div class="mb-3">
<span class="fs-6">Unconfirmed balance: </span>
<span class="fs-5"> @Money.Satoshis(localAccountInfo.TotalUnConfirmedBalance).ToUnit(MoneyUnit.BTC) BTC</span> <!-- replace this with actual unconfirmed balance -->
<span class="fs-5"> @Money.Satoshis(localAccountInfo.TotalUnConfirmedBalance).ToUnit(MoneyUnit.BTC) @symbol</span> <!-- replace this with actual unconfirmed balance -->
</div>
}

Expand Down Expand Up @@ -425,7 +425,7 @@

private FeeEstimations FeeEstimations = new ();


string symbol = "BTC";

// Max index for the range input
private const int FeeMin = 1;
Expand All @@ -439,6 +439,8 @@
if (hasWallet)
{
localAccountInfo = GetAccountInfoFromStorage();
var network = _networkConfiguration.GetNetwork();
symbol = network.CoinTicker;
}
return Task.CompletedTask;
}
Expand Down
9 changes: 8 additions & 1 deletion src/Angor/Client/Shared/BaseComponent.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
using Angor.Client.Storage;
using Angor.Shared;
using Blockcore.Networks;
using Microsoft.AspNetCore.Components;

namespace Angor.Client.Shared
{
public class BaseComponent : ComponentBase
{
[Inject]
protected INetworkConfiguration _networkConfiguration { get; set; }

[Inject]
protected IWalletStorage _walletStorage { get; set; }

[Inject]
protected NavigationManager NavigationManager { get; set; }


public NotificationComponent notificationComponent;
protected bool hasWallet { get; set; }

protected Network network { get; set; }

protected void SharedMethod()
{
// Shared logic here...
Expand All @@ -23,6 +29,7 @@ protected void SharedMethod()
protected override void OnInitialized()
{
hasWallet = _walletStorage.HasWallet();
network = _networkConfiguration.GetNetwork();
}
}
}

0 comments on commit 04e8f0b

Please sign in to comment.