@@ -35,36 +35,29 @@ public class QueryAPI {
35
35
private String accountId ;
36
36
@ NonNull
37
37
private KeyPair keyPair ;
38
-
38
+ @ NonNull
39
+ private final FieldValidator .Config config ;
39
40
// default signature builder
40
41
private SignatureBuilder signatureBuilder ;
41
42
42
- public QueryAPI (IrohaAPI api , String accountId , KeyPair keyPair ) {
43
- this .api = api ;
44
- this .accountId = accountId ;
45
- this .keyPair = keyPair ;
46
- signatureBuilder = Ed25519Sha3SignatureBuilder .getInstance ();
43
+ public QueryAPI (IrohaAPI api , String accountId , KeyPair keyPair , FieldValidator .Config config ) {
44
+ this (api , accountId , keyPair , Ed25519Sha3SignatureBuilder .getInstance (), config );
47
45
}
48
46
49
- public QueryAPI (IrohaAPI api , String accountId , KeyPair keyPair , SignatureBuilder signatureBuilder ) {
47
+ public QueryAPI (IrohaAPI api , String accountId , KeyPair keyPair , SignatureBuilder signatureBuilder , FieldValidator . Config config ) {
50
48
this .api = api ;
51
49
this .accountId = accountId ;
52
50
this .keyPair = keyPair ;
53
51
this .signatureBuilder = signatureBuilder ;
52
+ this .config = config ;
54
53
}
55
54
56
- public QueryAPI (IrohaAPI api , Account account ) {
57
- this .api = api ;
58
- this .accountId = account .getId ();
59
- this .keyPair = account .getKeyPair ();
60
- signatureBuilder = Ed25519Sha3SignatureBuilder .getInstance ();
55
+ public QueryAPI (IrohaAPI api , Account account , FieldValidator .Config config ) {
56
+ this (api , account .getId (), account .getKeyPair (), Ed25519Sha3SignatureBuilder .getInstance (), config );
61
57
}
62
58
63
- public QueryAPI (IrohaAPI api , Account account , SignatureBuilder signatureBuilder ) {
64
- this .api = api ;
65
- this .accountId = account .getId ();
66
- this .keyPair = account .getKeyPair ();
67
- this .signatureBuilder = signatureBuilder ;
59
+ public QueryAPI (IrohaAPI api , Account account , SignatureBuilder signatureBuilder , FieldValidator .Config config ) {
60
+ this (api , account .getId (), account .getKeyPair (), signatureBuilder , config );
68
61
}
69
62
70
63
private static AtomicInteger counter = new AtomicInteger (1 );
@@ -77,7 +70,7 @@ private void checkErrorResponse(QueryResponse response) {
77
70
}
78
71
79
72
public EngineReceiptsResponse getEngineReceipts (String txHash ) {
80
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
73
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
81
74
.getEngineReceipts (txHash )
82
75
.buildSigned (keyPair );
83
76
@@ -89,7 +82,7 @@ public EngineReceiptsResponse getEngineReceipts(String txHash) {
89
82
}
90
83
91
84
public PeersResponse getPeers () {
92
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
85
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
93
86
.getPeers ()
94
87
.buildSigned (keyPair );
95
88
@@ -111,7 +104,7 @@ public String getAccountDetails(
111
104
String writer ,
112
105
String key
113
106
) {
114
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
107
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
115
108
.getAccountDetail (accountId , writer , key )
116
109
.buildSigned (keyPair );
117
110
@@ -132,7 +125,7 @@ public AccountDetailResponse getAccountDetails(
132
125
String accountDetailRecordIdWriter ,
133
126
String accountDetailRecordIdKey
134
127
) {
135
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
128
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
136
129
.getAccountDetail (
137
130
accountId ,
138
131
writer ,
@@ -160,7 +153,7 @@ public AccountDetailResponse getAccountDetails(
160
153
}
161
154
162
155
public AccountResponse getAccount (String accountId ) {
163
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
156
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
164
157
.getAccount (accountId )
165
158
.buildSigned (keyPair );
166
159
@@ -172,7 +165,7 @@ public AccountResponse getAccount(String accountId) {
172
165
}
173
166
174
167
public BlockResponse getBlock (Long height ) {
175
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
168
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
176
169
.getBlock (height )
177
170
.buildSigned (keyPair );
178
171
@@ -190,7 +183,7 @@ public TransactionsPageResponse getAccountTransactions(String accountId,
190
183
Timestamp lastTxTime ,
191
184
Integer firstTxHeight ,
192
185
Integer lastTxHeight ) {
193
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
186
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
194
187
.getAccountTransactions (accountId , pageSize , firstHashHex , ordering , firstTxTime , lastTxTime , firstTxHeight , lastTxHeight )
195
188
.buildSigned (keyPair );
196
189
@@ -243,7 +236,7 @@ public TransactionsPageResponse getAccountAssetTransactions(String accountId,
243
236
Integer firstTxHeight ,
244
237
Integer lastTxHeight ) {
245
238
246
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
239
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
247
240
.getAccountAssetTransactions (accountId , assetId , pageSize , firstHashHex , ordering , firstTxTime , lastTxTime , firstTxHeight , lastTxHeight )
248
241
.buildSigned (keyPair );
249
242
@@ -283,7 +276,7 @@ public TransactionsResponse getTransactions(List<byte[]> hashes) {
283
276
}
284
277
285
278
public TransactionsResponse getTransactions (Iterable <String > hashes ) {
286
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
279
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
287
280
.getTransactions (hashes )
288
281
.buildSigned (keyPair );
289
282
@@ -295,7 +288,7 @@ public TransactionsResponse getTransactions(Iterable<String> hashes) {
295
288
}
296
289
297
290
public AssetResponse getAssetInfo (String assetId ) {
298
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
291
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
299
292
.getAssetInfo (assetId )
300
293
.buildSigned (keyPair );
301
294
@@ -313,7 +306,7 @@ public AssetResponse getAssetInfo(String assetId) {
313
306
*/
314
307
@ Deprecated
315
308
public AccountAssetResponse getAccountAssets (String accountId ) {
316
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
309
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
317
310
.getAccountAssets (accountId )
318
311
.buildSigned (keyPair );
319
312
@@ -329,7 +322,7 @@ public AccountAssetResponse getAccountAssets(
329
322
Integer pageSize ,
330
323
String firstAssetId
331
324
) {
332
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
325
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
333
326
.getAccountAssets (accountId , pageSize , firstAssetId )
334
327
.buildSigned (keyPair );
335
328
@@ -348,7 +341,7 @@ public AccountAssetResponse getAccountAssets(
348
341
}
349
342
350
343
public SignatoriesResponse getSignatories (String accountId ) {
351
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
344
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
352
345
.getSignatories (accountId )
353
346
.buildSigned (keyPair );
354
347
@@ -366,7 +359,7 @@ public SignatoriesResponse getSignatories(String accountId) {
366
359
*/
367
360
@ Deprecated
368
361
public TransactionsResponse getPendingTransactions () {
369
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
362
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
370
363
.getPendingTransactions ()
371
364
.buildSigned (keyPair );
372
365
@@ -386,7 +379,7 @@ public TransactionsResponse getPendingTransactions(
386
379
Integer firstTxHeight ,
387
380
Integer lastTxHeight
388
381
) {
389
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
382
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
390
383
.getPendingTransactions (pageSize , firstHashHex , ordering , firstTxTime , lastTxTime , firstTxHeight , lastTxHeight )
391
384
.buildSigned (keyPair );
392
385
@@ -426,7 +419,7 @@ public TransactionsResponse getPendingTransactions(
426
419
}
427
420
428
421
public RolesResponse getRoles () {
429
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
422
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
430
423
.getRoles ()
431
424
.buildSigned (keyPair );
432
425
@@ -438,7 +431,7 @@ public RolesResponse getRoles() {
438
431
}
439
432
440
433
public RolePermissionsResponse getRolePermissions (String roleId ) {
441
- val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder )
434
+ val q = Query .builder (this .accountId , counter .getAndIncrement (), signatureBuilder , this . config )
442
435
.getRolePermissions (roleId )
443
436
.buildSigned (keyPair );
444
437
0 commit comments