File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
main/java/jp/co/soramitsu/iroha/java
test/groovy/jp/co/soramitsu/iroha/java Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 66import iroha .protocol .QryResponses .BlockResponse ;
77import iroha .protocol .QryResponses .ErrorResponse ;
88import iroha .protocol .QryResponses .QueryResponse ;
9+ import iroha .protocol .QryResponses .SignatoriesResponse ;
910import iroha .protocol .QryResponses .TransactionsPageResponse ;
1011import iroha .protocol .QryResponses .TransactionsResponse ;
1112import java .security .KeyPair ;
@@ -168,4 +169,16 @@ public AccountAssetResponse getAccountAssets(String accountId) {
168169
169170 return res .getAccountAssetsResponse ();
170171 }
172+
173+ public SignatoriesResponse getSignatories (String accountId ) {
174+ val q = Query .builder (this .accountId , counter .getAndIncrement ())
175+ .getSignatories (accountId )
176+ .buildSigned (keyPair );
177+
178+ val res = api .query (q );
179+
180+ checkErrorResponse (res );
181+
182+ return res .getSignatoriesResponse ();
183+ }
171184}
Original file line number Diff line number Diff line change @@ -234,5 +234,14 @@ class IntegrationTest extends Specification {
234234 accountAsset. assetId == " ${ asset} #${ defaultDomain} "
235235 accountAsset. accountId == defaultAccountId
236236 accountAsset. balance == " 4"
237+
238+ when : " get account signatories query is executed"
239+ queryResponse = qapi. getSignatories(defaultAccountId)
240+
241+ then : " response is valid containing single signatory"
242+ queryResponse. keysCount == 1
243+ def accountKey = queryResponse. keysList. get(0 )
244+
245+ accountKey == Utils . toHex(defaultKeypair. public . encoded). toLowerCase()
237246 }
238247}
You can’t perform that action at this time.
0 commit comments