-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
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
test: fn get_starknet_address
#991
Comments
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedHello,I'm a front-end developer with a resolve to confront and solve new challenges. This alongside my experience will aid me in resolving this issue How I plan on tackling this issueI would carefully go through the github link highlighted to aid the implementation of the cheatcodes to resolve the issue, and also carry out the test as required |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI am a blockchaindevelopereveloper How I plan on tackling this issueI would approach this issue with the following steps: For Testing Address Registration: For Testing Computation: |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI'm a returning contributor and I have some experience in Cairo testing. How I plan on tackling this issueI will carefully implement the test as explained in the issue description. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI have a degree in computer science and am a mobile developer with experience in TypeScript and Python, among other programming languages. Although I haven't worked with Cairo directly, I have a strong grasp of Starknet's architecture because to my experience developing smart contracts for other blockchain platforms. My background in test-driven development and unit testing in a variety of settings will be helpful in putting thorough tests for the get_starknet_address function in place. How I plan on tackling this issueI would begin by reviewing the current codebase, paying close attention to the test file you mentioned and the get_starknet_address method. With the cheatcodes from starknet-foundry, I would then write a new test function. In the first test case, I would use get_starknet_address and assert that it returns the stored value after adding a known address to the mapping using the "store" cheatcode. In order to validate that the results of get_starknet_address and compute_starknet_address are identical in the second scenario, I would first make sure the mapping is empty. Before submitting a pull request with the new test cases and any required documentation modifications, I would run the tests locally to make sure they pass. |
test
fn get_starknet_address
to ensurethe test will use starknet-foundry's "store" and "load" cheatcodes, as already used in:
https://github.com/lordshashank/kakarot-ssj/blob/ed7e4145a0bb2517c60c6904fd317d11d1b00625/crates/contracts/tests/test_kakarot_core.cairo#L96-L131
The logic should be:
for 1. you can just put any value in the mapping and verify it's returned
for 2., make sure the mapping is empty, and that
get_starknet_address
returns the same ascompute_starknet_address
.reserved for @saimeunt
The text was updated successfully, but these errors were encountered: