Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Extend license #26

Merged
merged 1 commit into from
Feb 18, 2024
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
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)
=====================
# The MIT License (MIT)

Copyright © `2023` `kona contributors`
Copyright © `2024` `Optimism`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<img src="https://img.shields.io/badge/Contributor%20Book-grey?logo=mdBook" alt="Book">
</a>
<a href="https://github.com/ethereum-optimism/monorepo"><img src="https://img.shields.io/badge/OP%20Stack-monorepo-red" alt="OP Stack"></a>
<a href="https://t.me/+2yfSX0YikWMxNTRh"><img src="https://img.shields.io/badge/Telegram-x?logo=telegram&label=anton-rs%20contributors"></a>
</p>

<p align="center">
Expand Down
14 changes: 13 additions & 1 deletion crates/preimage/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,27 @@ use anyhow::Result;
pub trait PreimageOracleClient {
/// Get the data corresponding to the currently set key from the host. Return the data in a new heap allocated
/// `Vec<u8>`
///
/// # Returns
/// - `Ok(Vec<u8>)` if the data was successfully fetched from the host.
/// - `Err(_)` if the data could not be fetched from the host.
fn get(&mut self, key: PreimageKey) -> Result<Vec<u8>>;

/// Get the data corresponding to the currently set key from the host. Write the data into the provided buffer
/// Get the data corresponding to the currently set key from the host. Writes the data into the provided buffer.
///
/// # Returns
/// - `Ok(())` if the data was successfully written into the buffer.
/// - `Err(_)` if the data could not be written into the buffer.
fn get_exact(&mut self, key: PreimageKey, buf: &mut [u8]) -> Result<()>;
}

/// A [HintWriterClient] is a high-level interface to the hint pipe. It provides a way to write hints to the host.
pub trait HintWriterClient {
/// Write a hint to the host. This will overwrite any existing hint in the pipe, and block until all data has been
/// written.
///
/// # Returns
/// - `Ok(())` if the hint was successfully written to the host.
/// - `Err(_)` if the hint could not be written to the host.
fn write(&self, hint: &str) -> Result<()>;
}
Loading