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

Move exampels to separate crate #371

Merged
merged 13 commits into from
Dec 15, 2022
Merged

Move exampels to separate crate #371

merged 13 commits into from
Dec 15, 2022

Conversation

haerdib
Copy link
Contributor

@haerdib haerdib commented Dec 14, 2022

This way, the examples don't need to inherit all the features of the api-client. They import the api-client with the necessary features. This serves as a better example on how to import and use the api-client.

@haerdib haerdib self-assigned this Dec 14, 2022
@haerdib haerdib changed the title move exampels to separate folder Move exampels to separate crate Dec 14, 2022
@haerdib haerdib marked this pull request as ready for review December 15, 2022 08:59
Copy link
Contributor

@echevrier echevrier left a comment

Choose a reason for hiding this comment

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

I don't like the repetition examples/examples. Instead we could regroup the examples:
examples/

  • compose_extrinsic/
  • events/
  • storage/
    ...

@haerdib
Copy link
Contributor Author

haerdib commented Dec 15, 2022

That sadly doesn't work because of cargo. To name the second example folder examples is necessary to mark them as examples. Otherwise, each examples would need to be defined in the .toml file as [[example]] (see https://doc.rust-lang.org/cargo/reference/cargo-targets.html#examples)

Copy link
Contributor

@echevrier echevrier left a comment

Choose a reason for hiding this comment

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

Then :)

Copy link
Collaborator

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

Nice, lgtm!

Comment on lines +16 to +25
frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
kitchensink-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
sp-core = { features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "master" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like that these deps no longer live in the root workspace.

@haerdib haerdib merged commit ca6b9ff into master Dec 15, 2022
@haerdib haerdib deleted the bh/make-examples-crate branch December 15, 2022 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants