@@ -1838,14 +1838,21 @@ mkApiCoinSelection mcerts (UnsignedTx inputs outputs) =
18381838 -> NonEmpty DerivationIndex
18391839 -> NonEmpty Api. ApiCertificate
18401840 mkCertificates action xs =
1841- let apiStakePath = ApiT <$> xs
1842- in case action of
1843- Join pid -> Api. JoinPool apiStakePath (ApiT pid) :| []
1844- RegisterKeyAndJoin pid ->
1845- Api. RegisterRewardAccount apiStakePath :|
1846- [Api. JoinPool apiStakePath (ApiT pid)]
1847- Quit -> Api. QuitPool apiStakePath :| []
1841+ case action of
1842+ Join pid -> NE. fromList
1843+ [ Api. JoinPool apiStakePath (ApiT pid)
1844+ ]
1845+
1846+ RegisterKeyAndJoin pid -> NE. fromList
1847+ [ Api. RegisterRewardAccount apiStakePath
1848+ , Api. JoinPool apiStakePath (ApiT pid)
1849+ ]
18481850
1851+ Quit -> NE. fromList
1852+ [ Api. QuitPool apiStakePath
1853+ ]
1854+ where
1855+ apiStakePath = ApiT <$> xs
18491856 mkAddressAmount :: TxOut -> AddressAmount (ApiT Address , Proxy n )
18501857 mkAddressAmount (TxOut addr (Coin c)) =
18511858 AddressAmount (ApiT addr, Proxy @ n ) (Quantity $ fromIntegral c)
@@ -2199,12 +2206,12 @@ instance Buildable e => LiftHandler (ErrSelectCoinsExternal e) where
21992206 ErrSelectCoinsExternalUnableToMakeSelection e ->
22002207 handler e
22012208 ErrSelectCoinsExternalUnableToAssignInputs e ->
2202- apiError err403 UnableToAssignInputOutput $ mconcat
2203- [ " Unable to assign inputs from coin selection: "
2209+ apiError err500 UnableToAssignInputOutput $ mconcat
2210+ [ " I'm unable to assign inputs from coin selection: "
22042211 , pretty e]
22052212 ErrSelectCoinsExternalUnableToAssignOutputs e ->
2206- apiError err403 UnableToAssignInputOutput $ mconcat
2207- [ " Unable to assign outputs from coin selection: "
2213+ apiError err500 UnableToAssignInputOutput $ mconcat
2214+ [ " I'm unable to assign outputs from coin selection: "
22082215 , pretty e]
22092216
22102217instance Buildable e => LiftHandler (ErrCoinSelection e ) where
@@ -2507,12 +2514,12 @@ instance LiftHandler ErrJoinStakePool where
25072514 , toText pid
25082515 ]
25092516 ErrJoinStakePoolUnableToAssignInputs e ->
2510- apiError err403 UnableToAssignInputOutput $ mconcat
2511- [ " Unable to assign inputs from coin selection: "
2517+ apiError err500 UnableToAssignInputOutput $ mconcat
2518+ [ " I'm unable to assign inputs from coin selection: "
25122519 , pretty e]
25132520 ErrJoinStakePoolUnableToAssignOutputs e ->
2514- apiError err403 UnableToAssignInputOutput $ mconcat
2515- [ " Unable to assign outputs from coin selection: "
2521+ apiError err500 UnableToAssignInputOutput $ mconcat
2522+ [ " I'm unable to assign outputs from coin selection: "
25162523 , pretty e]
25172524
25182525instance LiftHandler ErrFetchRewards where
@@ -2551,12 +2558,12 @@ instance LiftHandler ErrQuitStakePool where
25512558 , " lovelace first."
25522559 ]
25532560 ErrQuitStakePoolUnableToAssignInputs e ->
2554- apiError err403 UnableToAssignInputOutput $ mconcat
2555- [ " Unable to assign inputs from coin selection: "
2561+ apiError err500 UnableToAssignInputOutput $ mconcat
2562+ [ " I'm unable to assign inputs from coin selection: "
25562563 , pretty e]
25572564 ErrQuitStakePoolUnableToAssignOutputs e ->
2558- apiError err403 UnableToAssignInputOutput $ mconcat
2559- [ " Unable to assign outputs from coin selection: "
2565+ apiError err500 UnableToAssignInputOutput $ mconcat
2566+ [ " I'm unable to assign outputs from coin selection: "
25602567 , pretty e]
25612568
25622569instance LiftHandler ErrCreateRandomAddress where
0 commit comments