Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

SCP-2924: Fix ExportTx format #45

Merged
merged 2 commits into from
Oct 22, 2021
Merged

SCP-2924: Fix ExportTx format #45

merged 2 commits into from
Oct 22, 2021

Conversation

j-mueller
Copy link
Contributor

@j-mueller j-mueller commented Oct 22, 2021

Update the ExportTx type to match what is expected by the wallet's balanceTx endpoint.

  • We need to fix the code that creates UnbalancedTx on our side to include ony script inputs. The wallet can't deal with public key inputs that aren't its own (and it knows all the ones it owns anyway, so we don't need to include them). See SCP-2925 and SCP-2945

Example JSON:

{
    "transaction": {
        "cborHex": "84a6008182582040ecfe83917b4a...90038ffffff820000840100d87980820000f5f6",
        "description": "",
        "type": "Tx AlonzoEra"
    },
    "redeemers": [
        {
            "input": {
                "id": "40ecfe83917b4a7a54503971ac713585d5db67ec83cc289118924c35af687618",
                "index": 2
            },
            "purpose": "spending",
            "data": "d8799fd8799fd8799f1832ffffd8799f5840ee982bdefb27b57d70ca024416d722e254b3b74296d2232b32dad7c64c6c08f0d1aa17cbc474ed9448330e08578ef0b6efd9be46200fd650308c67977700390d5820d57ea5c597d64721cbe98293c76fe068ea0808e0f3fc99dd9cfcf0f194d1d793d8799fd8799f0101ff1b000001739c890038ffffff"
        },
        {
            "purpose": "minting",
            "data": "d87980",
            "policy_id": "2063caa7ec49402a45050172da6d12897ce6c3561bd930a7e7a0cb14"
        }
    ],
    "inputs": [
        {
            "amount": {
                "unit": "lovelace",
                "quantity": 101
            },
            "datum": "ab4a81419b818fcd4adf710299644a5cea7a05304ea2ab3902a2069fbd1dc25c",
            "address": "addr1wx9vvejjzetdhxk827j5jlatpuy0hqt9w6h4u8amtcwq2fcdnltqc",
            "id": "40ecfe83917b4a7a54503971ac713585d5db67ec83cc289118924c35af687618",
            "index": 2,
            "assets": []
        }
    ]
}

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Relevant tickets are mentioned in commit messages
    • Formatting, materialized Nix files, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@j-mueller j-mueller merged commit d0fd9d4 into main Oct 22, 2021
@sjoerdvisscher sjoerdvisscher deleted the SCP-2924-export-tx branch October 25, 2021 07:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants