-
Notifications
You must be signed in to change notification settings - Fork 221
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
feat: nep330 build info field of contract metadata #1178
base: master
Are you sure you want to change the base?
Conversation
…E_CODE_SNAPSHOT`
bbba413
to
bf81221
Compare
d7c9d0b
to
b3bd35c
Compare
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.
This is the right direction! I have left a couple of review comments to address
FieldError::UnsetOrEmptyBuildCommand | ||
); | ||
let build_command = | ||
build_command.split_whitespace().map(|st| st.to_string()).collect::<Vec<_>>(); |
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.
Ouch, split_whitespace
is not something we want to take chances with. Let's find a lossless way of passing BUILD_COMMAND. JSON array of strings? So, basically, serde_json::from_str::<Vec<String>>(build_command)
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.
yeap, this does look like a great alternative to me)
} | ||
env_field!( | ||
self.link, | ||
std::env::var("CARGO_NEAR_REPO_LINK_HINT").or(std::env::var("CARGO_PKG_REPOSITORY")) |
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.
Instead of CARGO_NEAR_*
prefix, I would use NEP330_
prefix with the matching names of the fields:
NEP330_VERSION
NEP330_LINK
NEP330_BUILD_INFO_BUILD_ENVIRONMENT
...
This way we won't depend on cargo-near implementation detail. In this case, the naming should be dictated by near-sdk-rs.
a34e7ef
to
9ff44ca
Compare
No description provided.