Skip to content

Commit

Permalink
refactor(evm): normalizes comments within BlockHashOracleAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
allemanfredi committed Jan 24, 2024
1 parent 113c3da commit 65a191a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 3 additions & 6 deletions packages/evm/contracts/adapters/BlockHashOracleAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
pragma solidity ^0.8.17;

import { RLPReader } from "solidity-rlp/contracts/RLPReader.sol";

import { OracleAdapter } from "./OracleAdapter.sol";
import { IBlockHashOracleAdapter } from "../interfaces/IBlockHashOracleAdapter.sol";

abstract contract BlockHashOracleAdapter is OracleAdapter {
abstract contract BlockHashOracleAdapter is IBlockHashOracleAdapter, OracleAdapter {
using RLPReader for RLPReader.RLPItem;

/// @dev Proves and stores valid ancestral block hashes for a given chain ID.
/// @param chainId The ID of the chain to prove block hashes for.
/// @param blockHeaders The RLP encoded block headers to prove the hashes for.
/// @notice Block headers should be ordered by descending block number and should start with a known block header.
/// @inheritdoc IBlockHashOracleAdapter
function proveAncestralBlockHashes(uint256 chainId, bytes[] memory blockHeaders) external {
for (uint256 i = 0; i < blockHeaders.length; i++) {
RLPReader.RLPItem memory blockHeaderRLP = RLPReader.toRlpItem(blockHeaders[i]);
Expand Down
10 changes: 6 additions & 4 deletions packages/evm/contracts/interfaces/IBlockHashOracleAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ pragma solidity ^0.8.17;
import { IOracleAdapter } from "./IOracleAdapter.sol";

interface IBlockHashOracleAdapter is IOracleAdapter {
/// @dev Proves and stores valid ancestral block hashes for a given chain ID.
/// @param chainId The ID of the chain to prove block hashes for.
/// @param blockHeaders The RLP encoded block headers to prove the hashes for.
/// @notice Block headers should be ordered by descending block number and should start with a known block header.
/**
* @dev Proves and stores valid ancestral block hashes for a given chain ID.
* @param chainId - The ID of the chain for which the block hashes are to be proven and stored.
* @param blockHeaders - The RLP encoded block headers. These headers are used to prove and subsequently store the hashes.
* @notice The block headers should be ordered by descending block number. The sequence should start with a block header that is already known and verified.
*/
function proveAncestralBlockHashes(uint256 chainId, bytes[] memory blockHeaders) external;
}

0 comments on commit 65a191a

Please sign in to comment.