Skip to content

Commit

Permalink
fix validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ERussel committed Aug 14, 2023
1 parent faf404c commit 55196ec
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extension EvmGasPriceValidationProvider: ExtrinsicValidationProviderProtocol {
return true
}

return self.model.defaultGasPrice * self.multiplier < maxPriorityPrice * self.divisor
return self.model.defaultGasPrice * self.multiplier > maxPriorityPrice * self.divisor
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ final class DAppEthereumConfirmInteractor: DAppOperationBaseInteractor {
case let .success(model):
self?.lastFee = model
let validationProvider = validationProviderFactory.createGasPriceValidation(for: model)
let feeModel = DAppOperationConfirmFee(value: model.fee, validationProvider: validationProvider)
let feeModel = FeeOutputModel(value: model.fee, validationProvider: validationProvider)

self?.presenter?.didReceive(feeResult: .success(feeModel))
case let .failure(error):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ extension DAppOperationConfirmInteractor: DAppOperationConfirmInteractorInputPro
do {
let info = try feeWrapper.targetOperation.extractNoCancellableResultData()
if let fee = BigUInt(info.fee) {
let feeModel = DAppOperationConfirmFee(value: fee, validationProvider: nil)
let feeModel = FeeOutputModel(value: fee, validationProvider: nil)
self?.presenter?.didReceive(feeResult: .success(feeModel))
} else {
self?.presenter?.didReceive(feeResult: .failure(CommonError.dataCorruption))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class DAppOperationConfirmPresenter {
let balanceViewModelFactory: BalanceViewModelFactoryProtocol

private var confirmationModel: DAppOperationConfirmModel?
private var feeModel: DAppOperationConfirmFee?
private var feeModel: FeeOutputModel?
private var priceData: PriceData?

init(
Expand Down Expand Up @@ -166,7 +166,7 @@ extension DAppOperationConfirmPresenter: DAppOperationConfirmInteractorOutputPro
provideFeeViewModel()
}

func didReceive(feeResult: Result<DAppOperationConfirmFee, Error>) {
func didReceive(feeResult: Result<FeeOutputModel, Error>) {
switch feeResult {
case let .success(fee):
feeModel = fee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ protocol DAppOperationConfirmInteractorInputProtocol: AnyObject {
func prepareTxDetails()
}

struct DAppOperationConfirmFee {
let value: BigUInt
let validationProvider: ExtrinsicValidationProviderProtocol?
}

protocol DAppOperationConfirmInteractorOutputProtocol: AnyObject {
func didReceive(modelResult: Result<DAppOperationConfirmModel, Error>)
func didReceive(feeResult: Result<DAppOperationConfirmFee, Error>)
func didReceive(feeResult: Result<FeeOutputModel, Error>)
func didReceive(priceResult: Result<PriceData?, Error>)
func didReceive(responseResult: Result<DAppOperationResponse, Error>, for request: DAppOperationRequest)
func didReceive(txDetailsResult: Result<JSON, Error>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ final class DAppSignBytesConfirmInteractor: DAppOperationBaseInteractor {
}

private func provideZeroFee() {
let feeModel = DAppOperationConfirmFee(value: 0, validationProvider: nil)
let feeModel = FeeOutputModel(value: 0, validationProvider: nil)
presenter?.didReceive(feeResult: .success(feeModel))
presenter?.didReceive(priceResult: .success(nil))
}
Expand Down

0 comments on commit 55196ec

Please sign in to comment.