-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate possible cases of ErrBalanceTx
to ErrCreatePayment
#4891
base: master
Are you sure you want to change the base?
Conversation
@@ -55,15 +78,108 @@ import qualified Data.Text as T | |||
|
|||
data ErrCreatePayment | |||
= ErrCreatePaymentNotRecentEra (Read.EraValue Read.Era) | |||
| ErrCreatePaymentBalanceTx (Write.ErrBalanceTx Write.Conway) | |||
| ErrNotEnoughAda { shortfall :: Value } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only providing the shortfall
field allows us to merge Write.ErrBalanceTxAssetsInsufficient
and Write.ErrBalanceTxUnableToCreateChange
, which seems desirable. We'd probably ideally want some more info though.
@@ -16,6 +16,7 @@ module Cardano.Wallet.Deposit.Write | |||
, TxBody (..) | |||
, TxIn | |||
, TxOut | |||
, Coin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is probably clashes with the read Coin type
Write.ErrBalanceTxOutputError (Write.ErrBalanceTxOutputErrorOf ix (Write.ErrBalanceTxOutputAdaQuantityInsufficient{minimumExpectedCoin})) -> | ||
ErrTxOutAdaInsufficient { outputIx = ix, suggestedMinimum = minimumExpectedCoin } | ||
Write.ErrBalanceTxOutputError (Write.ErrBalanceTxOutputErrorOf _ix (Write.ErrBalanceTxOutputSizeExceedsLimit{})) -> | ||
impossible "value can't be too big if there are no assets" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, but createPayment
does actually take Values and not Coins... This is possible then...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are now translated.
efcbc07
to
9ab7171
Compare
…Limit` While it's not possible to send assets from the deposit wallet ui, this is currently possible with the internal 'createPayment' function.
176bfe7
to
3210b4a
Compare
ErrBalanceTxConflictingNetworks
ErrBalanceTx
toErrCreatePayment
Comments
Issue Number
#4877