Skip to content

Implement channel withdraw logic for setTotalWithdraw #1498

@loredanacirstea

Description

@loredanacirstea

New smart contracts now have token withdraw functionality.
Note - in the current code, the withdraw term is being used by the unlock logic. I propose to change reserve this term for the setTotalWithdraw related functionality. See #1496 for this.

TODO:

  • add 2 messages: WithdrawRequest (for node requesting a withdraw signature from the partner node), Withdraw (containing the withdraw signature from the partner node)
  • add corresponding events: SendWithdrawRequest, SendWithdraw, ContractSendChannelWithdraw
  • add event handlers for the above
  • add corresponding state changes: ActionWithdraw, ReceiveWithdrawRequest, ReceiveWithdraw, ContractReceiveChannelWithdraw (!note that both Raiden nodes need to process a node's withdraw)
  • Implement new handler for the ChannelWithdraw event in blockchain_events_handler.py. Proposed name : handle_channel_(total_)withdraw

Logic sequence diagram

SC = smart contract on-chain transaction
STC = StateChange
EV = Raiden Event
MSG = Raiden Message

raidenclientwithdrawlogicsequence2

Feel free to improve naming.

@hackaugusto, please recheck above.

Metadata

Metadata

Assignees

Labels

State / MetaMeta issue, must be split into smaller issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions