Skip to content

Commit

Permalink
Merge pull request #375 from Concordium/bugfix/commission-rates-hotfix
Browse files Browse the repository at this point in the history
[CBW-1528] & [CBW-1529] remove "Finalization reward commission" and Rename "Baking commission" label
  • Loading branch information
prinshamlet authored Nov 21, 2023
2 parents 7718612 + e02d688 commit e5a96d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,11 @@ struct BakerCommissionSettingsView: View {
commission: $viewModel.transactionFeeCommission
)

Text("Baking reward commission")
Text("Block reward commission")
BakerCommissionSliderView(
range: ranges.bakingCommissionRange,
commission: $viewModel.bakingRewardCommission
)

Text("Finalization reward commission")
BakerCommissionSliderView(
range: ranges.finalizationCommissionRange,
commission: $viewModel.finalizationRewardCommission
)
Spacer()
Button(action: viewModel.continueButtonTapped) {
Text("Continue")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ extension NumberFormatter {
enum BakerCommissionSettingError: LocalizedError {
case transactionFeeOutOfRange
case bakingRewardOutOfRange
case finalizationRewardOutOfRange
case networkError(Error)

var errorMessage: String {
switch self {
case .bakingRewardOutOfRange:
return "Baking reward is out of specified range"
case .finalizationRewardOutOfRange:
return "Finalization reward is out of specified range"
case .transactionFeeOutOfRange:
return "Transaction fee is out of specified range"
case let .networkError(error):
Expand Down Expand Up @@ -137,10 +134,6 @@ class BakerCommissionSettingsViewModel: ObservableObject {
return BakerCommissionSettingError.bakingRewardOutOfRange
}

guard ranges.finalizationCommissionRange.min ... ranges.finalizationCommissionRange.max ~= finalizationRewardCommission else {
return BakerCommissionSettingError.finalizationRewardOutOfRange
}

guard ranges.transactionCommissionRange.min ... ranges.transactionCommissionRange.max ~= transactionFeeCommission else {
return BakerCommissionSettingError.transactionFeeOutOfRange
}
Expand Down

0 comments on commit e5a96d7

Please sign in to comment.