Skip to content
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

Added 14 unit tests to test_reader.cairo #561

Merged
merged 18 commits into from
Jan 3, 2024
Merged

Added 14 unit tests to test_reader.cairo #561

merged 18 commits into from
Jan 3, 2024

Conversation

Akinbola247
Copy link
Contributor

@Akinbola247 Akinbola247 commented Oct 26, 2023

hi @sparqet , @abdelhamidbakhta , @Sk8erboi84 with reference to this issue #491 i added 14 tests cases in the test_reader.cairo, 9 are working as expected but 5 are not. the fn get_pnl_to_pool_factor returns 0x0, fn get_virtual_inventory also returns 0x0, get_swap_amount_out & get_adl_state returns an unwrap failed error and get_swap_price_impact returns a panicked crates error. i've tagged the functions with @Audit tag in the test_reader.cairo file. I'm already looking to the reasons for the errors, but that would mean major changes to the code base. Any suggestions or perhaps am i missing something?.

@Akinbola247 Akinbola247 marked this pull request as draft October 26, 2023 13:16
@Akinbola247 Akinbola247 changed the title Added 11 unit tests to test_reader.cairo Added 14 unit tests to test_reader.cairo Oct 27, 2023
@Akinbola247
Copy link
Contributor Author

@sparqet i look forward to hearing from you

@gaetbout
Copy link
Contributor

gaetbout commented Nov 4, 2023

@sparqet could you at this and provide some feedback ? 😄

@sparqet sparqet linked an issue Dec 1, 2023 that may be closed by this pull request
@Akinbola247 Akinbola247 marked this pull request as ready for review December 8, 2023 08:57
@Akinbola247
Copy link
Contributor Author

ISSUES

  1. the fn get_pnl_to_pool_factor returns 0x0 value
  2. fn get_virtual_inventory also returns 0x0
  3. get_swap_amount_out returns usd_delta_exceeds_pool_value error (this is probably a due process issue)
  4. get_adl_state returns 0x0
  5. get_swap_price_impact returns panicked at crates/cheatnet/src/rpc.rs:88:55:
    called Option::unwrap() on a None value

These 2 recently stopped working
6. get_position_info returns thread 'tokio-runtime-worker' panicked at crates/cheatnet/src/rpc.rs:88:55:
called Option::unwrap() on a None value
7. position_info_list returns thread 'tokio-runtime-worker' panicked at crates/cheatnet/src/rpc.rs:88:55:
called Option::unwrap() on a None value

In Summary 7 added tests passed, 2 returns 0x0 value 1 returns a due process error and 2 failed returning a panicked error (i’ve commented them in the code base)

@Sk8erboi84 Sk8erboi84 merged commit e665cfe into keep-starknet-strange:main Jan 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: Improve tests of reader library.
4 participants