-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add contract's ink! compatibility check #1334
Conversation
crates/metadata/src/lib.rs
Outdated
/// binary. | ||
pub fn check_contract_ink_compatibility(ink_version: &Version) -> Result<()> { | ||
let ink_minimal_version = | ||
Version::parse("4.0.0-alpha.1").expect("Parsing version failed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here dependency is hardcoded,
optionally we could have compatibility.json file:
{
"versions": [
{
"cargo-contract": ">=1.0.0,<2.0.0",
"ink": ">=3.0.0,<4.0.0"
},
{
"cargo-contract": ">=4.0.0",
"ink": ">=4.0.0"
}
]
}
and include it to code (include_str)
This reverts commit a58ae70.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a few improvements can be made to the readability of the comparison logic 👇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add warning message when using incompatible contract's ink! version
Closes #754
ink
orpallet-contracts
?Description
Checks the compatibility of the contract's ink version with the cargo-contract. If a version mismatch is detected, a warning message will be displayed:
warning: The cargo-contract is not compatible with the contract's ink! version. Please update the cargo-contract to version '1.5.0' or update the contract ink! to a version of '^4.0.0-alpha.3', '^4.0.0', '^5.0.0-alpha'
Checklist before requesting a review
CHANGELOG.md