Closed tangjeff0 closed 5 years ago
Merging #479 into master will decrease coverage by
0.09%
. The diff coverage is55.55%
.
@@ Coverage Diff @@
## master #479 +/- ##
=========================================
- Coverage 73.62% 73.53% -0.1%
=========================================
Files 44 44
Lines 2059 2067 +8
Branches 332 334 +2
=========================================
+ Hits 1516 1520 +4
- Misses 543 547 +4
Impacted Files | Coverage Δ | |
---|---|---|
src/controllers/ilp-prepare.ts | 82.92% <25%> (-6.27%) |
:arrow_down: |
src/services/rate-backend.ts | 96.66% <80%> (-3.34%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update a7c4bcd...d61e0aa. Read the comment docs.
There are a lot of breaking changes here that could be done non-breakingly. These are good features though, especially because they're informed by real-world usage of the connector.
getInfo
with accounts
you could add accounts
and still keep getInfo
submitPacket
could run on prepare/fulfill/reject, and on fulfill if submitPacket
is not specified it can fall back to submitPayment
This might be a dumb question, but where are the breaking changes? I thought I modified the backends (ecb, one-to-one, randomizer) such that they use submitPacket
and this.accounts.getInfo
rather than submitPayment
and this.getInfo
, respectively.
For example, we wrote our own custom backend. Since it imports and implements the backend interface from the connector, this change would break it since it relies on getInfo
, and would introduce type errors.
With help from @sharafian and @kincaidoneil :
types/backend
: accounts
property optional, getInfo
method unchangedtypes/backend
: submitPacket
method optional, submitPayment
method unchangedcontrollers/ilp-prepare
: call submitPacket
on prepare/fulfill/reject if method exists, otherwise call submitPayment
on fulfillservices/rate-backend
: on construction, assign this.submitPayment
to be this.backend.submitPayment
, otherwise, leave it undefinedHopefully these changes improve the extensibility of custom backends, while maintaining backwards-compatibility.
Awesome - can @sentientwaffle also take a look at these two PRs? They follow the paradigm you initially suggested of passing in a server object to the respective constructors.
controllers/ilp-prepare
- changesubmitPayment
tosubmitPacket
: always submit to backend whether packet type is fulfill, prepare, rejecttypes/backend
- add more params toSubmitPaymentParams
: backend should receive more dataservices/backend
- replacethis.getInfo
withthis.accounts
: backend should have access to more of theaccounts
apiecb
,one-to-one
,randomizer
: update from usingthis.getInfo
tothis.accounts