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