Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

[CBR-349] Implement redemption #3466

Merged
merged 1 commit into from
Aug 24, 2018
Merged

Conversation

edsko
Copy link
Contributor

@edsko edsko commented Aug 23, 2018

Description

The new implementation is significantly simpler than the one in the legacy
wallet. In particular, we do not bother to run coin selection. Instead, we
simply

  1. Check if there is a UTxO available to the redemption address in the node's UTxO
    There can be at most 1; if 0, already redeemed.
  2. Construct a transaction containing a single input and a single output (to a
    freshly generated address), for the full amount of the voucher.

I've verified this approach with a bunch of people and tried to compare it to the redemption transactions that actually currently exist on the blockchain, and it seems this is indeed the right approach. Just for reference, here is one such transaction:

https://cardanoexplorer.com/address/m2MIpUqWMTQJwK9F4LnaNstGh4BjMy2L2GDHpsuCAPA%3D

However, do note that this is untested; that will need to be done by someone else on a test cluster.

Linked issue

https://iohk.myjetbrains.com/youtrack/issue/CBR-349

Type of change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🛠 New feature (non-breaking change which adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • 🔨 New or improved tests for existing code
  • ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.
  • CHANGELOG entry has been added and is linked to the correct PR on GitHub.

Testing checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

QA Steps

Screenshots (if available)

The new implementation is _significantly_ simpler than the one in the legacy
wallet. In particular, we do not bother to run coin selection. Instead, we
simply

1. Check if there is a UTxO available to the redemption address in the node's UTxO
   There can be at most 1; if 0, already redeemed.
2. Construct a transaction containing a single input and a single output (to a
   freshly generated address), for the full amount of the voucher.

I've verified this approach with a bunch of people and tried to compare it to
the redemption transactions that actually currently exist on the blockchain,
and it seems this is indeed the right approach.
@edsko edsko merged commit 81d0932 into develop-new Aug 24, 2018
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