forked from cerc-io/registry-sdk
Update check for list authorities by owner
This commit is contained in:
parent
a3b78fd363
commit
81dbf57fc2
@ -392,8 +392,8 @@ export class Registry {
|
||||
/**
|
||||
* List authorities by owner.
|
||||
*/
|
||||
async getAuthorities (owner?: string) {
|
||||
return this._client.getAuthorities(owner);
|
||||
async getAuthorities (owner?: string, auction = false) {
|
||||
return this._client.getAuthorities(owner, auction);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -127,13 +127,15 @@ const namingTests = () => {
|
||||
test('List authorities.', async () => {
|
||||
const authorities = await registry.getAuthorities();
|
||||
|
||||
expect(authorities.length).toBeDefined();
|
||||
expect(authorities.length).toEqual(4);
|
||||
});
|
||||
|
||||
test('List authorities by owner.', async () => {
|
||||
const authorities = await registry.getAuthorities(otherAccount1.address);
|
||||
|
||||
expect(authorities.length).toEqual(1);
|
||||
expect(authorities[0].entry.ownerAddress).toBe(otherAccount1.address);
|
||||
expect(authorities[0].entry.ownerPublicKey).toBe(otherAccount1.encodedPubkey);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -273,7 +273,7 @@ export class RegistryClient {
|
||||
/**
|
||||
* List authorities by owner.
|
||||
*/
|
||||
async getAuthorities (owner?: string) {
|
||||
async getAuthorities (owner?: string, auction = false) {
|
||||
const query = `query ($owner: String) {
|
||||
getAuthorities(owner: $owner) {
|
||||
name
|
||||
@ -284,14 +284,7 @@ export class RegistryClient {
|
||||
status
|
||||
bondId
|
||||
expiryTime
|
||||
auction {
|
||||
id
|
||||
status
|
||||
ownerAddress
|
||||
createTime
|
||||
commitsEndTime
|
||||
revealsEndTime
|
||||
}
|
||||
${auction ? ('auction { ' + auctionFields + ' }') : ''}
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
Loading…
Reference in New Issue
Block a user