ameliatastic / seahorse-lang

Write Anchor-compatible Solana programs in Python
Apache License 2.0
320 stars 46 forks source link

Refactor compile to work in wasm #67

Closed mcintyre94 closed 1 year ago

mcintyre94 commented 1 year ago

unwrap_or eagerly evaluates the or case, so in WASM we were getting the "no current directory" error even when we pass Some working_dir, since current_dir() was returning an Err.

By switching this to a match the None case is only evaluated if needed, and by passing working_dir we avoid evaluating current_dir().