Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
salman01zp committed Feb 15, 2024
1 parent ab8aae2 commit f06acdf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
7 changes: 4 additions & 3 deletions circom-proving/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ impl TryFrom<Proof> for ArkProof<Bn254> {
}
}

// Helper for converting a PrimeField to its U256 representation for Ethereum compatibility
// Helper for converting a PrimeField to its U256 representation for Ethereum
// compatibility
fn u256_to_point<F: PrimeField>(point: U256) -> Result<F, Error> {
let mut buf = [0; 32];
point.to_little_endian(&mut buf);
Expand All @@ -321,8 +322,8 @@ fn u256_to_point<F: PrimeField>(point: U256) -> Result<F, Error> {
F::from_repr(bigint).ok_or_else(|| CircomError::InvalidProofBytes.into())
}

// Helper for converting a PrimeField to its U256 representation for Ethereum compatibility
// (U256 reads data as big endian)
// Helper for converting a PrimeField to its U256 representation for Ethereum
// compatibility (U256 reads data as big endian)
fn point_to_u256<F: PrimeField>(point: F) -> Result<U256, Error> {
let point = point.into_repr();
let point_bytes = point.to_bytes_be();
Expand Down
18 changes: 11 additions & 7 deletions evm-test-utils/src/anvil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,22 @@ impl Anvil {
self
}

/// Sets the mnemonic which will be used when the `anvil` instance is launched.
/// Sets the mnemonic which will be used when the `anvil` instance is
/// launched.
pub fn mnemonic<T: Into<String>>(mut self, mnemonic: T) -> Self {
self.mnemonic = Some(mnemonic.into());
self
}

/// Sets the block-time in seconds which will be used when the `anvil` instance is launched.
/// Sets the block-time in seconds which will be used when the `anvil`
/// instance is launched.
pub fn block_time<T: Into<u64>>(mut self, block_time: T) -> Self {
self.block_time = Some(block_time.into());
self
}

/// Sets the `fork-block-number` which will be used in addition to [`Self::fork`].
/// Sets the `fork-block-number` which will be used in addition to
/// [`Self::fork`].
///
/// **Note:** if set, then this requires `fork` to be set as well
pub fn fork_block_number<T: Into<u64>>(
Expand All @@ -194,9 +197,9 @@ impl Anvil {
self
}

/// Sets the `fork` argument to fork from another currently running Ethereum client
/// at a given block. Input should be the HTTP location and port of the other client,
/// e.g. `http://localhost:8545`. You can optionally specify the block to fork from
/// Sets the `fork` argument to fork from another currently running Ethereum
/// client at a given block. Input should be the HTTP location and port
/// of the other client, e.g. `http://localhost:8545`. You can optionally specify the block to fork from
/// using an @ sign: `http://localhost:8545@1599200`
pub fn fork<T: Into<String>>(mut self, fork: T) -> Self {
self.fork = Some(fork.into());
Expand All @@ -221,7 +224,8 @@ impl Anvil {
self
}

/// Sets the timeout which will be used when the `anvil` instance is launched.
/// Sets the timeout which will be used when the `anvil` instance is
/// launched.
pub fn timeout<T: Into<u64>>(mut self, timeout: T) -> Self {
self.timeout = Some(timeout.into());
self
Expand Down

0 comments on commit f06acdf

Please sign in to comment.