2020-11-16 16:55:04 +00:00
|
|
|
const { expect } = require("chai");
|
2020-10-30 17:35:11 +00:00
|
|
|
|
2020-11-27 12:38:13 +00:00
|
|
|
module.exports = async function (executor, gelatoCore) {
|
2020-10-30 17:35:11 +00:00
|
|
|
//#region Executor Stake on Gelato
|
|
|
|
|
|
|
|
// For task execution provider will ask a executor to watch the
|
|
|
|
// blockchain for possible execution autorization given by
|
|
|
|
// the condition that user choose when submitting the task.
|
|
|
|
// And if all condition are meet executor will execute the task.
|
|
|
|
// For safety measure Gelato ask the executor to stake a minimum
|
|
|
|
// amount.
|
|
|
|
|
2020-11-27 12:38:13 +00:00
|
|
|
const gelatoExecutorAddress = await executor.getAddress();
|
2020-10-30 17:35:11 +00:00
|
|
|
|
2020-11-27 12:38:13 +00:00
|
|
|
await gelatoCore.connect(executor).stakeExecutor({
|
2020-10-30 17:35:11 +00:00
|
|
|
value: await gelatoCore.minExecutorStake(),
|
|
|
|
});
|
|
|
|
|
2020-11-04 17:09:34 +00:00
|
|
|
expect(await gelatoCore.isExecutorMinStaked(gelatoExecutorAddress)).to.be
|
|
|
|
.true;
|
2020-10-30 17:35:11 +00:00
|
|
|
|
|
|
|
//#endregion
|
2020-11-15 14:08:12 +00:00
|
|
|
};
|