heavy-duty / znap

Performance-first Rust Framework to build APIs compatible with the Solana Actions Spec.
Apache License 2.0
60 stars 1 forks source link

Replace ZNAP_LIB env variable with inference based on the znap declaration #90

Open danmt opened 1 month ago

danmt commented 1 month ago

Expected Behavior

When using a "path" to reference the znap library it should use the provided path for the generated Cargo.toml inside .znap folder.

Found Behavior

If the user provides a path for the znap dependency the user has to define a ZNAP_LIB env variable to specify the path to znap. The value provided by the user is ignored.

Possible Solution

The path provided by the user should be used instead. Using the path value directly would cause error if the path is relative, given that the generated Cargo.toml is inside de .znap folder. If a relative path is provided, it should be turned into an absolute path for the generated Cargo.toml.

The CLI should take care of the inference and get rid of the ZNAP_LIB.