Skip to content

Commit c5d2624

Browse files
authored
Merge pull request #142 from mlabs-haskell/gergely/vasil-updating-apps
Vasil compliance: update to latest `plutus-apps` `next-node` (node 1.35.3)
2 parents 142f119 + 2fc77d6 commit c5d2624

19 files changed

+202
-165
lines changed

bot-plutus-interface.cabal

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ common common-lang
2727
-Wall -Wcompat -Wincomplete-record-updates
2828
-Wincomplete-uni-patterns -Wredundant-constraints -fobject-code
2929
-fno-ignore-interface-pragmas -fno-omit-interface-pragmas
30-
-fplugin=RecordDotPreprocessor
31-
32-
-- -Werror
30+
-fplugin=RecordDotPreprocessor -Werror
3331

3432
build-depends:
3533
, base
@@ -109,6 +107,7 @@ library
109107
, cardano-api
110108
, cardano-crypto
111109
, cardano-ledger-alonzo
110+
, cardano-ledger-babbage
112111
, cardano-ledger-core
113112
, cardano-ledger-shelley
114113
, cardano-prelude

flake.lock

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# all inputs below here are for pinning with haskell.nix
1818
cardano-addresses = {
1919
url =
20-
"github:input-output-hk/cardano-addresses/b6f2f3cef01a399376064194fd96711a5bdba4a7";
20+
"github:input-output-hk/cardano-addresses/b7273a5d3c21f1a003595ebf1e1f79c28cd72513";
2121
flake = false;
2222
};
2323
cardano-base = {
@@ -37,12 +37,12 @@
3737
};
3838
cardano-ledger = {
3939
url =
40-
"github:input-output-hk/cardano-ledger/3be8a19083fc13d9261b1640e27dd389b51bb08e";
40+
"github:input-output-hk/cardano-ledger/c7c63dabdb215ebdaed8b63274965966f2bf408f";
4141
flake = false;
4242
};
4343
cardano-node = {
4444
url =
45-
"github:input-output-hk/cardano-node/c75451f0ffd7a60b5ad6c4263891e6c8acac105a";
45+
"github:input-output-hk/cardano-node?ref=1.35.3-rc1";
4646
flake = false; # we need it to be available in shell
4747
};
4848
cardano-prelude = {
@@ -51,7 +51,7 @@
5151
flake = false;
5252
};
5353
cardano-wallet = {
54-
url = "github:input-output-hk/cardano-wallet/2ac308b00d9d4a3435f6b9594ded9495e2b217eb";
54+
url = "github:input-output-hk/cardano-wallet/18a931648550246695c790578d4a55ee2f10463e";
5555
flake = false;
5656
};
5757
ekg-forward = {
@@ -74,15 +74,15 @@
7474
flake = false;
7575
};
7676
hedgehog-extras = {
77-
url = "github:input-output-hk/hedgehog-extras/967d79533c21e33387d0227a5f6cc185203fe658";
77+
url = "github:input-output-hk/hedgehog-extras/714ee03a5a786a05fc57ac5d2f1c2edce4660d85";
7878
flake = false;
7979
};
8080
hysterical-screams = {
8181
url = "github:raduom/hysterical-screams/4c523469e9efd3f0d10d17da3304923b7b0e0674";
8282
flake = false;
8383
};
8484
hw-aeson = {
85-
url = "github:haskell-works/hw-aeson/d99d2f3e39a287607418ae605b132a3deb2b753f";
85+
url = "github:haskell-works/hw-aeson/b5ef03a7d7443fcd6217ed88c335f0c411a05408";
8686
flake = false;
8787
};
8888
iohk-monitoring-framework = {
@@ -102,17 +102,18 @@
102102
};
103103
ouroboros-network = {
104104
url =
105-
"github:input-output-hk/ouroboros-network/a65c29b6a85e90d430c7f58d362b7eb097fd4949";
105+
"github:input-output-hk/ouroboros-network/cb9eba406ceb2df338d8384b35c8addfe2067201";
106106
flake = false;
107107
};
108108
plutus = {
109109
url =
110-
"github:input-output-hk/plutus/69ab98c384703172f898eb5bcad1078ded521426";
110+
"github:input-output-hk/plutus/a56c96598b4b25c9e28215214d25189331087244";
111111
flake = false;
112112
};
113113
plutus-apps = {
114114
url =
115-
"github:mlabs-haskell/plutus-apps/5cd1682b1ccf8f12c64fc0c1731d61fee41779f6";
115+
"github:mikekeke/plutus-apps/efdb04b602ade22245769f7e52d07475b3e8c339";
116+
# "git+file:///home/mike/dev/iog/plutus-apps-bpi-debug?rev=7ab52429bfe1b88dd46c72727b40f871d3fb8d63";
116117
flake = false;
117118
};
118119
purescript-bridge = {
@@ -358,6 +359,7 @@
358359
"playground-common"
359360
"plutus-chain-index"
360361
"plutus-chain-index-core"
362+
"plutus-hysterical-screams"
361363
"plutus-contract"
362364
"plutus-contract-certification"
363365
"plutus-ledger"
@@ -411,7 +413,7 @@
411413
additional = ps: [
412414
ps.plutus-pab
413415
];
414-
withHoogle = false;
416+
withHoogle = true;
415417
tools.haskell-language-server = { };
416418
exactDeps = true;
417419
nativeBuildInputs = with pkgs'; [

src/BotPlutusInterface/Balance.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ balanceTxStep balanceCfg utxos changeAddr tx =
280280
getChange :: Map TxOutRef TxOut -> Tx -> Value
281281
getChange utxos tx =
282282
let fees = lovelaceValue $ txFee tx
283-
txInRefs = map Tx.txInRef $ Set.toList $ txInputs tx
283+
txInRefs = map Tx.txInRef $ txInputs tx
284284
inputValue = mconcat $ map Tx.txOutValue $ mapMaybe (`Map.lookup` utxos) txInRefs
285285
outputValue = mconcat $ map Tx.txOutValue $ txOutputs tx
286286
nonMintedOutputValue = outputValue `minus` txMint tx
@@ -311,21 +311,23 @@ balanceTxIns utxos tx = do
311311
[ txFee tx
312312
, nonMintedValue
313313
]
314-
txIns <- newEitherT $ selectTxIns @w (txInputs tx) utxos minSpending
315-
pure $ tx {txInputs = txIns <> txInputs tx}
314+
txIns <- newEitherT $ selectTxIns @w (Set.fromList $ txInputs tx) utxos minSpending
315+
-- FIXME: maybe better way to handle to <> from Set, as now using list here will break balancing
316+
-- constantly adding inputs and running balance loop forever
317+
pure $ tx {txInputs = Set.toList (txIns <> Set.fromList (txInputs tx))}
316318

317319
-- | Set collateral or fail in case it's required but not available
318320
addTxCollaterals :: CollateralUtxo -> Tx -> Tx
319321
addTxCollaterals cOut tx
320-
| txUsesScripts tx = tx {txCollateral = Set.singleton (Tx.pubKeyTxIn (collateralTxOutRef cOut))}
322+
| txUsesScripts tx = tx {txCollateral = [Tx.pubKeyTxIn (collateralTxOutRef cOut)]}
321323
| otherwise = tx
322324

323325
txUsesScripts :: Tx -> Bool
324326
txUsesScripts Tx {txInputs, txMintScripts} =
325327
not (null txMintScripts)
326328
|| any
327329
(\TxIn {txInType} -> case txInType of Just ConsumeScriptAddress {} -> True; _ -> False)
328-
(Set.toList txInputs)
330+
txInputs
329331

330332
-- | Ensures all non ada change goes back to user
331333
handleNonAdaChange :: BalanceConfig -> Address -> Map TxOutRef TxOut -> Tx -> Either Text Tx

0 commit comments

Comments
 (0)