Gelato-automations/test/helpers/setups/Choosing-Executor-As-Provider.helper.js

27 lines
666 B
JavaScript
Raw Normal View History

2020-10-30 17:35:11 +00:00
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;