Skip to content

Commit

Permalink
parseJson if lastSync via bnReviver too
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Mar 20, 2024
1 parent 8b1b2ab commit 6ad1a9a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
7 changes: 7 additions & 0 deletions examples/mud/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# web-demo

## 0.1.67

### Patch Changes

- Updated dependencies
- ethereum-indexer-browser@0.7.5

## 0.1.66

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/mud/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mud-demo",
"private": true,
"version": "0.1.66",
"version": "0.1.67",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
7 changes: 7 additions & 0 deletions examples/web-demo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# web-demo

## 0.1.67

### Patch Changes

- Updated dependencies
- ethereum-indexer-browser@0.7.5

## 0.1.66

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/web-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "web-demo",
"private": true,
"version": "0.1.66",
"version": "0.1.67",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
6 changes: 6 additions & 0 deletions packages/ethereum-indexer-browser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ethereum-indexer-browser

## 0.7.5

### Patch Changes

- parseJson if lastSync via bnReviver too

## 0.7.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-browser",
"version": "0.7.4",
"version": "0.7.5",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export function keepStateOnIndexedDB<ABI extends Abi, ProcessResultType, Process
const urlOfLastSync = getURL(remote[i], context, true);
try {
const response = await fetch(urlOfLastSync);
const json: LastSync<Abi> = await response.json();
const text = await response.text();
const json: LastSync<Abi> = JSON.parse(text, bnReviver);
if (!latest || !latest.lastSync || json.lastToBlock > latest.lastSync.lastToBlock) {
latest = {
index: i,
Expand Down

0 comments on commit 6ad1a9a

Please sign in to comment.