Skip to content

Commit 5647780

Browse files
committed
deps: disable pouchdb byCleared index
This index was causing a hanging on state.spec.ts, and isn't needed for normal SDK usage.
1 parent 9b1c353 commit 5647780

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

raiden-ts/src/db/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ async function makeDatabase(
8181
db.setMaxListeners(30);
8282

8383
await Promise.all([
84-
db.createIndex({
84+
/* db.createIndex({
8585
index: {
8686
name: 'byCleared',
8787
fields: ['cleared', 'direction'],
8888
},
89-
}),
89+
}), */
9090
db.createIndex({
9191
index: {
9292
name: 'byPartner',
@@ -175,7 +175,7 @@ export async function getRaidenState(db: RaidenDatabase): Promise<any | undefine
175175
direction: { $exists: true },
176176
},
177177
});
178-
if (transfersResults.warning) log?.warn(transfersResults.warning, 'getRaidenState');
178+
if (transfersResults.warning) log?.debug(transfersResults.warning, 'getRaidenState');
179179
for (const doc of transfersResults.docs) {
180180
state.transfers[doc._id] = doc;
181181
}

raiden-ts/tests/unit/state.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import { TransferState } from '@/transfers/state';
1717
import { jsonParse } from '@/utils/data';
1818
import { decode } from '@/utils/types';
1919

20+
logging.setLevel(
21+
process.env['NODE_ENV'] === 'production' ? logging.levels.INFO : logging.levels.DEBUG,
22+
);
23+
2024
test('migrate, decode & dump', async () => {
2125
// iterate over past stored JSON states & ensure they can be migrated to current
2226
const dir = path.join(__dirname, 'states');

0 commit comments

Comments
 (0)