Skip to content

Commit 9984899

Browse files
authored
Merge pull request #6 from tellor-io/bridge-name
rename data bridge
2 parents b7815d3 + 7a4ab0f commit 9984899

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
Use this package to install the Tellor user contracts and integrate Tellor into your contracts.
44

5-
Once installed this will allow your contracts to inherit the functions from IBlobstreamO.
5+
Once installed this will allow your contracts to inherit the functions from ITellorDataBridge.
66

77
## How to Use
88

99
```solidity
10-
import "usingtellorlayer/contracts/interfaces/IBlobstreamO.sol";
10+
import "usingtellorlayer/contracts/interfaces/ITellorDataBridge.sol";
1111
1212
contract PriceContract {
13-
IBlobstreamO public blobstream;
13+
ITellorDataBridge public dataBridge;
1414
uint256 public price;
1515
16-
constructor(address _blobstreamO) {
17-
blobstream = IBlobstreamO(_blobstreamO);
16+
constructor(address _dataBridge) {
17+
dataBridge = ITellorDataBridge(_dataBridge);
1818
}
1919
2020
function resolveMarket(
@@ -23,7 +23,7 @@ contract PriceContract {
2323
Signature[] calldata _sigs
2424
) public {
2525
// verify that data came from tellor chain
26-
blobstream.verifyOracleData(_attestData, _currentValidatorSet, _sigs);
26+
dataBridge.verifyOracleData(_attestData, _currentValidatorSet, _sigs);
2727
// NOTE: This is a simplified example. More security checks should be done
2828
// in production to ensure data integrity.
2929
price = abi.decode(_attestData.report.value, (uint256));

contracts/YoloTellorUser.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.19;
33

4-
import "./interfaces/IBlobstreamO.sol";
4+
import "./interfaces/ITellorDataBridge.sol";
55

66
contract YoloTellorUser {
7-
IBlobstreamO public blobstreamO;
7+
ITellorDataBridge public dataBridge;
88
OracleData[] public oracleData;
99

1010
struct OracleData {
1111
uint256 value; // reported value
1212
uint256 timestamp; // aggregate report timestamp
1313
}
1414

15-
constructor(address _blobstreamO) {
16-
blobstreamO = IBlobstreamO(_blobstreamO);
15+
constructor(address _dataBridge) {
16+
dataBridge = ITellorDataBridge(_dataBridge);
1717
}
1818

1919
function updateOracleData(
2020
OracleAttestationData calldata _attestData,
2121
Validator[] calldata _currentValidatorSet,
2222
Signature[] calldata _sigs
2323
) external {
24-
blobstreamO.verifyOracleData(_attestData, _currentValidatorSet, _sigs);
24+
dataBridge.verifyOracleData(_attestData, _currentValidatorSet, _sigs);
2525
uint256 _value = abi.decode(_attestData.report.value, (uint256));
2626
oracleData.push(OracleData(
2727
_value,

contracts/interfaces/IBlobstreamO.sol renamed to contracts/interfaces/ITellorDataBridge.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct Validator {
2727
uint256 power;
2828
}
2929

30-
interface IBlobstreamO {
30+
interface ITellorDataBridge {
3131
function guardian() external view returns (address);
3232
function powerThreshold() external view returns (uint256);
3333
function unbondingPeriod() external view returns (uint256);
File renamed without changes.

contracts/testing/blobstream/BlobstreamO.sol renamed to contracts/testing/bridge/TellorDataBridge.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ struct Validator {
3131
}
3232

3333

34-
/// @title BlobstreamO: Tellor Layer -> EVM, Oracle relay.
34+
/// @title TellorDataBridge: Tellor Layer -> EVM, Oracle relay.
3535
/// @dev The relay relies on a set of signers to attest to some event on
3636
/// Tellor Layer. These signers are the validator set, who sign over every
3737
/// block. At least 2/3 of the voting power of the current
3838
/// view of the validator set must sign off on new relayed events.
39-
contract BlobstreamO is ECDSA {
39+
contract TellorDataBridge is ECDSA {
4040

4141
/*Storage*/
4242
address public guardian; /// Able to reset the validator set only if the validator set becomes stale.
@@ -66,7 +66,7 @@ contract BlobstreamO is ECDSA {
6666
error ValidatorTimestampMustIncrease();
6767

6868
/*Functions*/
69-
/// @notice Constructor for the BlobstreamO contract.
69+
/// @notice Constructor for the TellorDataBridge contract.
7070
/// @param _guardian Guardian address.
7171
constructor(
7272
address _guardian

test/YoloTellorUser.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const abiCoder = new ethers.utils.AbiCoder();
55

66
describe("YoloTellorUser - Function Tests", async function () {
77

8-
let blobstream, user, accounts, guardian, initialPowers, initialValAddrs, valCheckpoint;
8+
let dataBridge, user, accounts, guardian, initialPowers, initialValAddrs, valCheckpoint;
99
let val1, val2, val3;
1010
const UNBONDING_PERIOD = 86400 * 7 * 3; // 3 weeks
1111

@@ -23,15 +23,15 @@ describe("YoloTellorUser - Function Tests", async function () {
2323
valTimestamp = (blocky.timestamp - 2) * 1000
2424
newValHash = await h.calculateValHash(initialValAddrs, initialPowers)
2525
valCheckpoint = h.calculateValCheckpoint(newValHash, threshold, valTimestamp)
26-
// deploy blobstream
27-
blobstream = await ethers.deployContract("BlobstreamO", [guardian.address])
28-
await blobstream.init(threshold, valTimestamp, UNBONDING_PERIOD, valCheckpoint)
26+
// deploy dataBridge
27+
dataBridge = await ethers.deployContract("TellorDataBridge", [guardian.address])
28+
await dataBridge.init(threshold, valTimestamp, UNBONDING_PERIOD, valCheckpoint)
2929
// deploy user
30-
user = await ethers.deployContract("YoloTellorUser", [blobstream.address])
30+
user = await ethers.deployContract("YoloTellorUser", [dataBridge.address])
3131
});
3232

3333
it("constructor", async function () {
34-
assert.equal(await user.blobstreamO(), await blobstream.address)
34+
assert.equal(await user.dataBridge(), await dataBridge.address)
3535
})
3636

3737
it("updateOracleData", async function () {

0 commit comments

Comments
 (0)