diff --git a/packages/testing/src/common.cairo b/packages/testing/src/common.cairo index ea7b4c9ba..135a985de 100644 --- a/packages/testing/src/common.cairo +++ b/packages/testing/src/common.cairo @@ -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) -> ByteArray { let mut panic_data = panic_data.span(); @@ -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> of IntoBase16StringTrait { fn into_base_16_string(self: T) -> ByteArray { diff --git a/packages/testing/src/events.cairo b/packages/testing/src/events.cairo index d77d72904..944698d5c 100644 --- a/packages/testing/src/events.cairo +++ b/packages/testing/src/events.cairo @@ -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, +Drop>( ref self: EventSpy, from_address: ContractAddress, expected_event: T ) {