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

Unhandled Option::unwrap() Panics Across Multiple Pool Modules During Tests and Execution #7

Open
gg-0x opened this issue Apr 11, 2024 · 1 comment

Comments

@gg-0x
Copy link

gg-0x commented Apr 11, 2024

Error Description:

Encountering panic due to Option::unwrap() calls on None value across all liquidity pool modules when running tests and executing client/ off-chain arbitrage bot code. The issue persists across different modules, indicating a widespread pattern of assuming Some values without prior validation.

Error Output:

---- tests::quotes::mercurial stdout ----
thread 'tests::quotes::mercurial' panicked at src/pools/mercurial.rs:151:47: called `Option::unwrap()` on a `None` value

---- tests::quotes::aldrin stdout ----
thread 'tests::quotes::aldrin' panicked at src/pools/aldrin.rs:220:47: called `Option::unwrap()` on a `None` value

---- tests::quotes::orca stdout ----
thread 'tests::quotes::orca' panicked at src/pools/orca.rs:166:47: called `Option::unwrap()` on a `None` value

---- tests::quotes::saber stdout ----
thread 'tests::quotes::saber' panicked at src/pools/saber.rs:125:47: called `Option::unwrap()` on a `None` value

---- tests::quotes::serum stdout ----
thread 'tests::quotes::serum' panicked at src/pools/serum.rs:378:50: called `Option::unwrap()` on a `None` value

Environment:

  • Rust Version: rustc 1.77.2
  • Anchor Version: avm 0.22.1
  • Operating System: macOS 14.4.1
  • Build Version: 23E224
@fer000n
Copy link

fer000n commented May 18, 2024

I have the same issue:

Anchor Version: avm 0.22.1
Operating System: Ubuntu 22

test tests::quotes::aldrin ... FAILED
test tests::quotes::mercurial ... FAILED
test tests::quotes::orca ... FAILED
test tests::quotes::saber ... FAILED
test tests::quotes::serum ... FAILED

failures:

---- tests::quotes::aldrin stdout ----
thread 'tests::quotes::aldrin' panicked at src/tests/quotes.rs:70:58:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

---- tests::quotes::mercurial stdout ----
thread 'tests::quotes::mercurial' panicked at src/tests/quotes.rs:70:58:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::quotes::orca stdout ----
thread 'tests::quotes::orca' panicked at src/tests/quotes.rs:70:58:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::quotes::saber stdout ----
thread 'tests::quotes::saber' panicked at src/tests/quotes.rs:70:58:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::quotes::serum stdout ----
thread 'tests::quotes::serum' panicked at src/tests/quotes.rs:70:58:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

failures:
tests::quotes::aldrin
tests::quotes::mercurial
tests::quotes::orca
tests::quotes::saber
tests::quotes::serum

test result: FAILED. 43 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.37s

error: test failed, to rerun pass --lib

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

No branches or pull requests

2 participants