nano-account-crawler
Advanced tools
Comparing version 1.0.23 to 1.0.24
{ | ||
"name": "nano-account-crawler", | ||
"version": "1.0.23", | ||
"version": "1.0.24", | ||
"description": "Makes block iterators that make multiple RPC calls to Nano nodes if neccessary. Block confirmation height is checked so only confirmed blocks are iterated.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/Airtune/nano-account-crawler", |
@@ -108,3 +108,3 @@ import { | ||
} | ||
this.validateIsAccountInfo(response); | ||
this.validateIsAccountInfo(account, response); | ||
@@ -165,13 +165,13 @@ return response; | ||
private validateIsAccountInfo(accountInfo: INanoAccountInfo) { | ||
private validateIsAccountInfo(account: TAccount, accountInfo: INanoAccountInfo) { | ||
if (typeof(accountInfo) !== 'object') { | ||
throw Error(`UnexpectedNanoNodeResponse: Unexpected accountInfo. Expected type to be 'object', got: ${typeof(accountInfo)}`); | ||
throw Error(`UnexpectedNanoNodeResponse: Unexpected accountInfo. Expected type to be 'object', got: '${typeof(accountInfo)}' for ${account}`); | ||
} | ||
if (accountInfo.hasOwnProperty('error')) { | ||
throw Error(`NanoNodeError: ${accountInfo.error}`); | ||
throw Error(`NanoNodeError: ${accountInfo.error} for ${account}`); | ||
} | ||
if (typeof(accountInfo['confirmation_height']) !== 'string') { | ||
throw Error(`UnexpectedNanoNodeResponse: Unexpected accountInfo['confirmation_height']. Expected type to be 'string', got: ${typeof(accountInfo['confirmation_height'])}`); | ||
throw Error(`UnexpectedNanoNodeResponse: Unexpected accountInfo['confirmation_height']. Expected type to be 'string', got: ${typeof(accountInfo['confirmation_height'])} for ${account}`); | ||
} | ||
@@ -178,0 +178,0 @@ } |
85314