我对 RSK 集成有疑问(特别是关于如何使用回调地址) https://github.com/smartcontractkit/chainlink-RSK/blob/master/test-runner/src/contracts/Consumer.sol
function requestRIFPriceByCallback(uint256 _payment, address _callback) public {
Chainlink.Request memory req = buildChainlinkRequest(specId, _callback, this.fulfill.selector);
req.add("get", "https://api.liquid.com/products/580");
req.add("path", "last_traded_price");
req.addInt("times", 100000000);
sendChainlinkRequest(req, _payment);
}
https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.4/tests/Consumer.sol
function requestEthereumPrice(string _currency) public {
Chainlink.Request memory req = buildChainlinkRequest(specId, this, this.fulfill.selector);
req.add("get", "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR,JPY");
string[] memory path = new string[](1);
path[0] = _currency;
req.addStringArray("path", path);
sendChainlinkRequest(req, ORACLE_PAYMENT);
}
这些来自 Consumer.sol(上面来自 RSK,下面来自原始) 为什么 RSK 消费者需要回调地址,它有什么作用/它是如何工作的?