Skip to content

Commit 3367473

Browse files
committed
resolvong review comments
1 parent 9681566 commit 3367473

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

bot-plutus-interface.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ library
8282
BotPlutusInterface.ChainIndex
8383
BotPlutusInterface.Contract
8484
BotPlutusInterface.Effects
85-
BotPlutusInterface.Estimate
85+
BotPlutusInterface.ExBudget
8686
BotPlutusInterface.Files
8787
BotPlutusInterface.Helpers
8888
BotPlutusInterface.QueryNode

src/BotPlutusInterface/Balance.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ balanceTxIO pabConf ownPkh unbalancedTx =
136136
txWithoutFees <-
137137
hoistEither $ balanceTxStep minUtxos utxoIndex changeAddr $ tx `withFee` 0
138138

139-
exBudget <- newEitherT $ BodyBuilder.buildRaw @w pabConf privKeys txWithoutFees
139+
exBudget <- newEitherT $ BodyBuilder.buildAndEstimateBudget @w pabConf privKeys txWithoutFees
140140

141141
nonBudgettedFees <- newEitherT $ CardanoCLI.calculateMinFee @w pabConf txWithoutFees
142142

src/BotPlutusInterface/BodyBuilder.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{- | Module provides the way of building ".raw" transactions with execution budget
44
estimated with `Cardano.Api` tools.
55
-}
6-
module BotPlutusInterface.BodyBuilder (buildRaw) where
6+
module BotPlutusInterface.BodyBuilder (buildAndEstimateBudget) where
77

88
import BotPlutusInterface.CardanoCLI qualified as CardanoCLI
99
import BotPlutusInterface.Effects (PABEffect, estimateBudget)
@@ -28,14 +28,14 @@ import Prelude
2828
then uses body of this transaction to estimate execution budget
2929
and build final body with budget set.
3030
-}
31-
buildRaw ::
31+
buildAndEstimateBudget ::
3232
forall (w :: Type) (effs :: [Type -> Type]).
3333
Member (PABEffect w) effs =>
3434
PABConfig ->
3535
Map PubKeyHash DummyPrivKey ->
3636
Tx ->
3737
Eff effs (Either Text ExBudget)
38-
buildRaw pabConf privKeys tx = runEitherT $ do
38+
buildAndEstimateBudget pabConf privKeys tx = runEitherT $ do
3939
buildDraftTxBody
4040
>> estimateBudgetByDraftBody (Text.unpack $ txFilePath pabConf "raw" (txId tx))
4141
>>= buildBodyUsingEstimatedBudget

src/BotPlutusInterface/Contract.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ writeBalancedTx contractEnv (Right tx) = do
249249
skeys = Map.filter (\case FromSKey _ -> True; FromVKey _ -> False) privKeys
250250
signable = all ((`Map.member` skeys) . Ledger.pubKeyHash) requiredSigners
251251

252-
void $ newEitherT $ BodyBuilder.buildRaw @w pabConf privKeys tx
252+
void $ newEitherT $ BodyBuilder.buildAndEstimateBudget @w pabConf privKeys tx
253253

254254
-- TODO: This whole part is hacky and we should remove it.
255255
let path = Text.unpack $ Files.txFilePath pabConf "raw" (Tx.txId tx)

src/BotPlutusInterface/Effects.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module BotPlutusInterface.Effects (
2323
) where
2424

2525
import BotPlutusInterface.ChainIndex (handleChainIndexReq)
26-
import BotPlutusInterface.Estimate qualified as Estimate
26+
import BotPlutusInterface.ExBudget qualified as ExBudget
2727
import BotPlutusInterface.Types (
2828
BudgetEstimationError,
2929
CLILocation (..),
@@ -131,7 +131,7 @@ handlePABEffect contractEnv =
131131
QueryChainIndex query ->
132132
handleChainIndexReq contractEnv.cePABConfig query
133133
EstimateBudget txPath ->
134-
Estimate.estimateBudget contractEnv.cePABConfig txPath
134+
ExBudget.estimateBudget contractEnv.cePABConfig txPath
135135
)
136136

137137
printLog' :: LogLevel -> LogLevel -> String -> IO ()

src/BotPlutusInterface/Estimate.hs renamed to src/BotPlutusInterface/ExBudget.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- | Module contains implementation for `estimateBudget` effect
2-
module BotPlutusInterface.Estimate (
2+
module BotPlutusInterface.ExBudget (
33
estimateBudget,
44
) where
55

0 commit comments

Comments
 (0)