Gelato-automations/test/helpers/services/addProviderModuleDSA.js

32 lines
817 B
JavaScript
Raw Normal View History

2020-10-30 17:35:11 +00:00
const {expect} = require("chai");
async function addProviderModuleDSA(
gelatoProviderWallet,
2020-10-30 17:35:11 +00:00
gelatoCore,
dsaProviderModuleAddr
) {
//#region Provider will add a module
// By adding a module the provider will format future task's
// payload by adding some specificity like his address to the
// Payment connector for receiving payment of User.
const gelatoProviderAddress = await gelatoProviderWallet.getAddress();
2020-10-30 17:35:11 +00:00
await expect(
gelatoCore
.connect(gelatoProviderWallet)
2020-10-30 17:35:11 +00:00
.addProviderModules([dsaProviderModuleAddr])
).to.emit(gelatoCore, "LogProviderModuleAdded");
expect(
await gelatoCore
.connect(gelatoProviderWallet)
.isModuleProvided(gelatoProviderAddress, dsaProviderModuleAddr)
2020-10-30 17:35:11 +00:00
).to.be.true;
//#endregion
}
module.exports = addProviderModuleDSA;