inkdevhub / swanky-cli

The all-in-one developer environment for Parity pallet-contracts based smart contracts!
https://docs.astar.network/docs/build/wasm/swanky-suite/cli/
MIT License
70 stars 29 forks source link

[BUG] `check` command logs a warning because a non fixed version of ink is set in templates dependencies #202

Open ipapandinas opened 5 months ago

ipapandinas commented 5 months ago

Description

The ink version (4.2.1) used in contract templates do not come prefixed with a "=" or "v".\ This logs the warning below when running swanky check command.

[WARNING]Some of the ink dependencies do not have a fixed version.
      This can lead to accidentally installing version higher than supported by the node.
      Please use "=" to install a fixed version (Example: "=3.0.1")

Then, this error occurs when adding the "=" prefix manually to the ink version in the Cargo.toml of the flipper contract template.

swanky check                 
✔ Check Rust
✔ Check cargo
✔ Check cargo nightly
✔ Check cargo dylint
✔ Check cargo-contract
✔ Read ink dependencies

error:   UnknownError: Invalid Version: =4.2.1
Please report this bug at: https://github.com/swankyhub/swanky-cli/issues
    at new SemVer (~/Documents/dev/astar/swanky-cli/node_modules/semver/classes/semver.js:38:13)
    at compare (~/Documents/dev/astar/swanky-cli/node_modules/semver/functions/compare.js:3:3)
    at Object.gt (~/Documents/dev/astar/swanky-cli/node_modules/semver/functions/gt.js:2:29)
    at file://~/Documents/dev/astar/swanky-cli/dist/commands/check/index.js:79:51
    at Array.forEach (<anonymous>)
    at Task.task [as taskFn] (file://~/Documents/dev/astar/swanky-cli/dist/commands/check/index.js:76:60)
    at Task.run (file://~/Documents/dev/astar/swanky-cli/node_modules/listr2/dist/index.js:1956:35)

To fix

Steps to Reproduce

  1. swanky init test
  2. cd test
  3. swanky check

Expected vs. Actual Behavior

Expected: No warning logged. Actual Behavior: Warning logged.

Environment