Skip to content

Commit

Permalink
Merge pull request #5 from w3f/dep-update
Browse files Browse the repository at this point in the history
Dep update
  • Loading branch information
ironoa authored Feb 8, 2021
2 parents ccbfe8d + 7ea1323 commit 6a36424
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 330 deletions.
2 changes: 1 addition & 1 deletion charts/polkadot-watcher-transaction/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Polkadot Watcher
name: polkadot-watcher-transaction
version: v0.2.1
version: v0.2.2
apiVersion: v2
2 changes: 1 addition & 1 deletion charts/polkadot-watcher-transaction/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ environment: production

image:
repo: web3f/polkadot-watcher-transaction
tag: v0.2.1
tag: v0.2.2

config:
endpoint: "wss://kusama-rpc.polkadot.io/"
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polkadot-watcher-transaction",
"version": "0.2.1",
"version": "0.2.2",
"description": "Monitor events on Polkadot networks, specifically transactions",
"repository": "[email protected]:w3f/polkadot-watcher-csv-exporter.git",
"author": "W3F Infrastructure Team <[email protected]>",
Expand All @@ -20,8 +20,8 @@
"start": "node ./dist/index.js start"
},
"dependencies": {
"@polkadot/api": "^2.3.1",
"@polkadot/types": "^2.3.1",
"@polkadot/api": "^3.8.1",
"@polkadot/types": "^3.8.1",
"@w3f/config": "^0.1.1",
"@w3f/logger": "^0.4.2",
"commander": "^4.0.0",
Expand All @@ -39,8 +39,8 @@
"@types/tmp": "^0.2.0",
"@typescript-eslint/eslint-plugin": "^2.25.0",
"@typescript-eslint/parser": "^2.25.0",
"@w3f/polkadot-api-client": "^0.9.0",
"@w3f/test-utils": "^0.8.9",
"@w3f/polkadot-api-client": "^1.0.0",
"@w3f/test-utils": "^1.0.0",
"chai": "^4.2.0",
"eslint": "^6.6.0",
"fs-extra": "^9.0.0",
Expand Down
9 changes: 7 additions & 2 deletions src/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { Text } from '@polkadot/types/primitive';
import {
InputConfig, TransactionData, TransactionType, Notifier, FreeBalance, SubscriberConfig,
} from './types';
import { Header } from '@polkadot/types/interfaces';
import Extrinsic from '@polkadot/types/extrinsic/Extrinsic';
import { Extrinsic, Header } from '@polkadot/types/interfaces';
import { asyncForEach, isTransferBalancesExtrinsic } from './utils';
import { ZeroBalance } from './constants';

Expand Down Expand Up @@ -66,6 +65,12 @@ export class Subscriber {

private _initAPI = async (): Promise<void> =>{
const provider = new WsProvider(this.endpoint);
provider.on('error', error => {
if(this.api == undefined) {
this.logger.error(JSON.stringify("initAPI error:"+JSON.stringify(error)))
process.exit(1)
}
})
this.api = await ApiPromise.create({ provider });

this.chain = await this.api.rpc.system.chain();
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs, { WriteStream } from 'fs';
import { Logger } from '@w3f/logger';
import { DeriveAccountRegistration } from '@polkadot/api-derive/accounts/types';
import Extrinsic from '@polkadot/types/extrinsic/Extrinsic';
import { Extrinsic } from '@polkadot/types/interfaces';

export const isDirEmpty = (path: string): boolean =>{
return fs.readdirSync(path).length === 0
Expand Down
2 changes: 1 addition & 1 deletion test/mocks.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-unused-vars */

import Extrinsic from '@polkadot/types/extrinsic/Extrinsic';
import { Logger } from '@w3f/logger';
import { Client, Keyring } from '@w3f/polkadot-api-client';
import { Notifier, TransactionData } from '../src/types';
import { initClient, sendFromAToB } from './utils';
import { TestPolkadotRPC } from '@w3f/test-utils';
import { Extrinsic } from '@polkadot/types/interfaces';

const delay = (ms: number): Promise<void> =>{
return new Promise( resolve => setTimeout(resolve, ms) );
Expand Down
Loading

0 comments on commit 6a36424

Please sign in to comment.