Skip to content

Commit

Permalink
add minor comments (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-fleming authored Nov 15, 2024
1 parent ff92dff commit d66d210
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/testing/src/common.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use starknet::{ContractAddress, SyscallResult};

/// Converts panic data into a string (ByteArray).
///
/// panic_data is expected to be a valid serialized byte array with an extra
/// `panic_data` is expected to be a valid serialized byte array with an extra
/// felt252 at the beginning, which is the BYTE_ARRAY_MAGIC.
pub fn panic_data_to_byte_array(panic_data: Array<felt252>) -> ByteArray {
let mut panic_data = panic_data.span();
Expand Down Expand Up @@ -39,7 +39,7 @@ pub fn to_base_16_string_no_padding(value: felt252) -> ByteArray {
}

/// A helper trait that enables any value that can be converted to `felt252` to be represented
/// as a `base16` string(including the `0x` prefix).
/// as a `base16` string (including the `0x` prefix).
#[generate_trait]
pub impl IntoBase16String<T, +Into<T, felt252>> of IntoBase16StringTrait<T> {
fn into_base_16_string(self: T) -> ByteArray {
Expand Down
3 changes: 3 additions & 0 deletions packages/testing/src/events.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pub impl EventSpyExtImpl of EventSpyExt {
}

/// Ensures that `from_address` has emitted the `expected_event`.
/// This assertion increments the event offset which essentially
/// consumes the event in the first position of the offset. This means
/// that events must be asserted in the order that they're emitted.
fn assert_emitted_single<T, +starknet::Event<T>, +Drop<T>>(
ref self: EventSpy, from_address: ContractAddress, expected_event: T
) {
Expand Down

0 comments on commit d66d210

Please sign in to comment.