Skip to content

Conversation

@KtorZ
Copy link
Member

@KtorZ KtorZ commented Oct 16, 2020

Issue Number

#2200

Overview

  • 16a5f0c
    📍 remove duplicated logic with regards to selections for join/quit
    The code was becoming quite convoluted here with function names that
    were screaming for refactoring (when we start adding ' to functions,
    it's usually a good sign that something can be simplified).

    The main change is actually in 'selectCoinsExternal' which is now
    parameterized over the selection to run. This way, the steps of
    assigning change addresses are factored out in this function and a lot
    of the duplication goes away.

    Another important change is that I've moved the signing and submission
    of join/quit outside of the body of the function. So that each step
    can be ran independently. This avoid the need for weird intermediate product
    types aggregating more and more information. Now, both functions are
    returning a 'DelegationAction' and merely checking that a join or quit
    is possible.

  • 4a5f4d9
    📍 return structured error for invalid wallets, instead of plain string

Comments

KtorZ added 2 commits October 16, 2020 15:31
  The code was becoming quite convoluted here with function names that
  were screaming for refactoring (when we start adding `'` to functions,
  it's usually a good sign that something can be simplified).

  The main change is actually in 'selectCoinsExternal' which is now
  parameterized over the selection to run. This way, the steps of
  assigning change addresses are factored out in this function and a lot
  of the duplication goes away.

  Another important change is that I've moved the signing and submission
  of join/quit outside of the body of the function. So that each step
  can be ran independently. This avoid the need for weird intermediate product
  types aggregating more and more information. Now, both functions are
  returning a 'DelegationAction' and merely checking that a join or quit
  is possible.
@KtorZ KtorZ added the Feature Mark a PR as adding a new feature, for auto-generated CHANGELOG label Oct 16, 2020
@KtorZ KtorZ requested a review from hasufell October 16, 2020 13:47
@KtorZ KtorZ self-assigned this Oct 16, 2020
@hasufell
Copy link
Contributor

I don't really understand the changes from skimming over it. I'd have to have a deeper look at it if you require a detailed review, otherwise I'm fine with merging.

@KtorZ
Copy link
Member Author

KtorZ commented Oct 16, 2020

@hasufell I have tried to explain the main changes in my PR comment. Did you read it? Do you have any questions or something I could explain?

@KtorZ KtorZ merged commit 759fd0e into hasufell/2200/unsigned-delegation-cert Oct 16, 2020
@KtorZ KtorZ deleted the KtorZ/2200/simplifications branch October 16, 2020 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Mark a PR as adding a new feature, for auto-generated CHANGELOG

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants