Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

PR on top of PR: kiz frame api #14410

Closed

Conversation

gui1117
Copy link
Contributor

@gui1117 gui1117 commented Jun 17, 2023

on top of #14137
cc @kianenigma

with this PR pallet-example-basic compiles without frame_benchmarking, frame_system and frame_support dependency.

Code is not well written, but this is enough for ensuring that it works

For the construct_runtime/tt_default_parts, I reverted the change so that path to frame_support to passed along.
For the benchmarking macro, only system crate needed to be abstracted

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable-int
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3014555

@gui1117 gui1117 changed the title PR on top of PR: kiz frame api partial PR on top of PR: kiz frame api Jun 17, 2023
Copy link
Contributor

@sam0x17 sam0x17 left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

have some further suggestions, bit happy to merge as is for improving tt_call stuff, and making frame benchmarking macros work with frame-api.

frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../../benchmarking" }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" }
frame = { version = "0.0.1-dev", default-features = false, path = "../../../frame/" }
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are coming this far, should we refactor the whole example to also not use sp-* as well? everything should be re-exported from frame.

Or else, we can leave pallet-example-basic as is for now, and add benchmarking to pallet-example-frame-api.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or else, we can leave pallet-example-basic as is for now, and add benchmarking to pallet-example-frame-api.

maybe it is better to leave pallet-example-basic as is for now, I used it only as a tests, if we move basic example to frame we shouldn't use the re-export frame::deps so much also, it needs to be cleaned

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, then let's do all experiments in pallet-example-frame-api for now.

@@ -21,8 +21,8 @@
#![cfg(feature = "runtime-benchmarks")]

use crate::*;
use frame_benchmarking::v2::*;
use frame_system::RawOrigin;
use frame::deps::frame_benchmarking::v2::*;
Copy link
Contributor

Choose a reason for hiding this comment

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

would be good to have a benchmarking_prelude in frame crate now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I agree

@gui1117
Copy link
Contributor Author

gui1117 commented Jul 14, 2023

this PR was open as an example

@gui1117 gui1117 closed this Jul 14, 2023
@gui1117 gui1117 deleted the gui-kiz-frame-api-partial branch July 14, 2023 13:52
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 this pull request may close these issues.

4 participants