Skip to content

Forwarding: update forwarding interface names, add tests#590

Merged
sohkai merged 1 commit intoextend_forwarder_interfacefrom
extend_forwarder_interface_update
Jul 2, 2020
Merged

Forwarding: update forwarding interface names, add tests#590
sohkai merged 1 commit intoextend_forwarder_interfacefrom
extend_forwarder_interface_update

Conversation

@sohkai
Copy link
Contributor

@sohkai sohkai commented Jul 2, 2020

This admittedly does a couple of refactors / changes to the Forwarding interfaces from #583:

  • Moves the old base IForwarder interface to be IAbstractInterface, so we can reserve IForwarder as the "normal" (most basic and most commonly used) forwarding type
  • Adds the IForwarderFee interface to the payable interfaces
  • Updates the forwarding types to be an enum (encoded as uint8 I think?), with just two types
    • We can detect payable simply by the forwardFee() method returning EtherTokenConstant
  • Maintains the isForwarder() interface for backwards compatibility with aragonOS 4
  • Adds some tests for behaviour

May be easiest to review by just looking at the branch's code.


Maintains the isForwarder() interface for backwards compatibility with aragonOS 4

This is somewhat debatable, but I wanted to keep this because:

  • It allows off-chain tooling to continue accessing isForwarder(), and in the majority of the case (e.g. IForwarder), this will continue to just work without any additional checks
  • It allows updated tooling to do both the isForwarder() and forwarderType() checks, and if isForwarder() is true but forwarderType() returns 0, know they're dealing with an older aragonOS 4 contract (which only has one forwarding interface).

@sohkai sohkai requested a review from facuspagnuolo July 2, 2020 13:17
@auto-assign auto-assign bot requested a review from izqui July 2, 2020 13:17
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 99.122% when pulling fd2bcad on extend_forwarder_interface_update into 46f9559 on extend_forwarder_interface.

Copy link
Contributor

@facuspagnuolo facuspagnuolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sohkai sohkai merged commit 2774a9f into extend_forwarder_interface Jul 2, 2020
@sohkai sohkai deleted the extend_forwarder_interface_update branch July 2, 2020 20:49
facuspagnuolo added a commit that referenced this pull request Jul 2, 2020
* forwarder: move to separate dir and make fns external

* forwarder: provide payable interface

* forwarder: provide forwarder interface with extra data

* forwarder: remove unused import

* forwarder: improve forwarders hierarchy

* Forwarding: update forwarding interface names, add tests (#590)

* tests: remove wrong (and unused) test import

Co-authored-by: Brett Sun <qisheng.brett.sun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants