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

24 lines
745 B
JavaScript
Raw Normal View History

2020-11-16 16:55:04 +00:00
const { expect } = require("chai");
2020-10-30 17:35:11 +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.
const gelatoExecutorAddress = await executor.getAddress();
2020-10-30 17:35:11 +00:00
await gelatoCore.connect(executor).stakeExecutor({
2020-10-30 17:35:11 +00:00
value: await gelatoCore.minExecutorStake(),
});
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
};