Skip to content

Commit 6928644

Browse files
committed
Fix formatting
1 parent 2ba7175 commit 6928644

File tree

2 files changed

+23
-30
lines changed

2 files changed

+23
-30
lines changed

src/BotPlutusInterface/Types.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ addBudget :: TxId -> TxBudget -> ContractStats -> ContractStats
120120
addBudget txId budget stats =
121121
stats {estimatedBudgets = Map.insert txId budget (estimatedBudgets stats)}
122122

123-
124123
instance Semigroup TxBudget where
125124
TxBudget s m <> TxBudget s' m' = TxBudget (s <> s') (m <> m')
126125

test/Spec/BotPlutusInterface/ContractStats.hs

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module Spec.BotPlutusInterface.ContractStats (tests) where
22

3-
import BotPlutusInterface.Types
4-
( ContractEnvironment (cePABConfig),
5-
PABConfig (pcCollectStats, pcOwnPubKeyHash),
6-
)
3+
import BotPlutusInterface.Types (
4+
ContractEnvironment (cePABConfig),
5+
PABConfig (pcCollectStats, pcOwnPubKeyHash),
6+
)
77
import Control.Lens ((&), (.~), (^.))
88
import Data.Default (def)
99
import Data.Text (Text)
@@ -12,21 +12,21 @@ import Ledger (PaymentPubKeyHash (unPaymentPubKeyHash))
1212
import Ledger.Ada qualified as Ada
1313
import Ledger.Constraints qualified as Constraints
1414
import Ledger.Tx (CardanoTx, TxOut (TxOut), TxOutRef (TxOutRef))
15-
import Plutus.Contract
16-
( Contract (..),
17-
Endpoint,
18-
submitTx,
19-
)
20-
import Spec.MockContract
21-
( contractEnv,
22-
mockBudget,
23-
paymentPkh1,
24-
paymentPkh2,
25-
pkhAddr1,
26-
runContractPure,
27-
statsUpdates,
28-
utxos,
29-
)
15+
import Plutus.Contract (
16+
Contract (..),
17+
Endpoint,
18+
submitTx,
19+
)
20+
import Spec.MockContract (
21+
contractEnv,
22+
mockBudget,
23+
paymentPkh1,
24+
paymentPkh2,
25+
pkhAddr1,
26+
runContractPure,
27+
statsUpdates,
28+
utxos,
29+
)
3030
import Test.Tasty (TestTree, testGroup)
3131
import Test.Tasty.HUnit (Assertion, assertFailure, testCase, (@?=))
3232
import Prelude
@@ -35,8 +35,8 @@ tests :: TestTree
3535
tests =
3636
testGroup
3737
"Collecting contract stats"
38-
[ testCase "Budget added when saving enabled" budgetSavingEnabled,
39-
testCase "Budget NOT added with default (`False`) option" budgetSavingDisabled
38+
[ testCase "Budget added when saving enabled" budgetSavingEnabled
39+
, testCase "Budget NOT added with default (`False`) option" budgetSavingDisabled
4040
]
4141

4242
budgetSavingEnabled :: Assertion
@@ -46,14 +46,8 @@ budgetSavingEnabled = do
4646
initState =
4747
def & utxos .~ [(txOutRef, txOut)]
4848
& contractEnv .~ contractEnv'
49-
contractEnv' =
50-
def
51-
{ cePABConfig =
52-
def
53-
{ pcOwnPubKeyHash = unPaymentPubKeyHash paymentPkh1,
54-
pcCollectStats = True
55-
}
56-
}
49+
pabConf = def {pcOwnPubKeyHash = unPaymentPubKeyHash paymentPkh1, pcCollectStats = True}
50+
contractEnv' = def {cePABConfig = pabConf}
5751

5852
contract :: Contract () (Endpoint "SendAda" ()) Text CardanoTx
5953
contract = do

0 commit comments

Comments
 (0)