mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
await chaining to Promise.all
This commit is contained in:
parent
e00e6d10d6
commit
26a721f754
@ -29,26 +29,40 @@ export class Keeper extends Instantiable {
|
|||||||
// Adding keeper inside Ocean to prevent `Keeper not defined yet` error
|
// Adding keeper inside Ocean to prevent `Keeper not defined yet` error
|
||||||
config.ocean.keeper = keeper
|
config.ocean.keeper = keeper
|
||||||
|
|
||||||
|
const resolvedInstances = await Promise.all([
|
||||||
|
// Main contracts
|
||||||
|
Dispenser.getInstance(config),
|
||||||
|
OceanToken.getInstance(config),
|
||||||
|
DIDRegistry.getInstance(config),
|
||||||
|
// Managers
|
||||||
|
TemplateStoreManager.getInstance(config),
|
||||||
|
AgreementStoreManager.getInstance(config),
|
||||||
|
ConditionStoreManager.getInstance(config),
|
||||||
|
// Conditions
|
||||||
|
LockRewardCondition.getInstance(config),
|
||||||
|
EscrowReward.getInstance(config),
|
||||||
|
AccessSecretStoreCondition.getInstance(config),
|
||||||
|
// Conditions
|
||||||
|
EscrowAccessSecretStoreTemplate.getInstance(config)
|
||||||
|
])
|
||||||
|
|
||||||
// Main contracts
|
// Main contracts
|
||||||
keeper.dispenser = await Dispenser.getInstance(config)
|
keeper.dispenser = resolvedInstances[0]
|
||||||
keeper.token = await OceanToken.getInstance(config)
|
keeper.token = resolvedInstances[1]
|
||||||
keeper.didRegistry = await DIDRegistry.getInstance(config)
|
keeper.didRegistry = resolvedInstances[2]
|
||||||
|
|
||||||
// Managers
|
// Managers
|
||||||
keeper.templateStoreManager = await TemplateStoreManager.getInstance(config)
|
keeper.templateStoreManager = resolvedInstances[3]
|
||||||
keeper.agreementStoreManager = await AgreementStoreManager.getInstance(config)
|
keeper.agreementStoreManager = resolvedInstances[4]
|
||||||
keeper.conditionStoreManager = await ConditionStoreManager.getInstance(config)
|
keeper.conditionStoreManager = resolvedInstances[5]
|
||||||
|
|
||||||
// Conditions
|
// Conditions
|
||||||
keeper.conditions = {
|
keeper.conditions = {
|
||||||
lockRewardCondition: await LockRewardCondition.getInstance(config),
|
lockRewardCondition: resolvedInstances[6],
|
||||||
escrowReward: await EscrowReward.getInstance(config),
|
escrowReward: resolvedInstances[7],
|
||||||
accessSecretStoreCondition: await AccessSecretStoreCondition.getInstance(config),
|
accessSecretStoreCondition: resolvedInstances[8]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Conditions
|
// Conditions
|
||||||
keeper.templates = {
|
keeper.templates = {
|
||||||
escrowAccessSecretStoreTemplate: await EscrowAccessSecretStoreTemplate.getInstance(config),
|
escrowAccessSecretStoreTemplate: resolvedInstances[9]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
|
Loading…
Reference in New Issue
Block a user