Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
PR github suggestions

Co-authored-by: Noon <[email protected]>
  • Loading branch information
v0d1ch and noonio committed Dec 16, 2024
1 parent 2b81d80 commit 5d8f1f4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ changes.
with the community members building on Hydra. This feature means you can commit funds to a Head while it is running.
TODO: Implement missing spec changes.

- **BREAKING** hydra-node accepts multiple `hydra-scripts-tx-id` as the outcome of changes in the Hydra scripts publishing.
- **BREAKING** hydra-node accepts multiple `hydra-scripts-tx-id` as a comma-seperated list, as the outcome of changes in the Hydra scripts publishing.

- Tested with `cardano-node 10.1.2` and `cardano-cli 10.1.1.0`.

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/dev/incremental-commits-and-decommits.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ curl -X POST <IP>:<PORT>/commit --data @commit.json

:::info

Note that commit transaction, which is sent to the hydra-node API, only needs
Note that the commit transaction, which is sent to the hydra-node API, only needs
to specify the transaction inputs present in L1 that we want to make available
on L2. It will ignore any specified outputs and instead the owner of
incremented `UTxO` on L2 is the same one that owned the funds on L1.
Expand All @@ -49,7 +49,7 @@ It goes together with a `UTxO` used to resolve the transaction inputs. It's
purpose is to prove that one can spend specified transaction inputs.

Successfull API response includes a _deposit_ transaction that needs to be
signed and submitted by the user in order to kick of the deposit process.
signed and submitted by the user in order to kick-off the deposit process.

This process just locks the specified `UTxO` at a deposit script address which
will then, later on, after confirmed snapshot, be unlocked by the _increment_
Expand All @@ -67,7 +67,7 @@ Once a hydra-node observes a deposit transaction it will record the deposit as
pending into the local state. There can be many pending deposits but the new
Snapshot will include them one by one.

When this new Snapshot is ackgnowledged by all parties _increment_ transaction
When this new Snapshot is acknowledged by all parties _increment_ transaction
will be posted by the leader.

:::info
Expand Down
1 change: 0 additions & 1 deletion hydra-cluster/src/Hydra/Cluster/Faucet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ createOutputAtAddress ::
createOutputAtAddress node@RunningNode{networkId, nodeSocket} atAddress datum val = do
(faucetVk, faucetSk) <- keysFor Faucet
utxo <- findFaucetUTxO node 0
-- pparams <- queryProtocolParameters networkId nodeSocket QueryTip
let collateralTxIns = mempty
let output = TxOut atAddress val datum ReferenceScriptNone
-- let output =
Expand Down
3 changes: 1 addition & 2 deletions hydra-tx/src/Hydra/Tx/Recover.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Hydra.Ledger.Cardano.Builder (
import Hydra.Plutus (depositValidatorScript)
import Hydra.Tx (HeadId, mkHeadId)
import Hydra.Tx.Utils (mkHydraHeadV1TxName)
import PlutusLedgerApi.V1 (CurrencySymbol, POSIXTime)

-- | Builds a recover transaction to recover locked funds from the v_deposit script.
recoverTx ::
Expand Down Expand Up @@ -64,7 +63,7 @@ observeRecoverTx networkId utxo tx = do
let inputUTxO = resolveInputsUTxO utxo tx
(TxIn depositTxId _, depositOut) <- findTxOutByScript @PlutusScriptV3 inputUTxO depositScript
dat <- txOutScriptData $ toTxContext depositOut
(headCurrencySymbol, _, onChainDeposits) <- fromScriptData dat :: Maybe (CurrencySymbol, POSIXTime, [Commit.Commit])
(headCurrencySymbol, _, onChainDeposits) <- fromScriptData dat :: Maybe Deposit.DepositDatum
deposits <- do
depositedUTxO <- traverse (Commit.deserializeCommit (networkIdToNetwork networkId)) onChainDeposits
pure $ UTxO.fromPairs depositedUTxO
Expand Down

0 comments on commit 5d8f1f4

Please sign in to comment.