Skip to content

Commit

Permalink
Improve documentation (#449)
Browse files Browse the repository at this point in the history
* cli: Remove whitespaces from readme

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* cli: Fix typo

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Modify codegen path

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Remove rustfmt arguments

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* cli: Update Readme

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* examples: Fix typo

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Add Hash for WrapperKeepOpaque and PhantomDataSendSync

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
  • Loading branch information
lexnv authored Feb 14, 2022
1 parent b1b7173 commit 5c04b09
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ USAGE:
subxt <SUBCOMMAND>
FLAGS:
-h, --help
-h, --help
Prints help information
-V, --version
-V, --version
Prints version information
Expand All @@ -37,9 +37,9 @@ OPTIONS:

## Codegen

Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the the runtime API and types. Useful
for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility of customizing the
generated code if the macro does not produce the desired API. e.g.
Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the runtime API and types. Useful
for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility to customize the
generated code if the macro does not produce the desired API. e.g.

`subxt codegen | rustfmt --edition=2018 --emit=stdout`

Expand All @@ -48,10 +48,10 @@ USAGE:
subxt codegen [OPTIONS]
OPTIONS:
-f, --file <file>
-f, --file <file>
the path to the encoded metadata file
--url <url>
--url <url>
the url of the substrate node to query for metadata for codegen
```
Expand Down
4 changes: 2 additions & 2 deletions examples/examples/custom_type_derives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
runtime_metadata_path = "examples/polkadot_metadata.scale",
// We can add (certain) custom derives to the generated types by providing
// a comma separated list to the below attribute. Most useful for adding `Clone`.
// The derives that we can add ultiamtely is limited to the traits that the base
// The derives that we can add ultimately is limited to the traits that the base
// types relied upon by the codegen implement.
generated_type_derives = "Clone, PartialEq"
generated_type_derives = "Clone, PartialEq, Hash"
)]
pub mod polkadot {}

Expand Down
6 changes: 4 additions & 2 deletions subxt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ pub enum Phase {
Clone(bound = ""),
PartialEq(bound = ""),
Eq(bound = ""),
Default(bound = "")
Default(bound = ""),
Hash(bound = "")
)]
pub struct WrapperKeepOpaque<T> {
data: Vec<u8>,
Expand Down Expand Up @@ -223,7 +224,8 @@ impl<T: Decode> WrapperKeepOpaque<T> {
PartialEq(bound = ""),
Debug(bound = ""),
Eq(bound = ""),
Default(bound = "")
Default(bound = ""),
Hash(bound = "")
)]
#[scale_info(skip_type_params(T))]
#[doc(hidden)]
Expand Down
2 changes: 1 addition & 1 deletion subxt/tests/integration/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/// Generate by:
///
/// - run `polkadot --dev --tmp` node locally
/// - `cargo run --release -p subxt-cli -- codegen | rustfmt --edition=2018 --emit=stdout > tests/integration/codegen/polkadot.rs`
/// - `cargo run --release -p subxt-cli -- codegen | rustfmt > subxt/tests/integration/codegen/polkadot.rs`
#[rustfmt::skip]
#[allow(clippy::all)]
mod polkadot;

0 comments on commit 5c04b09

Please # to comment.