Skip to content

Commit

Permalink
sdk: fix tests and add changelog for close request change
Browse files Browse the repository at this point in the history
  • Loading branch information
andrevmatos committed Oct 11, 2021
1 parent a98b1d3 commit e6ee970
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions raiden-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
- [#2965] Add +5% `gasLimit` margin on transactions which are successfuly estimated, to avoid running out of gas on narrow calls.
- [#2965] Remove `options.subkey` on certain `Raiden` public methods; if you need to force subkey or main account usage for single txs, set `config.subkey` then reset after tx is sent; default behavior is kept

### Fixed
- [#2963] Don't set channel as `closing` upon `channelClose.request`, allowing user to cancel Metamask's prompt and keep an usable channel; Channel becomes `closing` only after tx is sent

[#2949]: https://github.com/raiden-network/light-client/issues/2949
[#2952]: https://github.com/raiden-network/light-client/issues/2952
[#2953]: https://github.com/raiden-network/light-client/pull/2953
[#2963]: https://github.com/raiden-network/light-client/issues/2963
[#2965]: https://github.com/raiden-network/light-client/pull/2965

## [2.0.0-rc.2] - 2021-09-14
Expand Down
9 changes: 4 additions & 5 deletions raiden-ts/tests/integration/channels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,17 @@ describe('channelOpenEpic', () => {
const tokenNetworkContract = raiden.deps.getTokenNetworkContract(tokenNetwork);
const openTx = makeTransaction();
tokenNetworkContract.openChannelWithDeposit.mockResolvedValue(openTx);
const meta = { tokenNetwork, partner: partner.address };

raiden.store.dispatch(
channelOpen.request({ deposit }, { tokenNetwork, partner: partner.address }),
);
raiden.store.dispatch(channelOpen.request({ deposit }, meta));
await waitBlock();

// result is undefined on success as the respective channelOpen.success is emitted by the
// tokenMonitoredEpic, which monitors the blockchain for ChannelOpened events
expect(tokenNetworkContract.openChannelWithDeposit).toHaveBeenCalledTimes(1);
expect(openTx.wait).toHaveBeenCalledTimes(1);
expect(raiden.output).not.toContainEqual(
channelDeposit.request(expect.anything(), expect.anything()),
expect(raiden.output).toContainEqual(
channelDeposit.request({ totalDeposit: deposit, waitOpen: true }, meta),
);
});

Expand Down

0 comments on commit e6ee970

Please sign in to comment.