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

Fix workflows and improve docs #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:
# If new code is pushed to a PR branch, then cancel in progress workflows for
# that PR. Ensures that we don't waste CI time, and returns results quicker.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -77,4 +77,3 @@ jobs:
uses: actions/checkout@v4
- name: Check spelling of files in the workspace
uses: crate-ci/[email protected]

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
# If new code is pushed to a PR branch, then cancel in progress workflows for
# that PR. Ensures that we don't waste CI time, and returns results quicker.
concurrency:
group: ci-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
Expand Down
86 changes: 43 additions & 43 deletions procedural/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ mod models;
mod runtime_apis;

/// Construct runtime macro wrapper
/// This macro allows to construct runtime operating with abstractions as long as with pallets.
/// It allows you omit the pallet indexes -- they will be assigned in ascending order.
/// This API may change in future releases, it is not yet stabilised.
///
/// This macro allows to construct your runtime using abstractions and/or vanilla pallets.
/// It allows you to omit the pallet indexes -- they will be assigned automatically in ascending order.
/// This macro is in very early stages of development, expect breaking changes.
///
/// Example:
/// ```
/// #[openzeppelin_construct_runtime]
Expand All @@ -20,9 +20,9 @@ mod runtime_apis;
/// type Pallet = pallet_crate; // It mimics the second version of construct runtime macro, but without the pallet_index assignment
/// }
/// ```
///
///
/// Supported abstractions and pallets inside them:
/// * `System`:
/// * `System`:
/// * `frame_system`
/// * `pallet_timestamp`
/// * `parachain_info`
Expand Down Expand Up @@ -51,15 +51,15 @@ mod runtime_apis;
/// * `pallet_whitelist`
/// * `pallet_custom_origins`
/// * `pallet_referenda`
/// * `XCM`
/// * `XCM`
/// * `pallet_message_queue`
/// * `cumulus_pallet_xcmp_queue`
/// * `pallet_xcm`
/// * `cumulus_pallet_xcm`
/// * `pallet_xcm_weight_trader`
/// * `orml_xtokens`
/// * `pallet_xcm_transactor`
/// * `EVM`
/// * `EVM`
/// * `pallet_ethereum`
/// * `pallet_evm`
/// * `pallet_base_fee`
Expand All @@ -71,58 +71,32 @@ pub fn openzeppelin_construct_runtime(_: TokenStream, tokens: TokenStream) -> To
}

/// Runtime API macro wrapper
/// This macro wraps the `impl_runtime_api` macro and provides our implementations of them.
/// This macro wraps the `impl_runtime_api` macro and provides a simpler interface.
/// It also works in the same groupings as our abstractions pallets and to get the runtime API implementations you only need to provide some types.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@KitHat I wasn't able to understand this phrase. Can you try to make it a bit clearer?

Copy link
Member

Choose a reason for hiding this comment

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

I meant that this macro provides our implementations of runtime apis

///
///
/// Example:
/// ```
/// #[openzeppelin_runtime_apis]
/// mod apis {
/// // these types should be present and required for all abstractions
/// // runtime generated by construct_runtime
/// type Runtime = Runtime;
/// // block type
/// // block type
/// type Block = Block;
///
///
/// #[abstraction]
/// mod assets {
/// type TransactionPayment = TransactionPayment;
/// type RuntimeCall = RuntimeCall;
/// type Balance = Balance;
/// }
///
/// // Any impl block can also go there, it will be ported to the `impl_runtime_api!`
///
/// // Any impl block can also go here, it will be ported to the `impl_runtime_api!`
/// }
/// ```
///
///
/// Supported abstractions:
/// * `EVM`
/// * Implemented APIs:
/// * `fp_rpc::EthereumRuntimeRPCApi`
/// * `fp_rpc::ConvertTransactionRuntimeApi`
/// * Required Types:
/// * `RuntimeCall` -- runtime call generated by `construct_runtime` macro
/// * `Executive` -- `frame_executive::Executive` specification used by parachain system
/// * `Ethereum` -- `pallet_ethereum` pallet struct generated by `construct_runtime` macro
/// * `assets`
/// * Implemented APIs:
/// * `pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi`
/// * `pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi`
/// * Required Types:
/// * `TransactionPayment` -- `pallet_transaction_payment` struct pallet generated by `construct_runtime` macro
/// * `RuntimeCall` -- runtime call generated by `construct_runtime` macro
/// * `Balance` -- type used for balance specification (e.g. in `pallet_balances` config)
/// * `consensus`
/// * Implemented APIs:
/// * `sp_consensus_aura::AuraApi`
/// * `sp_session::SessionKeys`
/// * `cumulus_primitives_aura::AuraUnincludedSegmentApi` (if `async-backing` feature is enabled)
/// * Required Types:
/// * `SessionKeys` -- struct generated by `impl_opaque_keys` macro
/// * `Aura` -- `pallet_aura` struct pallet generated by `construct_runtime` macro (only if `async-backing` feature is not enabled)
/// * `SlotDuration` -- constant that is use for slot duration definition (only if `async-backing` feature is enabled)
/// * `ConsensusHook` -- type that is used in `cumulus_pallet_parachain_system::Config::ConsensusHook` (only if `async-backing` feature is enabled)
/// * `system`
/// * `System`
/// * Implemented APIs:
/// * `sp_api::Core`
/// * `sp_api::Metadata`
Expand All @@ -142,7 +116,33 @@ pub fn openzeppelin_construct_runtime(_: TokenStream, tokens: TokenStream) -> To
/// * `Nonce` -- nonce type that was specified in `frame_system::Config`
/// * `RuntimeGenesisConfig` -- type generated by `construct_runtime` macro.
/// * `RuntimeBlockWeights` -- type implementing `Get<BlockWeights>`, often built by `BlockWeights::builder`
/// * `benchmarks`
/// * `Consensus`
/// * Implemented APIs:
/// * `sp_consensus_aura::AuraApi`
/// * `sp_session::SessionKeys`
/// * `cumulus_primitives_aura::AuraUnincludedSegmentApi` (if `async-backing` feature is enabled)
/// * Required Types:
/// * `SessionKeys` -- struct generated by `impl_opaque_keys` macro
/// * `Aura` -- `pallet_aura` struct pallet generated by `construct_runtime` macro (only if `async-backing` feature is not enabled)
/// * `SlotDuration` -- constant that is used for slot duration definition (only if `async-backing` feature is enabled)
/// * `ConsensusHook` -- type that is used in `cumulus_pallet_parachain_system::Config::ConsensusHook` (only if `async-backing` feature is enabled)
/// * `Assets`
/// * Implemented APIs:
/// * `pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi`
/// * `pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi`
/// * Required Types:
/// * `TransactionPayment` -- `pallet_transaction_payment` struct pallet generated by `construct_runtime` macro
/// * `RuntimeCall` -- runtime call generated by `construct_runtime` macro
/// * `Balance` -- type used for balance specification (e.g. in `pallet_balances` config)
/// * `EVM`
/// * Implemented APIs:
/// * `fp_rpc::EthereumRuntimeRPCApi`
/// * `fp_rpc::ConvertTransactionRuntimeApi`
/// * Required Types:
/// * `RuntimeCall` -- runtime call generated by `construct_runtime` macro
/// * `Executive` -- `frame_executive::Executive` specification used by parachain system
/// * `Ethereum` -- `pallet_ethereum` pallet struct generated by `construct_runtime` macro
/// * `Benchmarks`
/// * Implemented APIs:
/// * `frame_benchmarking::Benchmark` (under `runtime-benchmarks` feature)
/// * Required Types:
Expand Down