-
Notifications
You must be signed in to change notification settings - Fork 361
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
contract metadata v5 #5594
contract metadata v5 #5594
Conversation
* support for constructor and message default attribute
I'm not sure if this should go to v4 or v5, finally I've decided to create v5. |
selector: 'ContractSelector', | ||
mutates: 'bool', | ||
payable: 'bool', | ||
default: 'bool', |
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 not quite correct - we cannot introduce fields retrospectively to existing versions. In V3 “default” was not available, it is only there from V5+ (Same applies to the V4 preceding it).
Each Vx
mapping should accurately reflect the structure of the fields at that point in time.
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.
Ok, thank you. I wasn't certain about versioning here.
Would something like this be ok ?
ContractMessageSpecV3: 'ContractMessageSpecV2',
ContractMessageSpecV4: 'ContractMessageSpecV2',
ContractMessageSpecV5: {
label: 'Text',
selector: 'ContractSelector',
mutates: 'bool',
payable: 'bool',
default: 'bool',
args: 'Vec<ContractMessageParamSpecV2>',
returnType: 'Option<ContractTypeSpec>',
docs: 'Vec<Text>'
},
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.
@jacogr what do you think about my proposition? If it's still not correct, I kindly ask you to explicitly point how to name these types 🙃
Would it be smart to adapt the pr to include this change from ink 4.2.0 as well? Otherwise we bump the metadata type version yet again in a short amount of time. 🤔 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Constructor and message metadata is going to contain new attribute named
default
. The main reason behind adding it is to allow UIs (ex.contracts-ui
) determine which one constructor/message should be selected as default in lists.This is follow-up pull request to use-ink/ink#1703