-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cardano-api: 8.29.1.0 -> 8.37.0.0 #1232
Changes from all commits
b8016a2
8bbf6fc
288d5db
82a47a5
eb3dd66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ mkTxOutAutoBalance :: | |
ReferenceScript Era -> | ||
TxOut CtxTx Era | ||
mkTxOutAutoBalance pparams addr val dat ref = | ||
let out = TxOut addr (TxOutValue maryEraOnwards val) dat ref | ||
let out = TxOut addr (TxOutValueShelleyBased (shelleyBasedEra @Era) (toLedgerValue (maryEraOnwards @Era) val)) dat ref | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should: use This seemingly has become a lot more complicated now (too complicated? smell?) and hence we should keep the complexity in one function only. |
||
minValue = minUTxOValue pparams out | ||
in modifyTxOutValue (const minValue) out | ||
|
||
|
@@ -61,6 +61,7 @@ modifyTxOutAddress fn (TxOut addr value dat ref) = | |
-- | Alter the value of a 'TxOut' with the given transformation. | ||
modifyTxOutValue :: | ||
IsMaryEraOnwards era => | ||
IsShelleyBasedEra era => | ||
(Value -> Value) -> | ||
TxOut ctx era -> | ||
TxOut ctx era | ||
|
@@ -160,12 +161,13 @@ toLedgerTxOut = | |
-- NOTE: Requires the 'Network' discriminator (Testnet or Mainnet) because | ||
-- Plutus addresses are stripped off it. | ||
fromPlutusTxOut :: | ||
forall era. | ||
(IsMaryEraOnwards era, IsAlonzoEraOnwards era, IsBabbageEraOnwards era, IsShelleyBasedEra era) => | ||
Network -> | ||
Plutus.TxOut -> | ||
Maybe (TxOut CtxUTxO era) | ||
fromPlutusTxOut network out = do | ||
value <- TxOutValue maryEraOnwards <$> fromPlutusValue plutusValue | ||
value <- shelleyBasedEraConstraints (shelleyBasedEra @era) $ TxOutValueShelleyBased (shelleyBasedEra @era) <$> (toLedgerValue (maryEraOnwards @era) <$> fromPlutusValue plutusValue) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should: use This seemingly has become a lot more complicated now (too complicated? smell?) and hence we should keep the complexity in one function only. |
||
pure $ TxOut addressInEra value datum ReferenceScriptNone | ||
where | ||
addressInEra = fromPlutusAddress network plutusAddress | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,9 @@ import Hydra.Cardano.Api.MaryEraOnwards (IsMaryEraOnwards (..)) | |
-- | Inject some 'Value' into a 'TxOutValue' | ||
mkTxOutValue :: | ||
forall era. | ||
IsShelleyBasedEra era => | ||
IsMaryEraOnwards era => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to keep both constraints here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Neither implies the other |
||
Value -> | ||
TxOutValue era | ||
mkTxOutValue = | ||
TxOutValue (maryEraOnwards @era) | ||
mkTxOutValue v = | ||
shelleyBasedEraConstraints (shelleyBasedEra @era) $ TxOutValueShelleyBased (shelleyBasedEra @era) (toLedgerValue (maryEraOnwards @era) v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we keep the
HasCallStack
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this function seemingly can be made total now