diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 58bd3602..c49714ed 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -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: diff --git a/src/Angor/Client/Pages/Recover.razor b/src/Angor/Client/Pages/Recover.razor index 56956f1c..b9a4f911 100644 --- a/src/Angor/Client/Pages/Recover.razor +++ b/src/Angor/Client/Pages/Recover.razor @@ -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); @@ -364,8 +362,6 @@ private async Task PrepareToRecoverCoins() { - var network = _NetworkConfiguration.GetNetwork(); - var operationResult = await notificationComponent.LongOperation(async () => { var feeEstimation = await _WalletOperations.GetFeeEstimationAsync(); @@ -418,8 +414,6 @@ { showRecoveryModal = false; - var network = _NetworkConfiguration.GetNetwork(); - storage.AddOrUpdateSignatures(recoverySigs); var response = await _WalletOperations.PublishTransactionAsync(network, recoveryTransaction); @@ -442,8 +436,6 @@ private async Task PrepareToReleaseCoins() { - var network = _NetworkConfiguration.GetNetwork(); - var operationResult = await notificationComponent.LongOperation(async () => { var feeEstimation = await _WalletOperations.GetFeeEstimationAsync(); @@ -484,8 +476,6 @@ { showRecoveryReleaseModal = false; - var network = _NetworkConfiguration.GetNetwork(); - storage.AddOrUpdateSignatures(recoverySigs); var response = await _WalletOperations.PublishTransactionAsync(network, releaseRecoveryTransaction); @@ -509,8 +499,6 @@ private async Task PrepareEndOfProjectCoins() { - var network = _NetworkConfiguration.GetNetwork(); - var operationResult = await notificationComponent.LongOperation(async () => { var feeEstimation = await _WalletOperations.GetFeeEstimationAsync(); @@ -547,8 +535,6 @@ { showEndOfProjectModal = false; - var network = _NetworkConfiguration.GetNetwork(); - storage.AddOrUpdateSignatures(recoverySigs); var response = await _WalletOperations.PublishTransactionAsync(network, endOfProjectTransaction); diff --git a/src/Angor/Client/Pages/Wallet.razor b/src/Angor/Client/Pages/Wallet.razor index bd5b6d19..085fc1cc 100644 --- a/src/Angor/Client/Pages/Wallet.razor +++ b/src/Angor/Client/Pages/Wallet.razor @@ -123,14 +123,14 @@
Confirmed balance: - @Money.Satoshis(localAccountInfo.TotalBalance).ToUnit(MoneyUnit.BTC) BTC + @Money.Satoshis(localAccountInfo.TotalBalance).ToUnit(MoneyUnit.BTC) @symbol
@if (localAccountInfo.TotalUnConfirmedBalance > 0) {
Unconfirmed balance: - @Money.Satoshis(localAccountInfo.TotalUnConfirmedBalance).ToUnit(MoneyUnit.BTC) BTC + @Money.Satoshis(localAccountInfo.TotalUnConfirmedBalance).ToUnit(MoneyUnit.BTC) @symbol
} @@ -425,7 +425,7 @@ private FeeEstimations FeeEstimations = new (); - + string symbol = "BTC"; // Max index for the range input private const int FeeMin = 1; @@ -439,6 +439,8 @@ if (hasWallet) { localAccountInfo = GetAccountInfoFromStorage(); + var network = _networkConfiguration.GetNetwork(); + symbol = network.CoinTicker; } return Task.CompletedTask; } diff --git a/src/Angor/Client/Shared/BaseComponent.cs b/src/Angor/Client/Shared/BaseComponent.cs index 4bdaa0ad..5e374b05 100644 --- a/src/Angor/Client/Shared/BaseComponent.cs +++ b/src/Angor/Client/Shared/BaseComponent.cs @@ -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... @@ -23,6 +29,7 @@ protected void SharedMethod() protected override void OnInitialized() { hasWallet = _walletStorage.HasWallet(); + network = _networkConfiguration.GetNetwork(); } } }