The from_felt252
test case in the starknet/src/byte_array_extra.cairo
contract is responsible for testing the conversion of a felt252
value into a ByteArray
. This test case is crucial for ensuring that the conversion logic works correctly. However, the test case uses an invalid felt252
value ('hello how are you?'
), which is a string literal and not a valid felt252
type. This can lead to incorrect test results and does not properly test the conversion logic.
The use of an invalid felt252
value in the test case can lead to incorrect test results, giving a false sense of security about the correctness of the conversion logic. This can result in undetected bugs in the conversion logic, potentially leading to data corruption and unexpected behavior in the contract.
Manual review
The test case should be updated to use a valid felt252
value and correctly test the conversion logic. The following code provides a corrected implementation:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.