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.
|
* List authorities by owner.
|
||||||
*/
|
*/
|
||||||
async getAuthorities (owner?: string) {
|
async getAuthorities (owner?: string, auction = false) {
|
||||||
return this._client.getAuthorities(owner);
|
return this._client.getAuthorities(owner, auction);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -127,13 +127,15 @@ const namingTests = () => {
|
|||||||
test('List authorities.', async () => {
|
test('List authorities.', async () => {
|
||||||
const authorities = await registry.getAuthorities();
|
const authorities = await registry.getAuthorities();
|
||||||
|
|
||||||
expect(authorities.length).toBeDefined();
|
expect(authorities.length).toEqual(4);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('List authorities by owner.', async () => {
|
test('List authorities by owner.', async () => {
|
||||||
const authorities = await registry.getAuthorities(otherAccount1.address);
|
const authorities = await registry.getAuthorities(otherAccount1.address);
|
||||||
|
|
||||||
|
expect(authorities.length).toEqual(1);
|
||||||
expect(authorities[0].entry.ownerAddress).toBe(otherAccount1.address);
|
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.
|
* List authorities by owner.
|
||||||
*/
|
*/
|
||||||
async getAuthorities (owner?: string) {
|
async getAuthorities (owner?: string, auction = false) {
|
||||||
const query = `query ($owner: String) {
|
const query = `query ($owner: String) {
|
||||||
getAuthorities(owner: $owner) {
|
getAuthorities(owner: $owner) {
|
||||||
name
|
name
|
||||||
@ -284,14 +284,7 @@ export class RegistryClient {
|
|||||||
status
|
status
|
||||||
bondId
|
bondId
|
||||||
expiryTime
|
expiryTime
|
||||||
auction {
|
${auction ? ('auction { ' + auctionFields + ' }') : ''}
|
||||||
id
|
|
||||||
status
|
|
||||||
ownerAddress
|
|
||||||
createTime
|
|
||||||
commitsEndTime
|
|
||||||
revealsEndTime
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user