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

30 lines
777 B
JavaScript
Raw Normal View History

2020-11-16 16:55:04 +00:00
const { expect } = require("chai");
2020-10-30 17:35:11 +00:00
2020-11-15 14:08:12 +00:00
module.exports = async function (
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
2020-11-15 14:08:12 +00:00
};