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 (
|
2020-11-04 17:09:34 +00:00
|
|
|
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.
|
|
|
|
|
2020-11-04 17:09:34 +00:00
|
|
|
const gelatoProviderAddress = await gelatoProviderWallet.getAddress();
|
2020-10-30 17:35:11 +00:00
|
|
|
|
|
|
|
await expect(
|
|
|
|
gelatoCore
|
2020-11-04 17:09:34 +00:00
|
|
|
.connect(gelatoProviderWallet)
|
2020-10-30 17:35:11 +00:00
|
|
|
.addProviderModules([dsaProviderModuleAddr])
|
|
|
|
).to.emit(gelatoCore, "LogProviderModuleAdded");
|
|
|
|
|
|
|
|
expect(
|
|
|
|
await gelatoCore
|
2020-11-04 17:09:34 +00:00
|
|
|
.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
|
|
|
};
|