Implement cancelInvoice
integration tests
#7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's a current blocker in integrating the integration tests for the
cancelInvoice
method as any stream created through theStreamManager
(part of theInvoiceModule
) contract will be owned by the contract itself and not by the payer.This can cause front-end issues because we'll not be able to display streams by payers but rather by
InvoiceModule
.An ongoing discussion with the Sablier team has been opened here.
EDIT: After discussing with the Sablier team, the only workaround is to add a mapping in the
StreamManager
so we can map the initial stream sender with the stream ID. Therefore, each call to eithercancelLinearStream
orcancelTranchedStream
is guarded by anOnlyInitialStreamSender
checker.On the front-end side, the
InvoiceModule
is going to emit anInvoicePaid
event each time a new stream is created which gives us the ability to map the initial stream sender with the stream ID off-chain through the MetaDock subgraph.