Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests
on:
push:
branches:
- main
tags:
- v*
pull_request:

jobs:
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Run tests
run: npx hardhat test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Tests](https://github.com/tellor-io/UsingTellorLayer/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/tellor-io/UsingTellorLayer/actions/workflows/tests.yml)

# UsingTellorLayer

Use this package to install the Tellor user contracts and integrate Tellor into your contracts.
Expand Down
1 change: 0 additions & 1 deletion artifacts/build-info/3d7102a7b74c245b885295d3f9e627a4.json

This file was deleted.

1 change: 1 addition & 0 deletions artifacts/build-info/ddd00ff12efc93d7c8bb99665bd536bb.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/3d7102a7b74c245b885295d3f9e627a4.json"
"buildInfo": "../../build-info/ddd00ff12efc93d7c8bb99665bd536bb.json"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/3d7102a7b74c245b885295d3f9e627a4.json"
"buildInfo": "../../../build-info/ddd00ff12efc93d7c8bb99665bd536bb.json"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/3d7102a7b74c245b885295d3f9e627a4.json"
"buildInfo": "../../../../build-info/ddd00ff12efc93d7c8bb99665bd536bb.json"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/3d7102a7b74c245b885295d3f9e627a4.json"
"buildInfo": "../../../../build-info/ddd00ff12efc93d7c8bb99665bd536bb.json"
}

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions contracts/testing/bridge/Constants.sol

This file was deleted.

14 changes: 10 additions & 4 deletions contracts/testing/bridge/TellorDataBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity 0.8.19;

import {ECDSA} from "./ECDSA.sol";
import "./Constants.sol";

struct OracleAttestationData {
bytes32 queryId;
Expand Down Expand Up @@ -47,6 +46,12 @@ contract TellorDataBridge is ECDSA {
address public deployer; /// Address that deployed the contract.
bool public initialized; /// True if the contract is initialized.
uint256 public constant MS_PER_SECOND = 1000; // factor to convert milliseconds to seconds
bytes32 public constant NEW_REPORT_ATTESTATION_DOMAIN_SEPARATOR = // "tellorCurrentAttestation"
0x74656c6c6f7243757272656e744174746573746174696f6e0000000000000000;
// For tellor mainnet, this is "0x636865636b706f696e7400000000000000000000000000000000000000000000".
// Otherwise, we take the tellor chain id as a string, and the validator set domain separator is
// keccak256(abi.encode("checkpoint", TELLOR_CHAIN_ID)). This differentiates between different networks.
bytes32 public immutable VALIDATOR_SET_HASH_DOMAIN_SEPARATOR;

/*Events*/
event GuardianResetValidatorSet(uint256 _powerThreshold, uint256 _validatorTimestamp, bytes32 _validatorSetHash);
Expand All @@ -69,10 +74,12 @@ contract TellorDataBridge is ECDSA {
/// @notice Constructor for the TellorDataBridge contract.
/// @param _guardian Guardian address.
constructor(
address _guardian
address _guardian,
bytes32 _validatorSetHashDomainSeparator
) {
guardian = _guardian;
deployer = msg.sender;
VALIDATOR_SET_HASH_DOMAIN_SEPARATOR = _validatorSetHashDomainSeparator;
}

/// @notice This function is called only once by the deployer to initialize the contract
Expand Down Expand Up @@ -272,7 +279,7 @@ contract TellorDataBridge is ECDSA {
uint256 _powerThreshold,
uint256 _validatorTimestamp,
bytes32 _validatorSetHash
) internal pure returns (bytes32) {
) internal view returns (bytes32) {
return
keccak256(
abi.encode(
Expand Down Expand Up @@ -302,4 +309,3 @@ contract TellorDataBridge is ECDSA {
return _signer == _recovered;
}
}

Loading
Loading