Skip to content

Commit

Permalink
Rearchitecture transfer (#135)
Browse files Browse the repository at this point in the history
* feat: Create dev run configuration

* refactor: dashboard blocs.

* mods: delegation cubit. tests.

* mods: delegation cubit - tests.

* feat: Improve the DashboardCubit class

* feat: Finish the delegation widgets

* feat: Use a CardData object to hold the title and description of a card

* feat: Fill up the balance widgets

* fix: Assign the correct card data to the CardType.balance value

* feat: Improve the DashboardCubit so that the cubits that implement it can specify the state

* feat: Fill up the dual coin stats widgets

* fix: Navigate after the current frame finished rendering

* fix: Apply fixes with dart fix --apply

* fix: Use the super parameters

* refactor: Replace deprecated methods or classes

* feat: Use very_good_analysis for linter rules and solve some issues with dart fix --apply

* feat: Add localization

* feat: Exemplify how to use AppLocalizations

* feat: Enable l10n for the dev entry point also

* fix: Regenerate the windows folder

* refactor: Delete unused widgets

* feat: Add documentation of public members inside the dual_coin_stats folder

* feat: Replace Pillars with PillarsCard

* feat: Replace RealtimeStatistics with RealtimeStatisticsCard

* feat: Fill up the sentinels widgets

* refactor: Change fields' order

* fix: Documentation

* feat: Fill the staking widgets

* fix: Documentation

* feat: Fill up the total hourly transactions widgets

* feat: Delete unused blocs

* feat: Tweak balance features

* refactor: Delete unused bloc

* feat: Create the node sync status feature

* feat: Delete unused class

* feat: Adapt Transfer widget to the new architecture

* chore: Redo dashboard.dart exports

* chore: Delete unused feature balance_dashboard

* feat: Use localization version strings for generating CardData objects

* chore: Improve documentation

* chore: Rename CubitStatus class to DashboardStatus

* chore: Improve documentation of the balance feature

* feat: transfer BLoC rearchitecture + localizations

* chore: Improve documentation and solve linter issues

* feat: transfer BLoC rearchitecture complete. added receive_transaction & transfer_widget_balance

* feat: Make the DashboardCubit a HydratedCubit

* feat: Make custom exceptions serializable and move them to separated feature folders

* feat: Structure the error handling mechanism

* feat: Localize some strings

* refactor: Make custom exceptions extend from DashboardCubitException

* refactor: Restructure new code in a single folder

* transfer tab unit testing wip

* transfer tab unit testing wip

* chore: Move node_sync_status inside features folder

* chore: Improve documentation

* feat: Add always_specify_types to the linter rules and run dart fix

* chore: Solve linter hints in rearchitecture folder

* chore: Improve documentation

* chore: Create and use the state_copy_with documentation template

* feat: transfer BLoC rearchitecture complete. added receive_transaction & transfer_widget_balance

* feat: Add tests for delegation cubit

* feat: Add asserts for the TimerState class

* feat: Restructure exceptions

* feat: Improve error logging

* chore: Update Zenon SDK

* chore: Delete flutter_lints dependency

* chore: Update dependencies

* feat: Change the interval at which the node sync status is fetched

* chore: Rename and change location of a refresh interval constant

* feat: Don't emit the loading state if the current one has a success status

* feat: Add required named parameters to the TimerCubit constructor

* feat: Run dart format in rearchitecture folder

* feat: Delete the CubitException class

* testing dashboard wip

* chore: Improve documentation

* testing dashboard wip

* feat: Create constants for specific UI gaps

* transfer tab wip

* feat: dashboard unit testing added

* removed unused import

* node sync status tests added

* feat: Create the new app themes and improve the UI of the back of the new card scaffold

* feat: Create a cubit for hiding the front widget of the NewCardScaffold

* feat: Log errors

* feat: Make password field obscure text by default

* feat: Create the newTheme and isDarkMode getters to the BuildContextExtension

* feat: Rename local variable

* feat: Delete the font specification from the new themes

* fix: Getting setting and getting the new theme

* chore: Rename 'newTheme' getter to 'theme'

* feat: Adapt widgets to the new theme data

* chore: Rename getter 'theme' to 'themeData'

* refactor: Cubit initializations

* chore: Use documentation templates for cubit state's fromJson and toJson

* fix: Some tests

* feat: json serialization added

* feat: unit tests reworked; comments add

* chore: Improve documentation

* feat: Align the text field and the button on the center axis

* feat: unit tests reworked; comments add

* chore: Repair dart analysis hints

* feat: dependency injection helpers added

* feat: unit tests added

* todo rewrite

* feat: Create a bloc to manage the 'Send' and 'Receive' card dimensions and move the send payment bloc files

* refactor: Rename 'DimensionCard' class to 'CardDimension'

* refactor: Rename feature transfer_balance to multiple_balance

* feat: Tweak multiple balance feature

* feat: Create the SendCard widget

* feat: Create the other send medium widgets

* feat: Use the new send payment bloc

* feat: Rename the new send payment feature to send transaction

* feat: Use only one version of send and receive widgets - WIP

* feat: Modify the 'Send' large widget and tweak send transaction bloc

* feat: Have only one variant of send widget

* refactor: Improve code styling

* feat: Sketch the new receive feature

* refactor: Add some missing exports

* feat: Finish receive feature

* fix: Tests from send feature

* feat: Delete some old blocs

* fix: Test

* refactor: Move the multiple balance feature directory

* refactor: Rename CubitFailureException to FailureException

* feat: Sketch the latest transactions feature

* feat: Create a new variant of infinite table

* feat: Tweak the latest transaction table design

* feat: Regenerate file

* feat: Transform pending transactions cubit into a bloc

* fix: Tests

* feat: Redone 'Pending Transactions' card design

* feat: Use some of the global constants

* refactor: Delete unused blocs and widgets

* feat: Refresh latest and pending transactions list after a block was received

* feat: Create the LatestTransactionsMoreRequested event

* feat: Create a generic infinite list bloc

* fix: Latest transactions bloc tests

* refactor: Make PendingTransactionsBloc extend from InfiniteListBloc

* feat: Improve tests

* feat: Make the CopyToClipboardIcon an IconButton

* feat: Refresh pending transactions list when an unreceived transaction hash is found

* feat: Use the parameter for the page size

* feat: Log bloc errors

* feat: Always feed the new data to the view when the InfiniteListRequested event is called

* feat: Refresh the multiple balance bloc data after a new address was generated

* refactor: Delete unused bloc

* feat: Add RefreshBlocMixin to the InfiniteListBloc class

* feat: Add the hash of the new block in the transfer notification details

* refactor: Improve InfiniteScrollTable and InfiniteScrollTableCell classes

* fix: Show the proper message when there are no more new items

* feat: Add documentation

* fix: Dart analysis hint

* feat: Add documentation

* feat: Use icons from the SDK

* feat: Also refresh the MultipleBalanceBloc stream when needed

* feat: Add some documentation

* fix: Some Dart Analysis hints

* feat: Create new send and receive transaction icons

* feat: Remove chip

* feat: Add tooltip

* feat: Tweak asset column

* refactor: Create separate column classes

* refactor: Create column types

* feat: Tweak the asset cell

* feat: Tweak padding

* feat: Tweak text style

* feat: Change the color of columns

* feat: Change how the date is formatted

* feat: Enable searching and sorting the dropdown items

* feat: Make ZNN the default token in the receive card

* feat: Tweak tokens initialization

* feat: Make methods non-static, so that they can be mocked

* fix: Dart analysis hints

* feat: Improve the sorting functions

* refactor: Remove unused imports

* refactor: Create separete cell classes

* feat: Add some tooltips

* fix: Tests

* fix: Receive QR code

* feat: Remove styling from left side chart titles and use the default generated Y interval

* feat: Revert some Windows changes

* feat: Associated a custom URL deep linking scheme with the app - on Windows

* feat: Restore bundling local libraries

* feat: Restore updating Git metadata

* fix: Fetching the dlls that will be installed in the Windows app folder and re-enable the generation of git metadata

* shell script modified

* build generated changes

* fix: Fetching the dlls that will be installed in the Linux app folder

* fix: Finding the correct path for .so files

* feat: Update znn sdk and ledger

* feat: Reset local git metadata

* feat: Init kNumOfPillars

* feat: Upgrade dependecies for Flutter 3.27

* fix: Seed input fields

* fix: Errors after merge

* feat: Decrease the size of copy to clipboard icon inside the tables

* feat: Get the type of the tx from the transaction block

* feat: Disable filtering of dropdown entries and add menu height

* feat: Improve Send and Receive cards description

* feat: Add buttons to share and save the receive QR

* feat: Remove local Git metadata

* feat: Use the data from the network to hardcode ZNN and QSR coins

* feat: Show the coins first in the ZtsDropdown

* feat: Add a prefix to the token labels

* feat: Delete unused image

* feat: Localize string

* feat: Change the logic of showDialogWithNoAndYesOptions function

* feat: Check if the bloc emitter is closed

* feat: Refresh pending txs when changing the default address

* feat: Sort also the tokens inside the 'Send' card and improve sorting of the assets

* feat: Add support for refreshing the token list

* feat: Add support for refreshing the 'Send' card data

* feat: Change the ZNN, QSR, token and error colors

* feat: Add the token standard to the coin label

* feat: Add an icon for the coin label

* feat: Check if splash initialization has been done

* fix: Register the latest transactions bloc upper in the widget tree

* feat: Move registering singletons higher up the widget tree

* feat: Change the token label in the dropdown

* feat: Add missing end of line

* feat: Override function

* feat: Add files to .gitignore

* feat: Use the token symbol instead of the name

---------

Co-authored-by: kossmmos <[email protected]>
  • Loading branch information
maznnwell and kossmmos authored Jan 20, 2025
1 parent 4aee62e commit ffaa90c
Show file tree
Hide file tree
Showing 199 changed files with 5,890 additions and 3,779 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,7 @@ app.*.symbols
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!.vscode/settings.json
!.vscode/settings.json
/macos/libargon2_ffi.dylib
/macos/libledger_ffi.dylib
/macos/libpow_links.dylib
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ linter:
always_specify_types: true
# This rule is in contradiction with always_specify_types, so it must be disabled if the other
# one is enabled
omit_local_variable_types: false
omit_local_variable_types: false
no_default_cases: false
Binary file removed assets/images/qr_code_child_image_znn.png
Binary file not shown.
Binary file added assets/images/qr_code_child_image_znn_cut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/blocs/accelerator/create_phase_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CreatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
znnFundsNeeded,
qsrFundsNeeded,
);
AccountBlockUtils.createAccountBlock(transactionParams, 'create phase')
AccountBlockUtils().createAccountBlock(transactionParams, 'create phase')
.then(
addEvent,
)
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/accelerator/create_project_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
znnFundsNeeded,
qsrFundsNeeded,
);
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'creating project',
).then(
(AccountBlockTemplate block) {
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(block);
},
).onError(
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/accelerator/submit_donation_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SubmitDonationBloc extends BaseBloc<AccountBlockTemplate?> {

Future<void> _sendDonationBlock(
AccountBlockTemplate transactionParams,) async {
await AccountBlockUtils.createAccountBlock(
await AccountBlockUtils().createAccountBlock(
transactionParams,
'donate for accelerator',
).then(
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/accelerator/update_phase_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UpdatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
znnFundsNeeded,
qsrFundsNeeded,
);
AccountBlockUtils.createAccountBlock(transactionParams, 'update phase')
AccountBlockUtils().createAccountBlock(transactionParams, 'update phase')
.then(
addEvent,
)
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/accelerator/vote_project_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class VoteProjectBloc extends BaseBloc<AccountBlockTemplate?> {
pillarInfo.name,
vote.index,
);
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'vote for project',
)
Expand Down
54 changes: 41 additions & 13 deletions lib/blocs/auto_receive_tx_worker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import 'package:zenon_syrius_wallet_flutter/blocs/auto_unlock_htlc_worker.dart';
import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/main.dart';
import 'package:zenon_syrius_wallet_flutter/model/model.dart';
import 'package:zenon_syrius_wallet_flutter/utils/account_block_utils.dart';
import 'package:zenon_syrius_wallet_flutter/utils/address_utils.dart';
import 'package:zenon_syrius_wallet_flutter/utils/constants.dart';
import 'package:zenon_syrius_wallet_flutter/rearchitecture/features/features.dart';
import 'package:zenon_syrius_wallet_flutter/rearchitecture/utils/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/utils/utils.dart';
import 'package:znn_sdk_dart/znn_sdk_dart.dart';

class AutoReceiveTxWorker extends BaseBloc<WalletNotification> {
Expand All @@ -23,23 +23,25 @@ class AutoReceiveTxWorker extends BaseBloc<WalletNotification> {
}

Future<AccountBlockTemplate?> autoReceiveTransactionHash(
Hash currentHash,) async {
Hash currentHash,
) async {
if (!running) {
running = true;
try {
final Address toAddress =
(await zenon!.ledger.getAccountBlockByHash(currentHash))!.toAddress;
final AccountBlockTemplate transactionParams = AccountBlockTemplate.receive(
final AccountBlockTemplate transactionParams =
AccountBlockTemplate.receive(
currentHash,
);
final AccountBlockTemplate response =
await AccountBlockUtils.createAccountBlock(
await AccountBlockUtils().createAccountBlock(
transactionParams,
'receive transaction',
address: toAddress,
waitForRequiredPlasma: true,
);
_sendSuccessNotification(response, toAddress.toString());
_onSuccess(response, toAddress.toString());
return response;
} on RpcException catch (e, stackTrace) {
_sendErrorNotification(e.toString());
Expand All @@ -54,9 +56,10 @@ class AutoReceiveTxWorker extends BaseBloc<WalletNotification> {

Future<void> autoReceive() async {
if (sharedPrefsService!.get(
kAutoReceiveKey,
defaultValue: kAutoReceiveDefaultValue,
) == false) {
kAutoReceiveKey,
defaultValue: kAutoReceiveDefaultValue,
) ==
false) {
pool.clear();
return;
}
Expand All @@ -68,17 +71,18 @@ class AutoReceiveTxWorker extends BaseBloc<WalletNotification> {
try {
final Address toAddress =
(await zenon!.ledger.getAccountBlockByHash(currentHash))!.toAddress;
final AccountBlockTemplate transactionParams = AccountBlockTemplate.receive(
final AccountBlockTemplate transactionParams =
AccountBlockTemplate.receive(
currentHash,
);
final AccountBlockTemplate response =
await AccountBlockUtils.createAccountBlock(
await AccountBlockUtils().createAccountBlock(
transactionParams,
'receive transaction',
address: toAddress,
waitForRequiredPlasma: true,
);
_sendSuccessNotification(response, toAddress.toString());
_onSuccess(response, toAddress.toString());
if (pool.isNotEmpty) {
pool.removeFirst();
}
Expand Down Expand Up @@ -111,6 +115,11 @@ class AutoReceiveTxWorker extends BaseBloc<WalletNotification> {
(syncInfo.targetHeight > 0 &&
syncInfo.currentHeight > 0 &&
(syncInfo.targetHeight - syncInfo.currentHeight) < 3))) {
sl.get<PendingTransactionsBloc>().add(
InfiniteListRefreshRequested(
address: Address.parse(kSelectedAddress!),
),
);
pool.add(hash);
}
});
Expand All @@ -127,6 +136,25 @@ class AutoReceiveTxWorker extends BaseBloc<WalletNotification> {
);
}

void _onSuccess(AccountBlockTemplate block, String toAddress) {
sl.get<MultipleBalanceBloc>().add(
MultipleBalanceFetch(
addresses: kDefaultAddressList.map((String? e) => e!).toList(),
),
);

final Address address = Address.parse(kSelectedAddress!);
sl.get<LatestTransactionsBloc>().add(
InfiniteListRefreshRequested(address: address),
);
sl.get<PendingTransactionsBloc>().add(
InfiniteListRefreshRequested(
address: address,
),
);
_sendSuccessNotification(block, toAddress);
}

void _sendSuccessNotification(AccountBlockTemplate block, String toAddress) {
addEvent(
WalletNotification(
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/auto_unlock_htlc_worker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class AutoUnlockHtlcWorker extends BaseBloc<WalletNotification> {
final AccountBlockTemplate transactionParams = zenon!.embedded.htlc
.unlock(htlc.id, FormatUtils.decodeHexString(swap.preimage!));
final AccountBlockTemplate response =
await AccountBlockUtils.createAccountBlock(
await AccountBlockUtils().createAccountBlock(
transactionParams,
'complete swap',
address: htlc.hashLocked,
Expand Down
1 change: 0 additions & 1 deletion lib/blocs/blocs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ export 'sentinels/sentinels.dart';
export 'settings/settings.dart';
export 'staking/staking.dart';
export 'tokens/tokens.dart';
export 'transfer/transfer.dart';
4 changes: 2 additions & 2 deletions lib/blocs/p2p_swap/htlc_swap/complete_htlc_swap_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class CompleteHtlcSwapBloc extends BaseBloc<HtlcSwap?> {

final AccountBlockTemplate transactionParams = zenon!.embedded.htlc.unlock(
Hash.parse(htlcId), FormatUtils.decodeHexString(swap.preimage!),);
AccountBlockUtils.createAccountBlock(transactionParams, 'complete swap',
AccountBlockUtils().createAccountBlock(transactionParams, 'complete swap',
address: Address.parse(swap.selfAddress), waitForRequiredPlasma: true,)
.then(
(AccountBlockTemplate response) async {
swap.state = P2pSwapState.completed;
await htlcSwapsService!.storeSwap(swap);
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(swap);
},
).onError(
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/p2p_swap/htlc_swap/join_htlc_swap_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class JoinHtlcSwapBloc extends BaseBloc<HtlcSwap?> {
initialHtlc.keyMaxSize,
initialHtlc.hashLock,
);
AccountBlockUtils.createAccountBlock(transactionParams, 'join swap',
AccountBlockUtils().createAccountBlock(transactionParams, 'join swap',
address: initialHtlc.hashLocked, waitForRequiredPlasma: true,)
.then(
(AccountBlockTemplate response) async {
Expand Down Expand Up @@ -61,7 +61,7 @@ class JoinHtlcSwapBloc extends BaseBloc<HtlcSwap?> {
hashType: initialHtlc.hashType,
);
await htlcSwapsService!.storeSwap(swap);
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(swap);
},
).onError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class ReclaimHtlcSwapFundsBloc extends BaseBloc<AccountBlockTemplate?> {
addEvent(null);
final AccountBlockTemplate transactionParams =
zenon!.embedded.htlc.reclaim(htlcId);
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams, 'reclaim swap funds',
address: selfAddress, waitForRequiredPlasma: true,)
.then(
(AccountBlockTemplate response) {
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(response);
},
).onError(
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/p2p_swap/htlc_swap/start_htlc_swap_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class StartHtlcSwapBloc extends BaseBloc<HtlcSwap?> {
htlcPreimageMaxLength,
hashLock.getBytes(),
);
AccountBlockUtils.createAccountBlock(transactionParams, 'start swap',
AccountBlockUtils().createAccountBlock(transactionParams, 'start swap',
address: selfAddress, waitForRequiredPlasma: true,)
.then(
(AccountBlockTemplate response) async {
Expand All @@ -62,7 +62,7 @@ class StartHtlcSwapBloc extends BaseBloc<HtlcSwap?> {
hashType: hashType,
);
await htlcSwapsService!.storeSwap(swap);
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(swap);
},
).onError(
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/pillars/delegate_button_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DelegateButtonBloc extends BaseBloc<AccountBlockTemplate?> {
final AccountBlockTemplate transactionParams = zenon!.embedded.pillar.delegate(
pillarName!,
);
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'delegate to Pillar',
waitForRequiredPlasma: true,
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/pillars/disassemble_pillar_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class DisassemblePillarBloc extends BaseBloc<AccountBlockTemplate?> {
final AccountBlockTemplate transactionParams = zenon!.embedded.pillar.revoke(
pillarName,
);
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'disassemble Pillar',
waitForRequiredPlasma: true,
).then(
(AccountBlockTemplate response) {
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(response);
},
).onError(
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/pillars/pillars_deploy_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class PillarsDeployBloc extends BaseBloc<AccountBlockTemplate?> {
giveBlockRewardPercentage,
giveDelegateRewardPercentage,
);
await AccountBlockUtils.createAccountBlock(
await AccountBlockUtils().createAccountBlock(
transactionParams,
'register Pillar',
waitForRequiredPlasma: true,
).then(
(AccountBlockTemplate response) {
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(response);
},
).onError(
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/pillars/pillars_deposit_qsr_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PillarsDepositQsrBloc extends BaseBloc<AccountBlockTemplate?> {
zenon!.embedded.pillar.depositQsr(
amount,
);
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'deposit ${kQsrCoin.symbol} for Pillar Slot',
waitForRequiredPlasma: true,
Expand All @@ -29,7 +29,7 @@ class PillarsDepositQsrBloc extends BaseBloc<AccountBlockTemplate?> {
await Future.delayed(
kDelayAfterAccountBlockCreationCall,
);
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(response);
},
).onError(
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/pillars/pillars_withdraw_qsr_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ class PillarsWithdrawQsrBloc extends BaseBloc<AccountBlockTemplate?> {
addEvent(null);
final AccountBlockTemplate transactionParams =
zenon!.embedded.pillar.withdrawQsr();
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'withdraw ${kQsrCoin.symbol} from Pillar Slot',
waitForRequiredPlasma: true,
).then(
(AccountBlockTemplate response) async {
await Future.delayed(kDelayAfterAccountBlockCreationCall);
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(response);
},
).onError(
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/pillars/undelegate_button_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class UndelegateButtonBloc extends BaseBloc<AccountBlockTemplate?> {
addEvent(null);
final AccountBlockTemplate transactionParams =
zenon!.embedded.pillar.undelegate();
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'undelegate',
waitForRequiredPlasma: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/pillars/update_pillar_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class UpdatePillarBloc extends BaseBloc<AccountBlockTemplate?> {
giveBlockRewardPercentage,
giveDelegateRewardPercentage,
);
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'update pillar',
)
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/plasma/cancel_plasma_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class CancelPlasmaBloc extends BaseBloc<AccountBlockTemplate?> {
final AccountBlockTemplate transactionParams = zenon!.embedded.plasma.cancel(
Hash.parse(id),
);
AccountBlockUtils.createAccountBlock(transactionParams, 'cancel Plasma',
AccountBlockUtils().createAccountBlock(transactionParams, 'cancel Plasma',
waitForRequiredPlasma: true,)
.then(
(AccountBlockTemplate response) {
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(response);
},
).onError(
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/plasma/plasma_options_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class PlasmaOptionsBloc extends BaseBloc<AccountBlockTemplate?> {
Address.parse(beneficiaryAddress),
amount,
);
AccountBlockUtils.createAccountBlock(
AccountBlockUtils().createAccountBlock(
transactionParams,
'fuse ${kQsrCoin.symbol} for Plasma',
waitForRequiredPlasma: true,
).then(
(AccountBlockTemplate response) {
ZenonAddressUtils.refreshBalance();
ZenonAddressUtils().refreshBalance();
addEvent(response);
},
).onError(
Expand Down
Loading

0 comments on commit ffaa90c

Please sign in to comment.