Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Jan 20, 2024
1 parent a3b4fa9 commit 8d9e954
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 10 additions & 2 deletions src/GWallet.Backend/Account.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ open System.Threading.Tasks

open GWallet.Backend.FSharpUtil.UwpHacks

// this exception, if it happens, it would cause a crash because we don't handle it yet
type InconsistentResultFromDifferentServersOfSameCurrency(currency: Currency,
innerException: ResultInconsistencyException) =
inherit Exception (SPrintF2 "Inconsistent results retrieving info for currency %A: %s"
(currency.ToString())
innerException.Message,
innerException)

module Account =

let private GetShowableBalanceInternal (account: IAccount)
Expand All @@ -27,8 +35,8 @@ module Account =
account.Currency
Ether.Account.GetShowableBalance account mode cancelSourceOption
with
| :? ResultInconsistencyException as inconsistencyExcpetion ->
raise <| InconsistentResultFromDifferentServersOfSameCurrency(account.Currency, inconsistencyExcpetion)
| :? ResultInconsistencyException as innerEx ->
raise <| InconsistentResultFromDifferentServersOfSameCurrency(account.Currency, innerEx)

let GetShowableBalance (account: IAccount)
(mode: ServerSelectionMode)
Expand Down
7 changes: 0 additions & 7 deletions src/GWallet.Backend/FaultTolerantParallelClient.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ type ResultInconsistencyException (totalNumberOfSuccesfulResultsObtained: int,
maxNumberOfConsistentResultsObtained
numberOfConsistentResultsRequired)

type InconsistentResultFromDifferentServersOfSameCurrency(currency: Currency,
innerException: ResultInconsistencyException) =
inherit Exception (SPrintF2 "Error retrieving info for currency %s: %s"
(currency.ToString())
innerException.Message,
innerException)

type UnsuccessfulServer<'K,'R when 'K: equality and 'K :> ICommunicationHistory> =
{
Server: Server<'K,'R>
Expand Down

0 comments on commit 8d9e954

Please sign in to comment.