File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
packages/js-dapi-client/lib/methods/core Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ function subscribeToTransactionsWithProofsFactory(grpcTransport) {
39
39
...options ,
40
40
} ;
41
41
42
- if ( options . fromBlockHeight === 0 ) {
42
+ if ( 'fromBlockHeight' in options && options . fromBlockHeight === 0 ) {
43
43
throw new DAPIClientError ( 'Invalid argument: minimum value for `fromBlockHeight` is 1' ) ;
44
44
}
45
45
@@ -59,14 +59,14 @@ function subscribeToTransactionsWithProofsFactory(grpcTransport) {
59
59
const request = new TransactionsWithProofsRequest ( ) ;
60
60
request . setBloomFilter ( bloomFilterMessage ) ;
61
61
62
- if ( options . fromBlockHeight !== undefined ) {
63
- request . setFromBlockHeight ( options . fromBlockHeight ) ;
64
- }
65
-
66
- if ( options . fromBlockHash ) {
62
+ if ( 'fromBlockHash' in options ) {
67
63
request . setFromBlockHash (
68
- Buffer . from ( options . fromBlockHash , 'hex' ) ,
64
+ Buffer . isBuffer ( options . fromBlockHash )
65
+ ? options . fromBlockHash
66
+ : Buffer . from ( options . fromBlockHash , 'hex' ) ,
69
67
) ;
68
+ } else if ( 'fromBlockHeight' in options ) {
69
+ request . setFromBlockHeight ( options . fromBlockHeight ) ;
70
70
}
71
71
72
72
request . setCount ( options . count ) ;
You can’t perform that action at this time.
0 commit comments