Skip to content

Commit

Permalink
Fix inlineDatum option in output
Browse files Browse the repository at this point in the history
  • Loading branch information
Sudip Bhattarai committed Feb 20, 2023
1 parent 4578136 commit af5f758
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Kuber can be stared easily with [docker-compose.yml](./docker-compose.yml) file.

```bash
git clone https://github.com/dquadrant/kuber.git
git checkout 2.3.0
git checkout 2.3.1
docker-compose up -d
```

Expand All @@ -71,7 +71,7 @@ In summary, to prepare your system for building kuber from sources, you have to:
Once everything is installed and ready, kuber will also be ready to run
```
cabal update
CARDANO_NODE_SOCKET_PATH=/home/user/.cardano/testnet/node.socket cabal run exe:kuber
CARDANO_NODE_SOCKET_PATH=/home/user/.cardano/preprod/node.socket NETWORK=preprod cabal run exe:kuber
```

This will start kuber on port `8081`.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ services:
max-size: "200k"
max-file: "10"
kuber:
image: dquadrant/kuber:${KUBER_VERSION:-2.2.0}
image: dquadrant/kuber:${KUBER_VERSION:-2.3.1}
environment:
NETWORK: ${NETWORK:- preprod}
NETWORK: ${NETWORK:- preprod}
volumes:
- node-ipc:/root/.cardano/preprod/
# -node-ipc:/root/.cardano/mainnet/ for NETWORK=mainnet or set CARDANO_NODE_SOCKET_PATH explicitly
Expand Down
2 changes: 1 addition & 1 deletion kuber.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: kuber
version: 2.3.0.0
version: 2.3.1.0

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
2 changes: 1 addition & 1 deletion server/kuber-server.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: kuber-server
version: 2.3.0.0
version: 2.3.1.0

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
18 changes: 7 additions & 11 deletions src/Cardano/Kuber/Data/TxBuilderAeson.hs
Original file line number Diff line number Diff line change
Expand Up @@ -511,17 +511,13 @@ instance FromJSON (TxOutput TxOutputContent ) where
Just val -> parseJSON val
_ -> pure $ valueFromList []
datumHashE <- parseData
shouldEmbed <- v .:? "inline" .!= True
let txOutDatum=if shouldEmbed
then case datumHashE of
Nothing -> TxOutDatumNone
Just (Left sd) -> TxOutDatumInline ReferenceTxInsScriptsInlineDatumsInBabbageEra sd
Just (Right dh) -> TxOutDatumHash ScriptDataInBabbageEra dh
else (case datumHashE of
Just (Left datum) -> TxOutDatumHash ScriptDataInBabbageEra (hashScriptData datum)
Just (Right dh) -> TxOutDatumHash ScriptDataInBabbageEra dh
_ -> TxOutDatumNone
)
shouldEmbed <- v .:? "inlineDatum" .!= True
let txOutDatum=case datumHashE of
Nothing -> TxOutDatumNone
Just (Left sd) -> if shouldEmbed
then TxOutDatumInline ReferenceTxInsScriptsInlineDatumsInBabbageEra sd
else TxOutDatumHash ScriptDataInBabbageEra (hashScriptData sd)
Just (Right dh) -> TxOutDatumHash ScriptDataInBabbageEra dh
mScript_ <- v .:? "script"
mScript <- case mScript_ of
Nothing -> v .:? "inlineScript"
Expand Down

0 comments on commit af5f758

Please sign in to comment.