Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when starting client with UDC entrypoint on a TNR without registered tokens #2968

Merged
merged 1 commit into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions raiden-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
- [#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
- [#2913] Fix crash when starting client with `userDepositContractAddress` as contracts entrypoint on a `TokenNetworkRegistry` with no registered tokens yet
- [#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

[#2913]: https://github.com/raiden-network/light-client/issues/2913
[#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
Expand Down
4 changes: 2 additions & 2 deletions raiden-ts/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,14 @@ export async function fetchContractsInfo(
const serviceRegistry = (await monitoringServiceContract.service_registry()) as Address;

const toBlock = await provider.getBlockNumber();
let firstBlock = await firstValueFrom(
const firstBlock = await firstValueFrom(
getLogsByChunk$(provider, {
...tokenNetworkRegistryContract.filters.TokenNetworkCreated(null, null),
fromBlock: 1,
toBlock,
}).pipe(pluck('blockNumber'), filter(isntNil)),
{ defaultValue: toBlock },
);
firstBlock ??= 0;

const oneToN = (await userDepositContract.one_to_n_address()) as Address;

Expand Down