Skip to content

Commit

Permalink
Merge pull request #133 from tellor-io/cleanup
Browse files Browse the repository at this point in the history
internal, tests passing
  • Loading branch information
tkernell authored Apr 19, 2024
2 parents 9c85948 + ff96c6b commit ff05d65
Show file tree
Hide file tree
Showing 41 changed files with 216 additions and 3,863 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contract PriceContract is UsingTellor {
uint256 _timestamp;
bytes memory _value;
(_value, _timestamp) = getDataBefore(_btcQueryId, block.timestamp - 1 hours);
(_value, _timestamp) = _getDataBefore(_btcQueryId, block.timestamp - 1 hours);
btcPrice = abi.decode(_value,(uint256));
}
}
Expand All @@ -54,8 +54,8 @@ Children contracts have access to the following functions:
* @return _value the value retrieved
* @return _timestampRetrieved the value's timestamp
*/
function getDataAfter(bytes32 _queryId, uint256 _timestamp)
public
function _getDataAfter(bytes32 _queryId, uint256 _timestamp)
internal
view
returns (bytes memory _value, uint256 _timestampRetrieved);
Expand All @@ -66,8 +66,8 @@ function getDataAfter(bytes32 _queryId, uint256 _timestamp)
* @return _value the value retrieved
* @return _timestampRetrieved the value's timestamp
*/
function getDataBefore(bytes32 _queryId, uint256 _timestamp)
public
function _getDataBefore(bytes32 _queryId, uint256 _timestamp)
internal
view
returns (bytes memory _value, uint256 _timestampRetrieved);
Expand All @@ -78,8 +78,8 @@ function getDataBefore(bytes32 _queryId, uint256 _timestamp)
* @return _found whether the index was found
* @return _index the next index found after the specified timestamp
*/
function getIndexForDataAfter(bytes32 _queryId, uint256 _timestamp)
public
function _getIndexForDataAfter(bytes32 _queryId, uint256 _timestamp)
internal
view
returns (bool _found, uint256 _index);
Expand All @@ -90,8 +90,8 @@ function getIndexForDataAfter(bytes32 _queryId, uint256 _timestamp)
* @return _found whether the index was found
* @return _index the latest index found before the specified timestamp
*/
function getIndexForDataBefore(bytes32 _queryId, uint256 _timestamp)
public
function _getIndexForDataBefore(bytes32 _queryId, uint256 _timestamp)
internal
view
returns (bool _found, uint256 _index);
Expand All @@ -104,13 +104,13 @@ function getIndexForDataBefore(bytes32 _queryId, uint256 _timestamp)
* @return _values the values retrieved, ordered from oldest to newest
* @return _timestamps the timestamps of the values retrieved
*/
function getMultipleValuesBefore(
function _getMultipleValuesBefore(
bytes32 _queryId,
uint256 _timestamp,
uint256 _maxAge,
uint256 _maxCount
)
public
internal
view
returns (bytes[] memory _values, uint256[] memory _timestamps);
Expand All @@ -119,8 +119,8 @@ function getMultipleValuesBefore(
* @param _queryId the id to look up
* @return uint256 count of the number of values received for the queryId
*/
function getNewValueCountbyQueryId(bytes32 _queryId)
public
function _getNewValueCountbyQueryId(bytes32 _queryId)
internal
view
returns (uint256);
Expand All @@ -130,8 +130,8 @@ function getNewValueCountbyQueryId(bytes32 _queryId)
* @param _timestamp is the timestamp to find a corresponding reporter for
* @return address of the reporter who reported the value for the data ID at the given timestamp
*/
function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
public
function _getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
internal
view
returns (address);
Expand All @@ -141,8 +141,8 @@ function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
* @param _index is the value index to look up
* @return uint256 timestamp
*/
function getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
public
function _getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
internal
view
returns (uint256);
Expand All @@ -152,8 +152,8 @@ function getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
* @param _timestamp is the timestamp of the value to look up
* @return bool true if queryId/timestamp is under dispute
*/
function isInDispute(bytes32 _queryId, uint256 _timestamp)
public
function _isInDispute(bytes32 _queryId, uint256 _timestamp)
internal
view
returns (bool);
Expand All @@ -163,16 +163,16 @@ function isInDispute(bytes32 _queryId, uint256 _timestamp)
* @param _timestamp to retrieve data/value from
* @return bytes value for query/timestamp submitted
*/
function retrieveData(bytes32 _queryId, uint256 _timestamp)
public
function _retrieveData(bytes32 _queryId, uint256 _timestamp)
internal
view
returns (bytes memory);
```


#### Tellor Playground:

For ease of use, the `UsingTellor` repo comes with a version of [Tellor Playground](https://github.com/tellor-io/TellorPlayground) for easier integration. This version contains a few helper functions:
For ease of use, the `UsingTellor` repo comes with a version of [Tellor Playground](https://github.com/tellor-io/TellorPlayground) for easier testing. This version contains a few helper functions:

```solidity
/**
Expand Down
1 change: 0 additions & 1 deletion artifacts/build-info/4ec6bcceba96197f0b028acfec23a51f.json

This file was deleted.

1 change: 1 addition & 0 deletions artifacts/build-info/a57a0c8893a63b946905aefba5853e48.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions artifacts/build-info/d48d8c45439b66d353ec5b849f2f80d9.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../build-info/4ec6bcceba96197f0b028acfec23a51f.json"
"buildInfo": "../../build-info/a57a0c8893a63b946905aefba5853e48.json"
}
2 changes: 1 addition & 1 deletion artifacts/contracts/UsingTellor.sol/UsingTellor.dbg.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../build-info/4ec6bcceba96197f0b028acfec23a51f.json"
"buildInfo": "../../build-info/d48d8c45439b66d353ec5b849f2f80d9.json"
}
Loading

0 comments on commit ff05d65

Please sign in to comment.