Skip to content

Commit

Permalink
fix standart_hook_metadata::format_metadata-Bytes size
Browse files Browse the repository at this point in the history
  • Loading branch information
EgeCaner committed Jan 22, 2025
1 parent 26e137d commit aca75f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub mod standard_hook_metadata {
const GAS_LIMIT_OFFSET: u8 = 34;
const REFUND_ADDRESS_OFFSET: u8 = 66;
const MIN_METADATA_LENGTH: u256 = 98;

const U128_NUMBER_OF_BYTES: usize = 16;
pub const VARIANT: u8 = 1;

#[generate_trait]
Expand Down Expand Up @@ -140,7 +140,7 @@ pub mod standard_hook_metadata {
refund_address_u256.high
];

let mut formatted_metadata = BytesTrait::new(data.len(), data);
let mut formatted_metadata = BytesTrait::new(data.len() * U128_NUMBER_OF_BYTES, data);
formatted_metadata.concat(@custom_metadata);
formatted_metadata
}
Expand Down
2 changes: 1 addition & 1 deletion cairo/crates/contracts/src/mailbox.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ pub mod mailbox {
Option::Some(hook_metadata) => {
let mut sanitized_bytes_metadata = BytesTrait::new_empty();
sanitized_bytes_metadata.concat(@hook_metadata);
assert( // what does this exactly checks
assert(
sanitized_bytes_metadata == hook_metadata,
Errors::SIZE_DOES_NOT_MATCH_METADATA
);
Expand Down

0 comments on commit aca75f3

Please sign in to comment.