Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ActivationManager {
yield ActivationProgress(
status: 'Starting activation for ${group.primary.id.name}...',
progressDetails: ActivationProgressDetails(
currentStep: 'group_start',
currentStep: ActivationStep.groupStart,
stepCount: 1,
additionalInfo: {
'primaryAsset': group.primary.id.name,
Expand Down Expand Up @@ -155,7 +155,7 @@ class ActivationManager {
return const ActivationProgress(
status: 'Needs activation',
progressDetails: ActivationProgressDetails(
currentStep: 'init',
currentStep: ActivationStep.init,
stepCount: 1,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SmartAssetActivator extends BatchCapableActivator {
yield ActivationProgress(
status: 'Planning activation strategy...',
progressDetails: ActivationProgressDetails(
currentStep: 'planning',
currentStep: ActivationStep.planning,
stepCount: 1,
additionalInfo: {
'parentActivated': parentActivated,
Expand Down Expand Up @@ -117,7 +117,7 @@ class CompositeAssetActivator extends BatchCapableActivator {
yield ActivationProgress(
status: 'Finding appropriate activation strategy...',
progressDetails: ActivationProgressDetails(
currentStep: 'strategy_selection',
currentStep: ActivationStep.strategySelection,
stepCount: 1,
additionalInfo: {'assetId': asset.id.id},
),
Expand All @@ -144,4 +144,4 @@ abstract class ProtocolActivationStrategy extends BatchCapableActivator {
supportedProtocols.contains(asset.protocol.subClass);

Set<CoinSubClass> get supportedProtocols;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BchActivationStrategy extends ProtocolActivationStrategy {
yield ActivationProgress(
status: 'Starting BCH/SLP activation...',
progressDetails: ActivationProgressDetails(
currentStep: 'initialization',
currentStep: ActivationStep.initialization,
stepCount: 4,
additionalInfo: {
'assetType': isBch ? 'BCH' : 'SLP',
Expand All @@ -62,7 +62,7 @@ class BchActivationStrategy extends ProtocolActivationStrategy {
status: 'Configuring BCH platform...',
progressPercentage: 25,
progressDetails: ActivationProgressDetails(
currentStep: 'platform_setup',
currentStep: ActivationStep.platformSetup,
stepCount: 4,
additionalInfo: {
'electrumServers': protocol.requiredServers.toJsonRequest(),
Expand All @@ -77,7 +77,7 @@ class BchActivationStrategy extends ProtocolActivationStrategy {
status: 'Activating BCH with SLP support...',
progressPercentage: 50,
progressDetails: ActivationProgressDetails(
currentStep: 'activation',
currentStep: ActivationStep.activation,
stepCount: 4,
),
);
Expand All @@ -98,7 +98,7 @@ class BchActivationStrategy extends ProtocolActivationStrategy {
status: 'Verifying activation...',
progressPercentage: 75,
progressDetails: ActivationProgressDetails(
currentStep: 'verification',
currentStep: ActivationStep.verification,
stepCount: 4,
additionalInfo: {
'currentBlock': response.currentBlock,
Expand All @@ -109,7 +109,7 @@ class BchActivationStrategy extends ProtocolActivationStrategy {

yield ActivationProgress.success(
details: ActivationProgressDetails(
currentStep: 'complete',
currentStep: ActivationStep.complete,
stepCount: 4,
additionalInfo: {
'activatedChain': 'BCH',
Expand All @@ -124,7 +124,7 @@ class BchActivationStrategy extends ProtocolActivationStrategy {
status: 'Activating SLP token...',
progressPercentage: 50,
progressDetails: ActivationProgressDetails(
currentStep: 'token_activation',
currentStep: ActivationStep.tokenActivation,
stepCount: 2,
),
);
Expand All @@ -136,7 +136,7 @@ class BchActivationStrategy extends ProtocolActivationStrategy {

yield ActivationProgress.success(
details: ActivationProgressDetails(
currentStep: 'complete',
currentStep: ActivationStep.complete,
stepCount: 2,
additionalInfo: {
'activatedToken': asset.id.name,
Expand All @@ -151,7 +151,7 @@ class BchActivationStrategy extends ProtocolActivationStrategy {
errorMessage: e.toString(),
isComplete: true,
progressDetails: ActivationProgressDetails(
currentStep: 'error',
currentStep: ActivationStep.error,
stepCount: 4,
errorCode: isBch ? 'BCH_ACTIVATION_ERROR' : 'SLP_ACTIVATION_ERROR',
errorDetails: e.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CustomErc20ActivationStrategy extends ProtocolActivationStrategy {
yield ActivationProgress(
status: 'Activating ${asset.id.name}...',
progressDetails: ActivationProgressDetails(
currentStep: 'initialization',
currentStep: ActivationStep.initialization,
stepCount: 2,
additionalInfo: {
'assetType': 'token',
Expand Down Expand Up @@ -70,7 +70,7 @@ class CustomErc20ActivationStrategy extends ProtocolActivationStrategy {

yield ActivationProgress.success(
details: ActivationProgressDetails(
currentStep: 'complete',
currentStep: ActivationStep.complete,
stepCount: 2,
additionalInfo: {
'activatedChain': asset.id.name,
Expand All @@ -85,7 +85,7 @@ class CustomErc20ActivationStrategy extends ProtocolActivationStrategy {
errorMessage: e.toString(),
isComplete: true,
progressDetails: ActivationProgressDetails(
currentStep: 'error',
currentStep: ActivationStep.error,
stepCount: 2,
errorCode: 'ERC20_ACTIVATION_ERROR',
errorDetails: e.toString(),
Expand All @@ -94,4 +94,4 @@ class CustomErc20ActivationStrategy extends ProtocolActivationStrategy {
);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Erc20ActivationStrategy extends ProtocolActivationStrategy {
yield ActivationProgress(
status: 'Activating ${asset.id.name}...',
progressDetails: ActivationProgressDetails(
currentStep: 'initialization',
currentStep: ActivationStep.initialization,
stepCount: 2,
additionalInfo: {
'assetType': isPlatformAsset ? 'platform' : 'token',
Expand Down Expand Up @@ -72,7 +72,7 @@ class Erc20ActivationStrategy extends ProtocolActivationStrategy {

yield ActivationProgress.success(
details: ActivationProgressDetails(
currentStep: 'complete',
currentStep: ActivationStep.complete,
stepCount: 2,
additionalInfo: {
'activatedChain': asset.id.name,
Expand All @@ -87,7 +87,7 @@ class Erc20ActivationStrategy extends ProtocolActivationStrategy {
errorMessage: e.toString(),
isComplete: true,
progressDetails: ActivationProgressDetails(
currentStep: 'error',
currentStep: ActivationStep.error,
stepCount: 2,
errorCode: 'ERC20_ACTIVATION_ERROR',
errorDetails: e.toString(),
Expand All @@ -96,4 +96,4 @@ class Erc20ActivationStrategy extends ProtocolActivationStrategy {
);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class QtumActivationStrategy extends ProtocolActivationStrategy {
yield ActivationProgress(
status: 'Starting QTUM activation...',
progressDetails: ActivationProgressDetails(
currentStep: 'initialization',
currentStep: ActivationStep.initialization,
stepCount: 4,
additionalInfo: {
'protocol': 'QTUM',
Expand All @@ -47,7 +47,7 @@ class QtumActivationStrategy extends ProtocolActivationStrategy {
if (status.status == 'Ok') {
yield ActivationProgress.success(
details: ActivationProgressDetails(
currentStep: 'complete',
currentStep: ActivationStep.complete,
stepCount: 4,
additionalInfo: {
'activatedChain': asset.id.name,
Expand All @@ -61,7 +61,7 @@ class QtumActivationStrategy extends ProtocolActivationStrategy {
errorMessage: status.details,
isComplete: true,
progressDetails: ActivationProgressDetails(
currentStep: 'error',
currentStep: ActivationStep.error,
stepCount: 4,
errorCode: 'QTUM_ACTIVATION_ERROR',
errorDetails: status.details,
Expand Down Expand Up @@ -89,7 +89,7 @@ class QtumActivationStrategy extends ProtocolActivationStrategy {
errorMessage: e.toString(),
isComplete: true,
progressDetails: ActivationProgressDetails(
currentStep: 'error',
currentStep: ActivationStep.error,
stepCount: 4,
errorCode: 'QTUM_ACTIVATION_ERROR',
errorDetails: e.toString(),
Expand All @@ -99,35 +99,35 @@ class QtumActivationStrategy extends ProtocolActivationStrategy {
}
}

({String status, double percentage, String step, Map<String, dynamic> info})
({String status, double percentage, ActivationStep step, Map<String, dynamic> info})
_parseQtumStatus(String status) {
switch (status) {
case 'ConnectingNodes':
return (
status: 'Connecting to QTUM nodes...',
percentage: 25,
step: 'connection',
step: ActivationStep.connection,
info: {'status': status},
);
case 'ValidatingConfig':
return (
status: 'Validating configuration...',
percentage: 50,
step: 'validation',
step: ActivationStep.validation,
info: {'status': status},
);
case 'LoadingContracts':
return (
status: 'Loading smart contracts...',
percentage: 75,
step: 'contracts',
step: ActivationStep.contracts,
info: {'status': status},
);
default:
return (
status: 'Processing activation...',
percentage: 85,
step: 'processing',
step: ActivationStep.processing,
info: {'status': status},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SlpActivationStrategy extends ProtocolActivationStrategy {
yield ActivationProgress(
status: 'Starting BCH/SLP activation...',
progressDetails: ActivationProgressDetails(
currentStep: 'initialization',
currentStep: ActivationStep.initialization,
stepCount: 3,
additionalInfo: {
'assetType': isPlatformAsset ? 'platform' : 'token',
Expand All @@ -43,7 +43,7 @@ class SlpActivationStrategy extends ProtocolActivationStrategy {
status: 'Configuring BCH platform...',
progressPercentage: 33,
progressDetails: ActivationProgressDetails(
currentStep: 'platform_setup',
currentStep: ActivationStep.platformSetup,
stepCount: 3,
additionalInfo: {
'bchdServers': protocol.bchdUrls.length,
Expand All @@ -67,7 +67,7 @@ class SlpActivationStrategy extends ProtocolActivationStrategy {
status: 'Activating SLP token...',
progressPercentage: 66,
progressDetails: ActivationProgressDetails(
currentStep: 'token_activation',
currentStep: ActivationStep.tokenActivation,
stepCount: 3,
),
);
Expand All @@ -79,7 +79,7 @@ class SlpActivationStrategy extends ProtocolActivationStrategy {
}
yield ActivationProgress.success(
details: ActivationProgressDetails(
currentStep: 'complete',
currentStep: ActivationStep.complete,
stepCount: 3,
additionalInfo: {
'activatedChain': asset.id.name,
Expand All @@ -93,7 +93,7 @@ class SlpActivationStrategy extends ProtocolActivationStrategy {
errorMessage: e.toString(),
isComplete: true,
progressDetails: ActivationProgressDetails(
currentStep: 'error',
currentStep: ActivationStep.error,
stepCount: 3,
errorCode: 'SLP_ACTIVATION_ERROR',
errorDetails: e.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TendermintActivationStrategy extends ProtocolActivationStrategy {
yield ActivationProgress(
status: 'Starting Tendermint activation...',
progressDetails: ActivationProgressDetails(
currentStep: 'initialization',
currentStep: ActivationStep.initialization,
stepCount: 4,
additionalInfo: {
'assetType': isPlatformAsset ? 'platform' : 'token',
Expand All @@ -43,7 +43,7 @@ class TendermintActivationStrategy extends ProtocolActivationStrategy {
status: 'Validating RPC endpoints...',
progressPercentage: 25,
progressDetails: ActivationProgressDetails(
currentStep: 'validation',
currentStep: ActivationStep.validation,
stepCount: 4,
additionalInfo: {
'rpcEndpoints': protocol.rpcUrlsMap.length,
Expand All @@ -57,7 +57,7 @@ class TendermintActivationStrategy extends ProtocolActivationStrategy {
status: 'Activating platform chain...',
progressPercentage: 50,
progressDetails: ActivationProgressDetails(
currentStep: 'platform_activation',
currentStep: ActivationStep.platformActivation,
stepCount: 4,
),
);
Expand All @@ -80,7 +80,7 @@ class TendermintActivationStrategy extends ProtocolActivationStrategy {
status: 'Activating Tendermint token...',
progressPercentage: 75,
progressDetails: ActivationProgressDetails(
currentStep: 'token_activation',
currentStep: ActivationStep.tokenActivation,
stepCount: 4,
),
);
Expand All @@ -93,7 +93,7 @@ class TendermintActivationStrategy extends ProtocolActivationStrategy {

yield ActivationProgress.success(
details: ActivationProgressDetails(
currentStep: 'complete',
currentStep: ActivationStep.complete,
stepCount: 4,
additionalInfo: {
'activatedChain': asset.id.name,
Expand All @@ -109,7 +109,7 @@ class TendermintActivationStrategy extends ProtocolActivationStrategy {
errorMessage: e.toString(),
isComplete: true,
progressDetails: ActivationProgressDetails(
currentStep: 'error',
currentStep: ActivationStep.error,
stepCount: 4,
errorCode: 'TENDERMINT_ACTIVATION_ERROR',
errorDetails: e.toString(),
Expand Down
Loading
Loading