Skip to content

Commit

Permalink
📝 Extend license (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby authored Feb 18, 2024
1 parent ad2b366 commit 1083ff4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
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<()>;
}

0 comments on commit 1083ff4

Please sign in to comment.