Skip to content
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 #[ink(default)] attribute for constructors and messages #1724

Merged
merged 9 commits into from
Apr 15, 2023

Conversation

kziemianek
Copy link
Contributor

@kziemianek kziemianek commented Mar 20, 2023

Adds default attribute for constructors and messages.
default attribute is reflected in metadata so consuming services can for example determine which constructor/message should be selected by default.

#1703

@kziemianek
Copy link
Contributor Author

@HCastano i see you are takinkg a 👀 at this PR. A lot checks have failed because of:

fatal: unable to access 'https://gitlab.parity.io/parity/mirrors/ink.git/': Failed to connect to gitlab.parity.io port 443 after 130941 ms: Operation timed out

It seems like a one time issue, do you have permission to retry checks ?

Copy link
Collaborator

@cmichi cmichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Can you create the follow-up issues as mentioned in #1703?

Copy link
Contributor

@HCastano HCastano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks!

@@ -498,6 +525,8 @@ pub struct MessageSpec<F: Form = MetaForm> {
return_type: ReturnTypeSpec<F>,
/// The message documentation.
docs: Vec<F::String>,
/// If the message is default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// If the message is default
/// If the message is the default for off-chain consumers (e.g UIs).

@@ -275,6 +283,8 @@ pub struct ConstructorSpec<F: Form = MetaForm> {
pub return_type: ReturnTypeSpec<F>,
/// The deployment handler documentation.
pub docs: Vec<F::String>,
/// If the constructor is default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// If the constructor is default
/// If the constructor is the default for off-chain consumers (e.g UIs).

crates/metadata/src/specs.rs Outdated Show resolved Hide resolved
crates/metadata/src/specs.rs Outdated Show resolved Hide resolved
@HCastano HCastano changed the title default attribute for constructors and messages Add #[ink(default)] attribute for constructors and messages Apr 12, 2023
@kziemianek
Copy link
Contributor Author

Thank you! Can you create the follow-up issues as mentioned in #1703?

Yes, I was waiting for approval before moving to downstream projects.

@HCastano HCastano merged commit b4fff41 into use-ink:master Apr 15, 2023
@cmichi cmichi mentioned this pull request Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants