Skip to content

Commit 4a9a395

Browse files
committed
Format.
1 parent e195ddc commit 4a9a395

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

src/BotPlutusInterface/Balance.hs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ import Ledger.Interval (
6666
)
6767
import Ledger.Time (POSIXTimeRange)
6868
import Ledger.Tx (
69+
ToCardanoError (InvalidValidityRange),
6970
Tx (..),
7071
TxIn (..),
7172
TxInType (..),
7273
TxOut (..),
73-
TxOutRef (..), ToCardanoError (InvalidValidityRange)
74+
TxOutRef (..),
7475
)
7576
import Ledger.Tx qualified as Tx
7677
import Ledger.Tx.CardanoAPI (CardanoBuildTx)
@@ -83,8 +84,8 @@ import Plutus.V1.Ledger.Api (
8384

8485
import Ledger.Constraints.OffChain qualified as Constraints
8586
import Prettyprinter (pretty, viaShow, (<+>))
87+
import Wallet.API qualified as WAPI
8688
import Prelude
87-
import qualified Wallet.API as WAPI
8889

8990
-- Config for balancing a `Tx`.
9091
data BalanceConfig = BalanceConfig
@@ -262,9 +263,10 @@ utxosAndCollateralAtAddress balanceCfg _pabConf changeAddr =
262263
if bcHasScripts balanceCfg
263264
then
264265
maybe
265-
( throwE $ WAPI.OtherError $
266-
"The given transaction uses script, but there's no collateral provided."
267-
<> "This usually means that, we failed to create Tx and update our ContractEnvironment."
266+
( throwE $
267+
WAPI.OtherError $
268+
"The given transaction uses script, but there's no collateral provided."
269+
<> "This usually means that, we failed to create Tx and update our ContractEnvironment."
268270
)
269271
(const $ pure (utxos, inMemCollateral))
270272
inMemCollateral
@@ -467,7 +469,8 @@ addOutput changeAddr tx =
467469
, txOutDatumHash = Nothing
468470
}
469471

470-
changeTxOutWithMinAmt <- newEitherT $
472+
changeTxOutWithMinAmt <-
473+
newEitherT $
471474
minUtxo @w changeTxOut
472475

473476
return $ tx {txOutputs = txOutputs tx ++ [changeTxOutWithMinAmt]}

src/BotPlutusInterface/CoinSelection.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Control.Lens (
2828
import Control.Monad.Except (foldM, throwError, unless)
2929
import Control.Monad.Freer (Eff, Member)
3030
import Control.Monad.Trans.Class (lift)
31-
import Control.Monad.Trans.Either (hoistEither, newEitherT, runEitherT, firstEitherT)
31+
import Control.Monad.Trans.Either (firstEitherT, hoistEither, newEitherT, runEitherT)
3232
import Data.Either.Combinators (isRight, maybeToRight)
3333
import Data.Kind (Type)
3434
import Data.List qualified as List
@@ -51,8 +51,8 @@ import Plutus.V1.Ledger.Api (
5151
Credential (PubKeyCredential, ScriptCredential),
5252
)
5353
import Prettyprinter (pretty, (<+>))
54+
import Wallet.API qualified as WAPI
5455
import Prelude
55-
import qualified Wallet.API as WAPI
5656

5757
{-
5858

src/BotPlutusInterface/Contract.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import Data.List.NonEmpty (NonEmpty ((:|)))
6868
import Data.Map qualified as Map
6969
import Data.Row (Row)
7070
import Data.Text (Text)
71+
import Data.Text qualified as T
7172
import Data.Text qualified as Text
7273
import Data.Vector qualified as V
7374
import Ledger (POSIXTime, getCardanoTxId)
@@ -93,10 +94,9 @@ import Plutus.Contract.Types (Contract (..), ContractEffs)
9394
import PlutusTx.Builtins (fromBuiltin)
9495
import Prettyprinter (Pretty (pretty), (<+>))
9596
import Prettyprinter qualified as PP
97+
import Wallet.API qualified as WAPI
9698
import Wallet.Emulator.Error (WalletAPIError (..))
9799
import Prelude
98-
import qualified Wallet.API as WAPI
99-
import qualified Data.Text as T
100100

101101
runContract ::
102102
forall (w :: Type) (s :: Row Type) (e :: Type) (a :: Type).

test/Spec/BotPlutusInterface/CoinSelection.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import Test.QuickCheck (Gen, Property, forAll, withMaxSuccess)
3232
import Test.Tasty (TestTree, testGroup)
3333
import Test.Tasty.HUnit (Assertion, assertFailure, testCase, (@?=))
3434
import Test.Tasty.QuickCheck (testProperty)
35+
import Wallet.API qualified as WAPI
3536
import Prelude
36-
import qualified Wallet.API as WAPI
3737

3838
tests :: TestTree
3939
tests =
@@ -176,8 +176,7 @@ validateBalancing = withMaxSuccess 10000 (forAll balanceGen validate)
176176
where
177177
validate :: (TxOut, Map TxOutRef TxOut) -> Bool
178178
validate (txOutput, utxos) =
179-
let
180-
result :: Either Text (Either WAPI.WalletAPIError (Set TxIn))
179+
let result :: Either Text (Either WAPI.WalletAPIError (Set TxIn))
181180
result =
182181
fst $
183182
runPABEffectPure def $

0 commit comments

Comments
 (0)