Skip to content

Instantly share code, notes, and snippets.

@mikery
Created June 29, 2019 12:30
Show Gist options
  • Save mikery/1eeb7f5f46de4f8b62db59f6c8d5183c to your computer and use it in GitHub Desktop.
Save mikery/1eeb7f5f46de4f8b62db59f6c8d5183c to your computer and use it in GitHub Desktop.
function requestFlightStatus(address _oracle, string _jobId, string _flightId)
 public
 onlyOwner
 {
 Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(_jobId), this, this.fulfillFlightStatus.selector);
 req.add("flightId", _flightId);
 sendChainlinkRequestTo(_oracle, req, ORACLE_PAYMENT);
 }
 
 function fulfillFlightStatus(bytes32 _requestId, uint256 _status)
 public
 recordChainlinkFulfillment(_requestId)
 {
 flightStatus = _status;
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment