1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

fresh package-lock

This commit is contained in:
Matthias Kretschmann 2019-11-14 19:42:36 +01:00
parent 7067b89fdc
commit 0552bcc577
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 3749 additions and 2012 deletions

5742
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -33,17 +33,21 @@ export default class DIDRegistry extends ContractBase {
} }
public async getAttributesByOwner(owner: string): Promise<string[]> { public async getAttributesByOwner(owner: string): Promise<string[]> {
return (await this.getPastEvents('DIDAttributeRegistered', { return (
await this.getPastEvents('DIDAttributeRegistered', {
_owner: zeroX(owner) _owner: zeroX(owner)
})) })
)
.map(({ returnValues }) => returnValues._did) .map(({ returnValues }) => returnValues._did)
.map(didPrefixed) .map(didPrefixed)
} }
public async getAttributesByDid(did: string): Promise<{ did: string; serviceEndpoint: string; checksum: string }> { public async getAttributesByDid(did: string): Promise<{ did: string; serviceEndpoint: string; checksum: string }> {
return (await this.getPastEvents('DIDAttributeRegistered', { return (
await this.getPastEvents('DIDAttributeRegistered', {
_did: didZeroX(did) _did: didZeroX(did)
})).map(({ returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } }) => ({ })
).map(({ returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } }) => ({
did: didPrefixed(_did), did: didPrefixed(_did),
serviceEndpoint, serviceEndpoint,
checksum checksum

View File

@ -20,9 +20,11 @@ export class AccessSecretStoreCondition extends Condition {
} }
public async getGrantedDidByConsumer(consumer: string): Promise<{ did: string; agreementId: string }[]> { public async getGrantedDidByConsumer(consumer: string): Promise<{ did: string; agreementId: string }[]> {
return (await this.getPastEvents('Fulfilled', { return (
await this.getPastEvents('Fulfilled', {
_grantee: zeroX(consumer) _grantee: zeroX(consumer)
})).map(({ returnValues }) => ({ })
).map(({ returnValues }) => ({
did: didPrefixed(returnValues._documentId), did: didPrefixed(returnValues._documentId),
agreementId: zeroX(returnValues._agreementId) agreementId: zeroX(returnValues._agreementId)
})) }))

View File

@ -23,10 +23,14 @@ export class AgreementStoreManager extends ContractBase {
} }
public async getAgreement(agreementId: string) { public async getAgreement(agreementId: string) {
const { did, didOwner, templateId, conditionIds, lastUpdatedBy, blockNumberUpdated } = await this.call( const {
'getAgreement', did,
[zeroX(agreementId)] didOwner,
) templateId,
conditionIds,
lastUpdatedBy,
blockNumberUpdated
} = await this.call('getAgreement', [zeroX(agreementId)])
return { return {
did, did,
didOwner, didOwner,

View File

@ -25,10 +25,15 @@ export class ConditionStoreManager extends ContractBase {
} }
public async getCondition(conditionId: string) { public async getCondition(conditionId: string) {
const { typeRef, state, timeLock, timeOut, blockNumber, lastUpdatedBy, blockNumberUpdated } = await this.call( const {
'getCondition', typeRef,
[zeroX(conditionId)] state,
) timeLock,
timeOut,
blockNumber,
lastUpdatedBy,
blockNumberUpdated
} = await this.call('getCondition', [zeroX(conditionId)])
return { return {
typeRef, typeRef,
state: +state, state: +state,

View File

@ -1,5 +1,5 @@
import { assert, spy, use } from 'chai' import { assert, spy, use } from 'chai'
import * as spies from 'chai-spies' import spies from 'chai-spies'
import { SearchQuery } from '../../src/aquarius/Aquarius' import { SearchQuery } from '../../src/aquarius/Aquarius'
import { Ocean } from '../../src/ocean/Ocean' import { Ocean } from '../../src/ocean/Ocean'