Gelato-automations/test/helpers/setups/Choosing-Executor-As-Provider.helper.js
2020-11-02 09:44:35 +01:00

27 lines
666 B
JavaScript

const {expect} = require("chai");
async function providerChooseExecutor(
providerWallet,
executorAddress,
gelatoCore
) {
//#region Provider choose a executor
// Provider choose a executor who will execute futur task
// for the provider, it will be compensated by the provider.
let providerAddress = await providerWallet.getAddress();
await expect(
gelatoCore.connect(providerWallet).providerAssignsExecutor(executorAddress)
).to.emit(gelatoCore, "LogProviderAssignedExecutor");
expect(await gelatoCore.executorByProvider(providerAddress)).to.be.equal(
executorAddress
);
//#endregion
}
module.exports = providerChooseExecutor;