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

sdk/state: change open/confirm/payment validations to check against ChannelState() when possible #261

Open
acharb opened this issue Aug 27, 2021 · 5 comments

Comments

@acharb
Copy link
Contributor

acharb commented Aug 27, 2021

right now validations for open/confirm/payment are checking against the state of the latest agreements. Now that we have an overall ChannelState() enum, we should instead (or possibly also) check against that value

@leighmcculloch
Copy link
Contributor

Could you link to some validations that would change and be replaced with the new state function?

@acharb
Copy link
Contributor Author

acharb commented Aug 27, 2021

we might want to add the same validation for checking if already closed / closing too 🤔

@leighmcculloch
Copy link
Contributor

I think the first four spots you linked to make sense and look like good candidates for that. The last spot less so because the guard is checking an authorized close agreement exists before copying it and modifying it for early closure.

@acharb
Copy link
Contributor Author

acharb commented Sep 1, 2021

adding next steps for when I or someone jumps back on this.

We'll need to add more granular states for the open steps. @leighmcculloch 's suggestion:
#270 (comment) .

Probably 2 PRs to complete:

  1. add the missing states, and assert them in the tests
  2. swap out the validations to use these new channel states

@acharb acharb removed their assignment Sep 2, 2021
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 a pull request may close this issue.

3 participants