mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
feed in getChainHeight stub
This commit is contained in:
parent
06760cff3d
commit
6a2df4a76e
2 changed files with 20 additions and 1 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 7683f610e0a1ce3f4e68d2be609b667c80381379
|
||||
Subproject commit 3d89074c6a4852d1b92dc837b23e571d9ca9698c
|
|
@ -34,6 +34,7 @@ mixin FusionWalletInterface {
|
|||
late final Future<int> Function({
|
||||
required String address,
|
||||
}) _getTxCountForAddress;
|
||||
late final Future<int> Function() _getChainHeight;
|
||||
|
||||
/// Initializes the FusionWalletInterface mixin.
|
||||
///
|
||||
|
@ -49,6 +50,7 @@ mixin FusionWalletInterface {
|
|||
required Future<int> Function({
|
||||
required String address,
|
||||
}) getTxCountForAddress,
|
||||
required Future<int> Function() getChainHeight,
|
||||
}) async {
|
||||
// Set passed in wallet data.
|
||||
_walletId = walletId;
|
||||
|
@ -58,6 +60,7 @@ mixin FusionWalletInterface {
|
|||
_torService = FusionTorService.sharedInstance;
|
||||
_getWalletCachedElectrumX = getWalletCachedElectrumX;
|
||||
_getTxCountForAddress = getTxCountForAddress;
|
||||
_getChainHeight = getChainHeight;
|
||||
}
|
||||
|
||||
/// Returns a list of all addresses in the wallet.
|
||||
|
@ -197,6 +200,21 @@ mixin FusionWalletInterface {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns the current chain height.
|
||||
///
|
||||
/// This function is used by FusionDart to determine if a transaction is
|
||||
/// confirmed or not.
|
||||
///
|
||||
/// Returns:
|
||||
/// A `Future<int>` that resolves to the current chain height.
|
||||
///
|
||||
/// Throws:
|
||||
/// An `Exception` if the chain height cannot be determined.
|
||||
Future<int> getChainHeight() async {
|
||||
throw UnimplementedError(
|
||||
"TODO getChainHeight eg look up chain height from electrumx");
|
||||
}
|
||||
|
||||
// Initial attempt for CashFusion integration goes here.
|
||||
|
||||
/// Fuse the wallet's UTXOs.
|
||||
|
@ -217,6 +235,7 @@ mixin FusionWalletInterface {
|
|||
/*createNewReservedChangeAddress: createNewReservedChangeAddress,*/
|
||||
getUnusedReservedChangeAddresses: getUnusedReservedChangeAddresses,
|
||||
getSocksProxyAddress: getSocksProxyAddress,
|
||||
getChainHeight: getChainHeight,
|
||||
);
|
||||
|
||||
// Add stack UTXOs.
|
||||
|
|
Loading…
Reference in a new issue