Skip to content

Commit

Permalink
Import and comment cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
vicsn committed Dec 8, 2023
1 parent 4d437a4 commit 7cba76f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion synthesizer/process/src/stack/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl<N: Network> CallTrait<N> for Call<N> {
ExternalRecord(locator) => {
// Retrieve the external stack.
let stack = substack.get_external_stack(locator.program_id())?;
// Sample the input.
// Sample the output.
stack.sample_value(&address, &Record(*locator.resource()), rng)
}
_ => substack.sample_value(&address, output.value_type(), rng),
Expand Down
1 change: 0 additions & 1 deletion synthesizer/process/src/stack/helpers/matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

use super::*;
pub use console::program::{Argument, FinalizeType};

impl<N: Network> StackMatches<N> for Stack<N> {
/// Checks that the given value matches the layout of the value type.
Expand Down
7 changes: 3 additions & 4 deletions synthesizer/process/src/stack/helpers/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

use super::*;
use crate::stack::helpers::matches::{Argument, FinalizeType};

impl<N: Network> Stack<N> {
/// Returns a record for the given record name, with the given burner address.
Expand Down Expand Up @@ -49,9 +48,9 @@ impl<N: Network> Stack<N> {
pub fn sample_future<R: Rng + CryptoRng>(&self, locator: &Locator<N>, rng: &mut R) -> Result<Future<N>> {
// Sample a future value.
let future = self.sample_future_internal(locator, 0, rng)?;
// Ensure the plaintext value matches the plaintext type.
// Ensure the future value matches the future type.
self.matches_future(&future, locator)?;
// Return the plaintext value.
// Return the future value.
Ok(future)
}
}
Expand Down Expand Up @@ -173,7 +172,7 @@ impl<N: Network> Stack<N> {
Ok(plaintext)
}

/// Returns a future for the given TODO.
/// Samples a future value according to the given locator.
fn sample_future_internal<R: Rng + CryptoRng>(
&self,
locator: &Locator<N>,
Expand Down
2 changes: 2 additions & 0 deletions synthesizer/process/src/stack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ use console::{
account::{Address, PrivateKey},
network::prelude::*,
program::{
Argument,
Entry,
EntryType,
FinalizeType,
Future,
Identifier,
Literal,
Expand Down
2 changes: 1 addition & 1 deletion synthesizer/program/src/traits/stack_and_registers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub trait StackProgram<N: Network> {
/// Returns the expected number of calls for the given function name.
fn get_number_of_calls(&self, function_name: &Identifier<N>) -> Result<usize>;

/// Samples a value for the given value_type
/// Samples a value for the given value_type.
fn sample_value<R: Rng + CryptoRng>(
&self,
burner_address: &Address<N>,
Expand Down

0 comments on commit 7cba76f

Please sign in to comment.