Skip to main content

OracleBaseTunnelMock

OracleBaseTunnelMock#

Unit tests should ensure that internal methods _requestPrice and _publishPrice emit the correct events and modify state as expected.

Functions#

constructor(address _finderAddress) (public)
requestPrice(bytes32 identifier, uint256 time, bytes ancillaryData) (public)
encodePriceRequest(bytes32 identifier, uint256 time, bytes ancillaryData) → bytes32 (public)
publishPrice(bytes32 identifier, uint256 time, bytes ancillaryData, int256 price) (public)
_requestPrice(bytes32 identifier, uint256 time, bytes ancillaryData) (internal)

Enqueues a request (if a request isn't already present) for the given (identifier, time, ancillary data) combination. Will only emit an event if the request has never been requested.

_publishPrice(bytes32 identifier, uint256 time, bytes ancillaryData, int256 price) (internal)

Publishes price for a requested query. Will only emit an event if the request has never been resolved.

_encodePriceRequest(bytes32 identifier, uint256 time, bytes ancillaryData) → bytes32 (internal)

Returns the convenient way to store price requests, uniquely identified by {identifier, time, ancillaryData }.

Events#

PriceRequestAdded(bytes32 identifier, uint256 time, bytes ancillaryData, bytes32 requestHash)
PushedPrice(bytes32 identifier, uint256 time, bytes ancillaryData, int256 price, bytes32 requestHash)