We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We need two behaviors
The original dict_squash method only verifies that a DictAccess segment is sound.
Add a function hashdict_finalize in dict.cairo to handle these two behaviors.
hashdict_finalize
dict.cairo
merge: felt
merge=FALSE
dict_squash
k, p, p
merge=TRUE
original_mapping
test_dict.cairo
DictAccess*
@given(...) def test_hashdict_finalize(original_mapping: Dict[int, int], merge: bool): cairo_run_py("test_hashdict_finalize", ...)
in cairo
current_mapping
values = values + int(merge)
The text was updated successfully, but these errors were encountered:
enitrat
Successfully merging a pull request may close this issue.
Why
We need two behaviors
The original dict_squash method only verifies that a DictAccess segment is sound.
What
Add a function
hashdict_finalize
indict.cairo
to handle these two behaviors.How
merge: felt
argument to define the target behaviormerge=FALSE
, thendict_squash
and create a new dict segment ofk, p, p
created from the squashed dictmerge=TRUE
, then do nothingoriginal_mapping
exists, append the above mentioned segment (newly or existing) to the original segmenttest_dict.cairo
filetest_dict.cairo
to load the initial data into aDictAccess*
in cairo
current_mapping
values to simulate writesvalues = values + int(merge)
The text was updated successfully, but these errors were encountered: