Skip to content

[pallet-revive] impl_revive_api macro#8652

Merged
pgherveou merged 11 commits intomasterfrom
pg/impl-runtime-macro
May 27, 2025
Merged

[pallet-revive] impl_revive_api macro#8652
pgherveou merged 11 commits intomasterfrom
pg/impl-runtime-macro

Conversation

@pgherveou
Copy link
Contributor

@pgherveou pgherveou commented May 26, 2025

Move pallet-revive runtime api implementation in a macro, so that we don't repeat the code for every runtime.

@pgherveou
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump patch

@pgherveou pgherveou added the T7-smart_contracts This PR/Issue is related to smart contracts. label May 26, 2025
Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

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

Dumb question: Instead of a macro, can't we just provide default implementations for the trait methods?

@pgherveou
Copy link
Contributor Author

Dumb question: Instead of a macro, can't we just provide default implementations for the trait methods?

I don't think that sp_api::decl_runtime_apis! accept it
You also need to access some concrete type from the runtime to implement it

@xermicus
Copy link
Member

xermicus commented May 26, 2025

Yeah I am not sure. You might be right. I just glanced at the first implementation which doesn't seem to have any generics in it's signature.

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/15254950229
Failed job name: test-linux-stable

@pgherveou
Copy link
Contributor Author

mmm compile but does not seem to work :/

Error: ErrorObject { code: ServerError(-32000), message: "RPC error: ErrorObject { code: ServerError(4003), message: \"Client error: Execution failed: Other: Exported method ReviveApi_balance is not found\", data: None }", data: None }

will check this out

@pgherveou
Copy link
Contributor Author

/cmd fmt

@athei
Copy link
Member

athei commented May 26, 2025

Yeah I am not sure. You might be right. I just glanced at the first implementation which doesn't seem to have any generics in it's signature.

What do you mean? Our RuntimeAPI need at least the Balance and AccountId which are generic.

@pgherveou pgherveou added this pull request to the merge queue May 27, 2025
Merged via the queue into master with commit 73a0bca May 27, 2025
184 checks passed
@pgherveou pgherveou deleted the pg/impl-runtime-macro branch May 27, 2025 11:41
pgherveou added a commit that referenced this pull request Jun 11, 2025
Move pallet-revive runtime api implementation in a macro, so that we
don't repeat the code for every runtime.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
fellowship-merge-bot bot pushed a commit to polkadot-fellows/runtimes that referenced this pull request Aug 7, 2025
This brings in `stable2506` Polkadot SDK, and integrates many new
features.

Integrated breaking changes to be verified by the original authors:

- [x] ~paritytech/polkadot-sdk#8127 @kianenigma
@Ank4n~
     This will come in with AHM, and not before.
- [x] paritytech/polkadot-sdk#7597 @gui1117 
- [x] paritytech/polkadot-sdk#8254 @bkchr 
- [x] paritytech/polkadot-sdk#7592 @bkontur 
- [x] paritytech/polkadot-sdk#8382
@UtkarshBhardwaj007
- [x] paritytech/polkadot-sdk#8021 @serban300 
- [x] paritytech/polkadot-sdk#8344 @serban300 
- [x] paritytech/polkadot-sdk#8262 @athei 
- [x] paritytech/polkadot-sdk#8584 @athei 
- [x] paritytech/polkadot-sdk#8299 @skunert
- [x] paritytech/polkadot-sdk#8652 @pgherveou 
- [x] paritytech/polkadot-sdk#8554 @pgherveou 
- [x] paritytech/polkadot-sdk#8281 @mrshiposha 
- [x] paritytech/polkadot-sdk#7730
@franciscoaguirre
- [x] paritytech/polkadot-sdk#8599 @yrong
@claravanstaden
- [x] paritytech/polkadot-sdk#8531 @bkontur 
- [x] paritytech/polkadot-sdk#8409 @kianenigma 
- [x] paritytech/polkadot-sdk#9137
@franciscoaguirre
- [x] paritytech/polkadot-sdk#7944 @bkontur 
- [x] paritytech/polkadot-sdk#8179 @bkontur 
- [x] paritytech/polkadot-sdk#8037 @yrong

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: claravanstaden <claravanstaden64@gmail.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Alain Brenzikofer <alain@integritee.network>
Co-authored-by: kianenigma <kian@parity.io>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: ron <yrong1997@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Overkillus <maciej.zyszkiewicz@parity.io>
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
Move pallet-revive runtime api implementation in a macro, so that we
don't repeat the code for every runtime.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T7-smart_contracts This PR/Issue is related to smart contracts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants