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

27 lines
668 B
JavaScript
Raw Normal View History

2020-11-16 16:55:04 +00:00
const { expect } = require("chai");
2020-11-15 14:08:12 +00:00
module.exports = async function (
gelatoProvider,
gelatoExecutorAddress,
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.
const gelatoProviderAddress = await gelatoProvider.getAddress();
await expect(
gelatoCore
.connect(gelatoProvider)
.providerAssignsExecutor(gelatoExecutorAddress)
).to.emit(gelatoCore, "LogProviderAssignedExecutor");
expect(
await gelatoCore.executorByProvider(gelatoProviderAddress)
).to.be.equal(gelatoExecutorAddress);
//#endregion
2020-11-15 14:08:12 +00:00
};