Skip to content

Conversation

@palas
Copy link
Contributor

@palas palas commented Jan 16, 2026

Changelog

- description: |
    Removed requirement of "current treasury value" in transactions
  type:
  - compatible

Context

See #1149

How to trust this PR

Ensure that only the specified restriction was lifted and in the appropriate places. Ensure this is the right thing to do. Confirm I interpreted this message correctly: https://discord.com/channels/1136727663583698984/1239888777015590913/1364244737602879498

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@palas palas requested a review from Jimbo4350 January 17, 2026 01:12
@palas palas force-pushed the 1149-remove-requirement-of-current-treasury-withdrawal-for-transaction-in-build-raw-command branch from ca753ee to 24d7d28 Compare January 20, 2026 00:07
@palas palas force-pushed the 1149-remove-requirement-of-current-treasury-withdrawal-for-transaction-in-build-raw-command branch from d3f1e86 to edcde6f Compare January 20, 2026 15:19
pCurrentTreasuryValueAndDonation =
optional ((,) <$> pCurrentTreasuryValue' <*> pTreasuryDonation')
pCurrentTreasuryValue :: Parser (Maybe TxCurrentTreasuryValue)
pCurrentTreasuryValue =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not condense pCurrentTreasuryValue and pCurrentTreasuryValue' into one function? pCurrentTreasuryValue' is not used anywhere else.

asum
[ Opt.flag' IncludeCurrentTreasuryValue $
mconcat
[ Opt.long "include-current-treasury-value"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why deviate from the name that build-raw uses?

| TxCborNotCanonical
deriving (Eq, Show)

-- | Whether to include the current treasury value in the transaction body.
Copy link
Contributor

@Jimbo4350 Jimbo4350 Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better comment would elaborate that this is really aimed at Plutus scripts i.e it is exposed in the plutus script context. This is already implied since it's in the transaction body but being explicit about it lets us know what specifically it's related to.


-- | Whether to include the current treasury value in the transaction body.
-- If included, the current treasury value will be obtained from the node.
data IncludeCurrentTreasuryValue = IncludeCurrentTreasuryValue | ExcludeCurrentTreasuryValue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you introducing this sum type? It's not necessary. What is wrong with (Maybe TxCurrentTreasuryValue)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove requirement of "current treasury value" for transaction in build-raw command

4 participants