我正在尝试使用 Chainlink Keeper 网络并编写了一个实现KeeperCompatibleInterface
. 但是,即使我明确设置upkeepNeeded = true
,keeper 网络仍然不运行维护。我已确保合同资金充足。可能是什么问题呢?
这是相关的代码片段:
function checkUpkeep(bytes calldata checkData)
external
override
returns (bool upkeepNeeded, bytes memory performData)
{
return _checkUpkeep(checkData);
}
function _checkUpkeep(bytes memory checkData)
internal
view
returns (bool upkeepNeeded, bytes memory performData)
{
bool jobCanRun = (block.timestamp > _jobStartTime) &&
(block.timestamp < _expirationTime);
bool jobShouldRun = (block.timestamp.sub(_jobLastRun)) >=
_jobIntervalSeconds;
upkeepNeeded = jobCanRun && jobShouldRun;
performData = checkData;
// debug
upkeepNeeded = true;
}
function performUpkeep(bytes calldata performData) external override {
(bool upkeepNeeded, ) = _checkUpkeep("0");
require(upkeepNeeded, "Should not upkeep");
emit AtroposUpkeepPerformed();
_jobLastRun = block.timestamp;
}