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

Polkadot: ink! 5.0 #1632

Merged
merged 18 commits into from
Apr 3, 2024
Merged

Polkadot: ink! 5.0 #1632

merged 18 commits into from
Apr 3, 2024

Conversation

xermicus
Copy link
Contributor

@xermicus xermicus commented Mar 28, 2024

Upgrade Solang to be compatible with ink! v5.0 .

  • Simplify events
  • Latest substrate node on CI
  • Update tests and docs

xermicus and others added 11 commits March 28, 2024 18:32
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: xermicus <cyrill@parity.io>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
…oded value or the hash of it if its encoded length exceeds 32 bytes

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
@xermicus xermicus marked this pull request as ready for review April 3, 2024 07:17
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.57%. Comparing base (5764e01) to head (7296b16).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1632      +/-   ##
==========================================
- Coverage   88.58%   88.57%   -0.01%     
==========================================
  Files         150      150              
  Lines       69330    69285      -45     
==========================================
- Hits        61415    61370      -45     
  Misses       7915     7915              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/language/events.rst Outdated Show resolved Hide resolved
contract-metadata = "3.0.1"
contract-transcode = "3.0.1"
contract-metadata = "4.0.2"
contract-transcode = "4.0.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it would be nice to upgrade contract-metadata in the top-level Cargo.toml too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do agree but we had to keep those tests out of the workspace for some reason I can't remember

Comment on lines +487 to +488
.collect::<std::collections::HashMap<&str, EventSpec<PortableForm>>>()
.drain()
Copy link
Contributor

Choose a reason for hiding this comment

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

does not seem the most efficient way but nevermind

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well we need to keep unique signatures only (for anonymous events we don't even calculate the topic hash), so this is just the naive but easy to maintain implementation :D It should be fine as there are only so many events per contract anyways so most likely not worth to optimize here :)

Signed-off-by: xermicus <cyrill@parity.io>
@xermicus xermicus merged commit 28c86b3 into hyperledger:main Apr 3, 2024
11 checks passed
xermicus added a commit to xermicus/solang that referenced this pull request Apr 11, 2024
…yperledger#1632: The ABI encoder panics when trying to encoding no arguments. Previously, events always contained at least a single byte of data (empty events would have the discriminant/index of the event enum). However now, the data field for empty events is actually empty. So in codegen we check if we have to encode data first and pass a pointer to an empty buffer if not.

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
xermicus added a commit that referenced this pull request Apr 12, 2024
Slight oversight from #1632: Previously, events always contained at least a
single byte of data (empty events would have the discriminant/index of
the event enum). However now, the data field for empty events is
actually empty, leading the ABI encoder to panic. So in codegen we check if we
have to encode data first and pass a pointer to an empty buffer if not.
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

4 participants