NethermindEth / cairo-vm-go

A virtual machine for Cairo written in Go
MIT License
73 stars 43 forks source link

Implement `searchSortedLower` hint #438

Closed TAdev0 closed 1 month ago

TAdev0 commented 1 month ago

Closes #253

TAdev0 commented 1 month ago

Still need to improve unit test coverage

TAdev0 commented 1 month ago

@cicr99 @MaksymMalicki @har777 for this one, we need to evaluate the accuracy of executing this if statement

//> if '__find_element_max_size' in globals():
            //>     assert n_elms <= __find_element_max_size, \
            //>         f'find_element() can only be used with n_elms<={__find_element_max_size}. ' \
            //>         f'Got: n_elms={n_elms}.'

this hint is used in one function, thats all. __find_element_max_size is set to 2**20 in the execution of the python VM. I think we should just hardcode it to 2**20 in scope and check that n_elms <= __find_element_max_size

TAdev0 commented 1 month ago

@cicr99 @MaksymMalicki PR updated, addressed all comments, should be good to go!