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

pass tslint

This commit is contained in:
diminator 2018-11-21 15:26:46 +01:00
parent eef46c7a1c
commit f14ca2b0a5
No known key found for this signature in database
GPG Key ID: C3D8590E6D0D439A
2 changed files with 38 additions and 32 deletions

6
package-lock.json generated
View File

@ -130,6 +130,12 @@
"integrity": "sha512-qQMIZNwEgL6W93e3ryUVELgRxDO1WzaN7Dj2Kvhjkk/miwXmZXRFyf2p3fh0UESKwHiFGK6re3YA55fO43Dvnw==", "integrity": "sha512-qQMIZNwEgL6W93e3ryUVELgRxDO1WzaN7Dj2Kvhjkk/miwXmZXRFyf2p3fh0UESKwHiFGK6re3YA55fO43Dvnw==",
"requires": { "requires": {
"node-fetch": "^2.3.0" "node-fetch": "^2.3.0"
},
"dependencies": {
"node-fetch": {
"version": "2.3.0",
"bundled": true
}
} }
}, },
"@types/bn.js": { "@types/bn.js": {

View File

@ -93,44 +93,44 @@ export default class Ocean {
} as Event, } as Event,
] ]
const mapParameterValueToName = (name) => { const mapParameterValueToName = (name) => {
switch (name) { switch (name) {
case "price": case "price":
return metadata.base.price return metadata.base.price
case "assetId": case "assetId":
return "0x" + id return "0x" + id
case "documentKeyId": case "documentKeyId":
return "0x1234" return "0x1234"
}
return null
} }
return null const parameters: Parameter[] = condition.methodReflection.inputs.map((input: InputType) => {
} return {
name: input.name,
type: input.type,
value: mapParameterValueToName(input.name),
} as Parameter
})
// Logger.log(`${condition.methodReflection.contractName}.${condition.methodReflection.methodName}`,
// JSON.stringify(parameters, null, 2))
const parameters: Parameter[] = condition.methodReflection.inputs.map((input: InputType) => {
return { return {
name: input.name, contractName: condition.methodReflection.contractName,
type: input.type, methodName: condition.methodReflection.methodName,
value: mapParameterValueToName(input.name), timeout: condition.timeout,
} as Parameter index,
conditionKey: condition.condtionKey,
parameters,
events,
dependencies: condition.dependencies,
dependencyTimeoutFlags: condition.dependencyTimeoutFlags,
isTerminalCondition: condition.isTerminalCondition,
} as DDOCondition
}) })
// Logger.log(`${condition.methodReflection.contractName}.${condition.methodReflection.methodName}`,
// JSON.stringify(parameters, null, 2))
return {
contractName: condition.methodReflection.contractName,
methodName: condition.methodReflection.methodName,
timeout: condition.timeout,
index,
conditionKey: condition.condtionKey,
parameters,
events,
dependencies: condition.dependencies,
dependencyTimeoutFlags: condition.dependencyTimeoutFlags,
isTerminalCondition: condition.isTerminalCondition,
} as DDOCondition
})
const serviceEndpoint = aquarius.getServiceEndpoint(did) const serviceEndpoint = aquarius.getServiceEndpoint(did)
// create ddo itself // create ddo itself