LibertyDSNP / eth-sdk-ts

TypeScript SDK for DSNP on Ethereum
Apache License 2.0
9 stars 1 forks source link

check for pastLogs.length before continuing in subscribeToBatchPublications #110

Closed shannonwells closed 3 years ago

shannonwells commented 3 years ago

Problem

In subscribeToBatchPublications, we needed to check the length of pastLogs before trying to look at the blockNumber of one of its elements. Fixes #179033826

Solution

Do the length check Add a regression test that shows the red/green behavior

Double Checks:

Steps to Verify:

  1. The test passes
  2. For extra credit you can build sdk and make example-client use it, then launch a hardhat localnet with no logs or anything, and login to the example client. You should not see the error message as shown in the Tracker story.