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

Metadata format for messages/constructors in a .contract bundle changed #4255

Closed
cmichi opened this issue Nov 23, 2021 · 6 comments · Fixed by #4289
Closed

Metadata format for messages/constructors in a .contract bundle changed #4255

cmichi opened this issue Nov 23, 2021 · 6 comments · Fixed by #4289

Comments

@cmichi
Copy link

cmichi commented Nov 23, 2021

The metadata supplied for a contract in the .contract bundle will change a bit.

Specifically the messages and constructors exposed by a contract were previously denoted with

"name": ["foo", "bar"]

Now they are instead denoted with

"label": "foo"

I've attached two files:

If you diff flipper.contract.new flipper.contract.old the changes are visible.

The PR on ink! side which does this is use-ink/ink#923, we will hold-off merging it until the UI supports these changes. I'll also create follow-up issues for ask! and Solang after the new format is supported.

@jacogr
Copy link
Member

jacogr commented Nov 23, 2021

We need a version bump somewhere so I can actually detect what I'm working with. It is impossible otherwise. I basically pass the parser a schema to follow, it is not manually generated. So can support either/or on a single version. If we do bump eg V1 to V2, it can be done with no issues.

(Case in-point, the rc.6 with the broken metadata that was pulled still gives me support issues which I'd rather not deal with - it detracts from getting stuff out the door)

@jacogr jacogr transferred this issue from polkadot-js/apps Nov 23, 2021
@cmichi
Copy link
Author

cmichi commented Nov 24, 2021

Thanks for the quick reply! And the issue transfer :-).

We've bumped the metadata version to V2 for those changes, I updated the flipper.contract.new.zip file in the description of this PR.

@jacogr
Copy link
Member

jacogr commented Nov 24, 2021

Brilliant. Will try to get support into the next API release (Monday), depending on other chaos.

@jacogr
Copy link
Member

jacogr commented Dec 7, 2021

Do you maybe have an example with events? I am assuming it also has the label change, but would like to verify and add it to the tests as well.

@cmichi
Copy link
Author

cmichi commented Dec 7, 2021

Good point, I uploaded the erc20 here: erc20.contract.zip. It has some events.

Repository owner moved this from Todo to Done in Production Smart Contracts Parachain Dec 8, 2021
@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants