raiden icon indicating copy to clipboard operation
raiden copied to clipboard

Eliminate inherited attribute redundancy in mediated-transfer state-changes

Open ezdac opened this issue 4 years ago • 0 comments
trafficstars

Due to the inheritance model of the state-changes for mediated transfers there is quite some redundancy when initiating the "leaf" classes in the inheritance tree, e.g. ActionInitMediator or ActionInitTarget.

Because ancestor attributes have to be fulfilled in the constructor, something like this can happen:

https://github.com/raiden-network/raiden/blob/0b8f9150feada410bf160e6b1fd06d92a864398c/raiden/message_handler.py#L356-L362

https://github.com/raiden-network/raiden/blob/0b8f9150feada410bf160e6b1fd06d92a864398c/raiden/message_handler.py#L342-L347

Note that since the from_transfer is passed, information contained in sender, from_hop, balance_proof become redundant.

ezdac avatar Mar 02 '21 16:03 ezdac