Skip to content
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

Can add_change_if_needed be called twice on a Transaction Builder? #517

Open
gavinharris-dev opened this issue Sep 7, 2022 · 1 comment

Comments

@gavinharris-dev
Copy link

Blockfrost ( provides a way to 'evaluate' a transaction that utilizes a Plutus Script, this evaluation returns the correct ExUnits that should be provided for each Redeemer.

I'm just wondering if it is possible to somehow allow (perhaps with a flag) to recall the add_change_if_needed method, or perhaps provide a means of recalculating the Fee (where we would need to also provide a TX Output to adjust (for change)) now that the Redeemer has been updated?

Example Blockfrost Evaluate response:

{
    "type": "jsonwsp/response",
    "version": "1.0",
    "servicename": "ogmios",
    "methodname": "EvaluateTx",
    "result": {
        "EvaluationResult": {
            "spend:1": {
                "memory": 1669212,
                "steps": 637231177
            }
        }
    },
    "reflection": {
        "id": "..."
    }
}
@lisicky
Copy link
Contributor

lisicky commented Dec 7, 2022

Hi @gavinharris-dev! Now it is impossible without modification in the CSL code. Because add_change_if_needed sets fee value in a TransactionBuilder and add_change_if_needed returns error if a TransactionBuilder already has fee value. Calling add_change_if_needed is a final step before calling build or build_tx in a TransactionBuilder. But you can create a new TransactionBuilder instance and do the same steps but with a new ExUnits.

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

No branches or pull requests

2 participants