-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Final updates and update version to 1.0.0 (#138)
This PR applies final updates to the release branch for the 1.0.0 release. * Cherry pick #129 * Cherry pick #131 * Remove or soften warnings, as is also done by #139 on `main` This PR bumps the version of all crates in this repo, except `risc0-steel`, to 1.0.0. --------- Co-authored-by: Wolfgang Welz <welzwo@gmail.com> Co-authored-by: Angelo Capossele <angelocapossele@gmail.com>
- Loading branch information
1 parent
b96ab6f
commit 5fbbc7c
Showing
34 changed files
with
519 additions
and
485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2024 RISC Zero, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pragma solidity ^0.8.9; | ||
|
||
/// @title Steel Library | ||
/// @notice This library provides a collection of utilities to work with Steel commitments in Solidity. | ||
library Steel { | ||
/// @notice A Commitment struct representing a block number and its block hash. | ||
struct Commitment { | ||
uint256 blockNumber; // Block number at which the commitment was made. | ||
bytes32 blockHash; // Hash of the block at the specified block number. | ||
} | ||
|
||
/// @notice Validates if the provided Commitment matches the block hash of the given block number. | ||
/// @param commitment The Commitment struct to validate. | ||
/// @return isValid True if the commitment's block hash matches the block hash of the block number, false otherwise. | ||
function validateCommitment(Commitment memory commitment) internal view returns (bool isValid) { | ||
return commitment.blockHash == blockhash(commitment.blockNumber); | ||
} | ||
} |
Oops, something went wrong.