Skip to content

Commit 1be3ac2

Browse files
authored
Added from / to height in receipt search (#750)
1 parent 42b262e commit 1be3ac2

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"ripemd160": "^2.0.2",
114114
"rxjs": "^6.6.3",
115115
"rxjs-compat": "^6.6.3",
116-
"symbol-openapi-typescript-fetch-client": "0.11.1",
116+
"symbol-openapi-typescript-fetch-client": "0.11.2-SNAPSHOT.202101211547",
117117
"tweetnacl": "^1.0.3",
118118
"ws": "^7.3.1"
119119
},

src/infrastructure/ReceiptHttp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ export class ReceiptHttp extends Http implements ReceiptRepository {
8282
return this.call(
8383
this.receiptRoutesApi.searchReceipts(
8484
criteria.height?.toString(),
85+
criteria.fromHeight?.toString(),
86+
criteria.toHeight?.toString(),
8587
criteria.receiptTypes?.map((t) => t.valueOf()),
8688
criteria.recipientAddress?.plain(),
8789
criteria.senderAddress?.plain(),

src/infrastructure/searchCriteria/TransactionStatementSearchCriteria.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ export interface TransactionStatementSearchCriteria extends SearchCriteria {
3131
*/
3232
height?: UInt64;
3333

34+
/**
35+
* From block height. (optional)
36+
*/
37+
fromHeight?: UInt64;
38+
39+
/**
40+
* To block height. (optional)
41+
*/
42+
toHeight?: UInt64;
43+
3444
/**
3545
* receipt types. (optional, TransactionStatement only)
3646
*/

test/infrastructure/ReceiptHttp.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ describe('ReceiptHttp', () => {
171171
undefined,
172172
undefined,
173173
undefined,
174+
undefined,
175+
undefined,
174176
),
175177
).thenReturn(Promise.resolve(resolutionPage));
176178

@@ -197,6 +199,8 @@ describe('ReceiptHttp', () => {
197199
undefined,
198200
undefined,
199201
undefined,
202+
undefined,
203+
undefined,
200204
),
201205
).thenReject(new Error('Mocked Error'));
202206
await receiptRepository

0 commit comments

Comments
 (0)