@@ -6,10 +6,11 @@ module Cardano.Wallet.WalletLayer
6
6
-- ** Errors
7
7
, CreateWalletError (.. )
8
8
, GetWalletError (.. )
9
+ , GetAddressPoolGapError (.. )
10
+ , GetEosWalletError (.. )
9
11
, UpdateWalletError (.. )
10
12
, UpdateWalletPasswordError (.. )
11
13
, DeleteWalletError (.. )
12
- , DeleteEosWalletError (.. )
13
14
, GetUtxosError (.. )
14
15
, NewPaymentError (.. )
15
16
, EstimateFeesError (.. )
@@ -114,6 +115,40 @@ instance Buildable GetWalletError where
114
115
build (GetWalletWalletIdDecodingFailed txt) =
115
116
bprint (" GetWalletWalletIdDecodingFailed " % build) txt
116
117
118
+ data GetAddressPoolGapError =
119
+ GetEosWalletErrorNoAccounts Text
120
+ | GetEosWalletErrorWrongAccounts Text
121
+ | GetEosWalletErrorGapsDiffer Text
122
+ deriving Eq
123
+
124
+ instance Buildable GetAddressPoolGapError where
125
+ build (GetEosWalletErrorNoAccounts txt) =
126
+ bprint (" GetEosWalletErrorNoAccounts " % build) txt
127
+ build (GetEosWalletErrorWrongAccounts txt) =
128
+ bprint (" FO-accounts found in EOS-wallet " % build) txt
129
+ build (GetEosWalletErrorGapsDiffer txt) =
130
+ bprint (" Address pool gaps differ, for EOS-wallet " % build) txt
131
+
132
+ data GetEosWalletError =
133
+ GetEosWalletError Kernel. UnknownHdRoot
134
+ | GetEosWalletWalletIdDecodingFailed Text
135
+ | GetEosWalletErrorAddressPoolGap GetAddressPoolGapError
136
+ deriving Eq
137
+
138
+ -- | Unsound show instance needed for the 'Exception' instance.
139
+ instance Show GetEosWalletError where
140
+ show = formatToString build
141
+
142
+ instance Exception GetEosWalletError
143
+
144
+ instance Buildable GetEosWalletError where
145
+ build (GetEosWalletError kernelError) =
146
+ bprint (" GetEosWalletError " % build) kernelError
147
+ build (GetEosWalletWalletIdDecodingFailed txt) =
148
+ bprint (" GetEosWalletWalletIdDecodingFailed " % build) txt
149
+ build (GetEosWalletErrorAddressPoolGap gapError) =
150
+ bprint (" GetEosWalletErrorAddressPoolGap " % build) gapError
151
+
117
152
data UpdateWalletError =
118
153
UpdateWalletError Kernel. UnknownHdRoot
119
154
| UpdateWalletErrorNotFound WalletId
@@ -168,19 +203,6 @@ instance Buildable DeleteWalletError where
168
203
build (DeleteWalletError kernelError) =
169
204
bprint (" DeleteWalletError " % build) kernelError
170
205
171
- data DeleteEosWalletError =
172
- DeleteEosWalletError Kernel. UnknownHdRoot
173
-
174
- -- | Unsound show instance needed for the 'Exception' instance.
175
- instance Show DeleteEosWalletError where
176
- show = formatToString build
177
-
178
- instance Exception DeleteEosWalletError
179
-
180
- instance Buildable DeleteEosWalletError where
181
- build (DeleteEosWalletError kernelError) =
182
- bprint (" DeleteEosWalletError " % build) kernelError
183
-
184
206
data GetUtxosError =
185
207
GetUtxosWalletIdDecodingFailed Text
186
208
| GetUtxosGetAccountsError Kernel. UnknownHdRoot
@@ -429,7 +451,9 @@ data PassiveWalletLayer m = PassiveWalletLayer
429
451
-- fully-owned wallets
430
452
createWallet :: CreateWallet -> m (Either CreateWalletError Wallet )
431
453
, getWallets :: m (IxSet Wallet )
454
+ , getEosWallets :: m (Either GetEosWalletError (IxSet EosWallet ))
432
455
, getWallet :: WalletId -> m (Either GetWalletError Wallet )
456
+ , getEosWallet :: WalletId -> m (Either GetEosWalletError EosWallet )
433
457
, updateWallet :: WalletId
434
458
-> WalletUpdate
435
459
-> m (Either UpdateWalletError Wallet )
@@ -439,7 +463,7 @@ data PassiveWalletLayer m = PassiveWalletLayer
439
463
, deleteWallet :: WalletId -> m (Either DeleteWalletError () )
440
464
-- externally-owned wallets
441
465
, createEosWallet :: NewEosWallet -> m (Either CreateWalletError EosWallet )
442
- , deleteEosWallet :: WalletId -> m (Either DeleteEosWalletError () )
466
+ , deleteEosWallet :: WalletId -> m (Either DeleteWalletError () )
443
467
, getUtxos :: WalletId
444
468
-> m (Either GetUtxosError [(Account , Utxo )])
445
469
-- accounts
0 commit comments