Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Aug 26, 2024
1 parent 4cc7209 commit 13980c6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion snforge_std/src/cheatcodes/tx_info.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ fn spoof(target: CheatTarget, tx_info_mock: TxInfoMock, span: CheatSpan) {
handle_cheatcode(cheatcode::<'spoof'>(inputs.span()));
}

/// Changes `TxInfo` returned by `get_tx_info()` for the targeted contract until the spoof is canceled with `stop_spoof`.
/// Changes `TxInfo` returned by `get_tx_info()` for the targeted contract until the spoof is
/// canceled with `stop_spoof`.
/// - `target` - instance of `CheatTarget` specifying which contracts to spoof
/// - `tx_info_mock` - a struct with same structure as `TxInfo` (returned by `get_tx_info()`)
fn start_spoof(target: CheatTarget, tx_info_mock: TxInfoMock) {
Expand Down
3 changes: 2 additions & 1 deletion snforge_std/src/fs/file_operations.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ fn read_txt(file: @File) -> Array<felt252> {
}

/// `file` - a `File` struct to read json data from
/// Returns an array of felts read from the file, panics if read was not possible, or json was incorrect
/// Returns an array of felts read from the file, panics if read was not possible, or json was
/// incorrect
fn read_json(file: @File) -> Array<felt252> {
let content = handle_cheatcode(
cheatcode::<'read_json'>(byte_array_as_felt_array(file.path).span())
Expand Down
6 changes: 4 additions & 2 deletions snforge_std/src/signature.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ trait KeyPairTrait<SK, PK> {
trait SignerTrait<T, H, U> {
/// Signs given message hash
/// `self` - KeyPair used for signing
/// `message_hash` - input to sign bounded by the curve type (u256 for 256bit curves, felt252 for StarkCurve)
/// `message_hash` - input to sign bounded by the curve type (u256 for 256bit curves, felt252
/// for StarkCurve)
/// Returns the signature components (usually r,s tuple)
fn sign(self: T, message_hash: H) -> U;
}

trait VerifierTrait<T, H, U> {
/// `self` - KeyPair used for verifying
/// `message_hash` - input to verify bounded by the curve type (u256 for 256bit curves, felt252 for StarkCurve)
/// `message_hash` - input to verify bounded by the curve type (u256 for 256bit curves, felt252
/// for StarkCurve)
/// `signature` - the signature components (usually r,s tuple)
/// Returns a boolean representing the validity of the signature
fn verify(self: T, message_hash: H, signature: U) -> bool;
Expand Down
3 changes: 2 additions & 1 deletion snforge_std/src/trace.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use core::starknet::testing::cheatcode;
use core::starknet::ContractAddress;
use super::_cheatcode::handle_cheatcode;

/// Tree-like structure which contains all of the starknet calls and sub-calls along with the results
/// Tree-like structure which contains all of the starknet calls and sub-calls along with the
/// results
#[derive(Drop, Serde, PartialEq)]
struct CallTrace {
entry_point: CallEntryPoint,
Expand Down

0 comments on commit 13980c6

Please sign in to comment.