mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-22 05:37:58 +00:00
b8ee6a084fbeb2b3ec39a1ecaaad58a33c58ca8e
29 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b8ee6a084f |
Rebrand subxt to pezkuwi-subxt with pezsp_runtime support
- Renamed all crate names from subxt-* to pezkuwi-subxt-* - Updated codegen to use pezsp_runtime, pezsp_core, pezframe_support instead of sp_runtime, sp_core, frame_support - Replaced all internal references from subxt_* to pezkuwi_subxt_* - Added local path dependencies to Pezkuwi SDK crates - Updated workspace configuration for edition 2024 |
||
|
|
7de8d36806 |
Prep to release v0.42.0 (#2003)
* Prep to release v0.42.0 * Remove test_context reference from example * standalone_crate for doc tests because codegen is expensive * fmt |
||
|
|
23c62f3d5d |
Update to 2024 edition (#2001)
* Update to 2024 edition * Update to 2024 edition; fmt, use<> and remove refs * async functions |
||
|
|
396762510a |
update copyright year (#1924)
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> |
||
|
|
ac606cf625 |
Rename traits to remove T suffix (#1535)
* Rename traits to renmove T suffix * Fix doc links * Fix straggler doc links |
||
|
|
1e111ea9db |
Make subxt-core ready for publishing (#1508)
* Move Extrinsic decoding things to subxt_core and various tidy-ups * A couple more fixes and fmt * first pass moving tx logic to subxt_core * cargo fmt * fix wasm example * clippy * more clippy * WIP Adding examples and such * Move storage functionality more fully to subxt_core and nice examples for storage and txs * Add example for events * consistify how addresses/payloads are exposed in subxt-core and add runtime API fns * Add runtime API core example * fmt * remove scale-info patch * Add a little to the top level docs * swap args around * clippy * cargo fmt and fix wasm-example * doc fixes * no-std-ise new subxt-core additions * alloc, not core * more no-std fixes * A couple more fixes * Add back extrinsic decode test |
||
|
|
a0cb14aa4f |
subxt-core crate (#1466)
* start migrating, broken * first iteration of updating * fmt and clippy * add Composite<u32> decoding via scale value patch * bump scale type gen versions * fix decoding with new scale decode * compiling with changed deps * core utils, condig, client, metadata * core crate compiling * signer crate no once lock * add core to no-std-tests, change imports * broken commit, start pulling everything together in subxt * port more things to subxt * events in core crate, extrinsics sadly much more difficult * almost all examples pass again * dynamic values fix in examples * fix no std issue and fmt * remove unused dependencies * fix lightclient impl * runtime version refactor * formatting and addressing nits * more comments addressed * update wasm example and no-std-signer tests * other nits and error impl on signer errors * fix feature flag * fix runtime version refactor * fix doc links * fix integration tests * fix feature flag gated client state * fix native feature in CI * fix lightclient utils * make imports more lean in subxt-core * integrate changes from subxt-core imports into subxt * other changes in subxt simplify imports more * fix and docs * doc false for cli * fix clippy * remove events block hash in tests * codegen no-std support in generated code * export alloc crate for no-std codegen * fix doc test * implement James comments * remove std traits, use core traits instead * address nits * remove unusued dep in no-std tests * fix Box import in no_std * sp-crypto-hashing instead of sp-core-hashing * bump scale-typegen, add no std codegen tests * fix some things * replace unmaintained derivative with derive_where to remove non-canonical warnings * fmt * remove unused dep * fix deps * update artifacts to fix type ID mismatches * bump to latest scale-typegen --------- Co-authored-by: James Wilson <james@jsdw.me> |
||
|
|
fc5a18aaa0 |
Use scale-typegen as a backend for the codegen (#1260)
* integrate scale-typegen, remove types mod * reintroduce default substitutes and derives * support runtime_types only again * generating polkadot.rs ok * update scale-typegen to discrete error types * scale-typegen-api-changes * add note about UncheckedExtrinsic in default substitutes * add resursive attributes and derives * adjust example where Clone bound recursive * move scale-typegen dependency to workspace * expose default typegen settings * lightclient: Fix wasm socket closure called after being dropped (#1289) * lightclient: Close wasm socket while dropping from connecting state Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Construct one time only closures Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * testing: Enable console logs for lightclient WASM testing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Separate wakes and check connectivity on poll_read Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Close the socket depending on internal state Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Revert "lightclient: Separate wakes and check connectivity on poll_read" This reverts commit 866094001d4c0b119a80ed681a74b323f74eae1b. * lightclient: Return pending if socket is opening from poll_read Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Close the socket on `poll_close` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Reset closures on Drop to avoid recursive invokation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Close the socket if not already closing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * workflows: Install rustup component for building substrate (#1295) Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Command to fetch chainSpec and optimise its size (#1278) * cli: Add chainSpec command Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli/chainSpec: Move to dedicated module Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Compute the state root hash Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Remove code substitutes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * artifacts: Update polkadot.json Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * scripts: Generate the chain spec Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Remove testing artifacts Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Apply rustfmt Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Introduce feature flag for smoldot dependency Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Rename chain-spec to chain-spec-pruning Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * scripts: Update chain-spec command Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * remove comments and unused args * Update substrate- and signer-related dependencies (#1297) * update crypto dependencies, adjust keypair * add scale_info::TypeInfo derive in some places * add multi signature derive * fix lock file * fix lock file again :| * adjust to new interface in scale-typegen * use released scale typegen * reintroduce type aliases * introduce type aliases again using scale-typegen * cargo fmt and clippy * reconcile changes with master branch * update polkadot.rs * bump scale-typgen to fix substitution * implemented Alex suggestions, regenerated polkadot.rs (did not change) * resolve conflicts in Cargo.lock * make expect messages more clear * correct typos --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> |
||
|
|
2b21f8dc8c |
Tidy subxt-codegen crate interface (#1225)
* first pass tidying codegen crate interface * fix a codegen test * macro: keep error spans * clippy * fix doc example * removecommented-out code |
||
|
|
91a56fd580 |
Apply cargo fmt (#1146)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> |
||
|
|
b9f5419095 |
Introduce Metadata type (#974)
* WIP new Metadata type * Finish basic Metadata impl inc hashing and validation * remove caching from metadata; can add that higher up * remove caches * update retain to use Metadata * clippy fixes * update codegen to use Metadata * clippy * WIP fixing subxt lib * WIP fixing tests, rebuild artifacts, fix OrderedMap::retain * get --all-targets compiling * move DispatchError type lookup back to being optional * cargo clippy * fix docs * re-use VariantIndex to get variants * add docs and enforce docs on metadata crate * fix docs * add test and fix docs * cargo fmt * address review comments * update lockfiles * ExactSizeIter so we can ask for len() of things (and hopefully soon is_empty() |
||
|
|
59d195d4ad |
metadata: Use v15 internally (#912)
* Update frame-metadata to v15.1.0 Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Enable V15 unstable metadata in frame-metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Move validation hashing to dedicated file Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Use sp-metadata-ir from substrate to work with metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Revert using sp-metadata-ir in favor of conversion to v15 Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Convert v14 to v15 Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Use v15 for validation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Use v15 for codegen Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/bench: Use v15 Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Adjust to v15 metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Adjust testing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Improve documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * force CI Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Address feedback Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Use HASH_LEN Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadta: Remove `LatestRuntimeMetadata` type alias Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Remove `metadata_to_latest` to avoid pancis Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> |
||
|
|
c08eb6c8f1 |
Update scale-info to 2.5.0 (#896)
* Upodate scale-info to 2.5.0 * A couple more clippy fixes * more deprecation things that appeared |
||
|
|
a2b8dde5e6 |
Add 'Static' type and improve type substitution codegen to accept it (#886)
* Add Static type which defers to Encode/Decode and impls EncodeAsType/DecodeAsType * rename to static_type and impl Deref/Mut * Improve type substitution in codegen so that concrete types can be swapped in * A couple of comment tweaks and no need for a macro export * Extend type substitution logic to work recursively on destination type * cargo fmt * Fix a couple of comments * update ui test outpuot * Add docs and missing_docs lint * Add test for replacing multiple of Ident * Update codegen/src/error.rs Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> * update copyright year and fix ui test * simplify another error --------- Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> |
||
|
|
7c252fccf7 | cargo fmt with stable defaults (#876) | ||
|
|
c63ff6ec6d |
Use scale-encode and scale-decode to encode and decode based on metadata (#842)
* WIP EncodeAsType and DecodeAsType * remove silly cli experiment code * Get things finally compiling with EncodeAsType and DecodeAsType * update codegen test and WrapperKeepOpaque proper impl (in case it shows up in codegen) * fix tests * accomodate scale-value changes * starting to migrate to EncodeAsType/DecodeAsType * static event decoding and tx encoding to use DecodeAsFields/EncodeAsFields * some tidy up and add decode(skip) attrs where needed * fix root event decoding * #[codec(skip)] will do, and combine map_key stuff into storage_address since it's all specific to that * fmt and clippy * update Cargo.lock * remove patched scale-encode * bump scale-encode to 0.1 and remove unused dep in testing crate * update deps and use released scale-decode * update scale-value to latest to remove git branch * Apply suggestions from code review Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> * remove sorting in derives/attr generation; spit them out in order given * re-add derive sorting; it's a hashmap * StaticTxPayload and DynamicTxPayload rolled into single Payload struct * StaticStorageAddress and DynamicStorageAddress into single Address struct * Fix storage address byte retrieval * StaticConstantAddress and DynamicConstantAddress => Address * Simplify storage codegen to fix test * Add comments * Alias to RuntimeEvent rather than making another, and prep for substituting call type * remove unnecessary clone * Fix docs and failing UI test * root_bytes -> to_root_bytes * document error case in StorageClient::address_bytes() --------- Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> |
||
|
|
a7b45ef1d1 |
codegen: Add codegen error (#841)
* codegen: Add codegen error Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Use codegen error instead of aborts Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Remove `proc-macro-error` dependency Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * macro/subxt: Transform codegen error into compile_error! Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Pretty printing for `CodegenError` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update cargo.lock Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Adjust testing for codegen error Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Fix documentation example Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Export `CodegenError` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Use collect::<Result<_>, _>() Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Adjust comment regarding error printing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Improve error messages Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> |
||
|
|
5320ca9d55 |
codegen: Opt out of documentation (#843)
* codegen: Opt-out for API documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Add `--no-docs` flag Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Check no documentation was generated Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update cargo.lock Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Adjust testing for the new codegen API Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * macro: Ensure `subxt` macro does not contain documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * macro: Expose documentation flag Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * expose_documentation => generate_docs --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: James Wilson <james@jsdw.me> |
||
|
|
f115ff975c |
Allow specifying the subxt crate path for generated code (#664)
* Allow specifying the `subxt` crate path for generated code * Make `clippy` happy * Add documentation * Improve optics * Remove custom crate path test * Implement comments * Update comment * Make `crate_path` property instead of argument * Remove unnecessary derives * Remove `Default` impls in favor of explicit constructors * Remove unnecessary `into` * Update codegen/src/types/mod.rs Co-authored-by: Andrew Jones <ascjones@gmail.com> Co-authored-by: Andrew Jones <ascjones@gmail.com> |
||
|
|
3bf7ddc18c |
Fix codegen for codec::Compact as type parameters (#651)
* Add failing test for compact generic parameter * WIP refactor type generation * Fmt * Remove deprecated rustfmt optionns * Remove license template path * Update parent type parameter visitor * Introduce different methods for generating a type path for a field * Add comment * Fix weights refs * Add extra compact test cases * Fmt |
||
|
|
e48f0e3b1d |
Rework Subxt API to support offline and dynamic transactions (#593)
* WIP API changes * debug impls * Get main crate compiling with first round of changes * Some tidy up * Add WithExtrinsicParams, and have SubstrateConfig + PolkadotConfig, not DefaultConfig * move transaction into extrinsic folder * Add runtime updates back to OnlineClient * rework to be 'client first' to fit better with storage + events * add support for events to Client * tidy dupe trait bound * Wire storage into client, but need to remove static reliance * various tidy up and start stripping codegen to remove bits we dont need now * First pass updating calls and constants codegen * WIP storage client updates * First pass migrated runtime storage over to new format * pass over codegen to generate StorageAddresses and throw other stuff out * don't need a Call trait any more * shuffle things around a bit * Various proc_macro fixes to get 'cargo check' working * organise what's exposed from subxt * Get first example working; balance_transfer_with_params * get balance_transfer example compiling * get concurrent_storage_requests.rs example compiling * get fetch_all_accounts example compiling * get a bunch more of the examples compiling * almost get final example working; type mismatch to look into * wee tweaks * move StorageAddress to separate file * pass Defaultable/Iterable info to StorageAddress in codegen * fix storage validation ne, and partial run through example code * Remove static iteration and strip a generic param from everything * fix doc tests in subxt crate * update test utils and start fixing frame tests * fix frame staking tests * fix the rest of the test compile issues, Borrow on storage values * cargo fmt * remove extra logging during tests * Appease clippy and no more need for into_iter on events * cargo fmt * fix dryRun tests by waiting for blocks * wait for blocks instead of sleeping or other test hacks * cargo fmt * Fix doc links * Traitify StorageAddress * remove out-of-date doc comments * optimise decoding storage a little * cleanup tx stuff, trait for TxPayload, remove Err type param and decode at runtime * clippy fixes * fix doc links * fix doc example * constant address trait for consistency * fix a typo and remove EncodeWithMetadata stuff * Put EventDetails behind a proper interface and allow decoding into top level event, too * fix docs * tweak StorageAddress docs * re-export StorageAddress at root for consistency * fix clippy things * Add support for dynamic values * fix double encoding of storage map key after refactor * clippy fix * Fixes and add a dynamic usage example (needs new scale_value release) * bump scale_value version * cargo fmt * Tweak event bits * cargo fmt * Add a test and bump scale-value to 0.4.0 to support this * remove unnecessary vec from dynamic example * Various typo/grammar fixes Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> * Address PR nits * Undo accidental rename in changelog * Small PR nits/tidyups * fix tests; codegen change against latest substrate * tweak storage address util names * move error decoding to DecodeError and expose * impl some basic traits on the extrinsic param builder Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> |
||
|
|
c55b7ba3e3 | dual license (#590) | ||
|
|
e3732e354f |
Add subxt documentation (#546)
* Documentation for cli crate Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add documentation and simplify calls generation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add documentation and simplify events generation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add documentation and simplify constants generation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add documentation and simplify storage generation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add lib documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * macro: Remove `-f bytes` as this is the default Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/client: Add examples Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lib_doc: Add documentation to dedicated file Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Link documentation from file Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add more documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add Storage example Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Add rpc documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Add documentation for errors Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Add documentation for the `extrinsic` module Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Add documentation for `events` module Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add `Static Metadata Validation` section Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add `Runtime Updates` section Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix link to documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * readme: Remove hardcoded versions Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Move documentation to dedicated folder Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Spaces between examples Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * More details for `types_mod_ident` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Add note for RuntimeGenerator Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Address feedback Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update codegen/src/api/constants.rs Co-authored-by: James Wilson <james@jsdw.me> * Update subxt/src/lib.rs Co-authored-by: James Wilson <james@jsdw.me> * Update subxt/src/metadata/metadata_type.rs Co-authored-by: James Wilson <james@jsdw.me> * Update subxt/src/storage.rs Co-authored-by: James Wilson <james@jsdw.me> * Address feedback Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix cargo clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update call example Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Add example for fetching constants Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Link to examples in subxt.md Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update codegen/src/api/calls.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update codegen/src/api/calls.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update codegen/src/api/calls.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update codegen/src/api/constants.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update codegen/src/api/constants.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update codegen/src/api/storage.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update codegen/src/api/storage.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update codegen/src/api/storage.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update docs/subxt.md Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update docs/subxt.md Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update docs/subxt.md Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update docs/subxt.md Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update docs/subxt.md Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update subxt/src/extrinsic/mod.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update subxt/src/storage.rs Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> * Update documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update examples/examples/balance_transfer.rs Co-authored-by: James Wilson <james@jsdw.me> * Update subxt/src/extrinsic/mod.rs Co-authored-by: James Wilson <james@jsdw.me> * Update subxt/src/rpc.rs Co-authored-by: James Wilson <james@jsdw.me> * Update subxt/src/updates.rs Co-authored-by: James Wilson <james@jsdw.me> * Update docs example with `PolkadotExtrinsicParams` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Remove extrinsic extra documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Remove similar transfer example Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Apply cargo fmt Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: James Wilson <james@jsdw.me> Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com> |
||
|
|
115073a33d |
Subscribe to Runtime upgrades for proper extrinsic construction (#513)
* subxt: Add subscription to runtime upgrades Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Synchronize and expose inner `RuntimeVersion` of the `Client` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Add runtime update example Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Expose `RuntimeVersion` as locked Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Expose `Metadata` as locked Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/storage: Use locked metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Use parking lot RwLock variant for locked metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Utilize locked metadata variant Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/transaction: Use locked metadata variant Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update subxt to use locked version of the Metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add runtime update client wrapper Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Modify runtime update example Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix cargo check Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Keep consistency with cargo check fix Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Remove unnecessary Arc Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Remove MetadataInner and use parking_lot::RwLock Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update polkadot.rs generation comment Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Switch to async::Mutex Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Block executor while decoding dynamic events Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Use async API to handle async locking Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Remove unused dependencies Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update examples and integration-tests Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix test deadlock Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Revert back to sync lock Revert "Fix test deadlock" This reverts commit 4a79933df23e81573611cb14be6c5b5b2b56d4df. Revert "Update examples and integration-tests" This reverts commit 5423f6eb4131582909d5a4ca70adff75e27cdd0e. Revert "Remove unused dependencies" This reverts commit e8ecbabb5b01a7ba4ae83b8bde36295a3f64daf7. Revert "codegen: Use async API to handle async locking" This reverts commit ced4646541c431adcb973369b1061b7b3cbfaae1. Revert "subxt: Block executor while decoding dynamic events" This reverts commit 8b3ba4a5eabb29f77ac1ca671450956fc479a33d. Revert "subxt: Switch to async::Mutex" This reverts commit f5bde9b79394a6bf61b6b9daefc36ceaa84b82be. * subxt: Perform RuntimeVersion update before fetching metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Reintroduce MetadataInner * Use parking lot instead of std::RwLock Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Reduce lock metadata time when decoding events Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Update `validate_metdata` locking pattern Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/examples: Update polkadot download link Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Wrap metadata in a helper function Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update examples/examples/subscribe_runtime_updates.rs Co-authored-by: James Wilson <james@jsdw.me> * subxt/updates: Update runtime if version is different Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: James Wilson <james@jsdw.me> |
||
|
|
1fd1eee72a |
Static Metadata Validation (#478)
* metadata: Implement MetadataHashable for deterministic hashing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Hash `scale_info::Field` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Hash `scale_info::Variant` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Hash `scale_info::TypeDef` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Hash pallet metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Avoid data representation collision via unique identifiers Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Finalize hashing on recursive types Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Cache recursive calls Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Move `MetadataHashable` to codegen to avoid cyclic dependency Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add pallet unique hash Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Wrap metadata as owned Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Use MetadataHashable wrapper for clients Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Generate runtime pallet uid from metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Validate metadata compatibility at the pallet level Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Modify examples and tests for the new API Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Implement metadata uid Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update polkadot with TryFrom implementation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * client: Change `to_runtime_api` to reflect TryFrom changes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * client: Skip full metadata validation option Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add option to skip pallet validation for TransactionApi Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add option to skip pallet validation for StorageApi Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update polkadot.rs with ability to skip pallet validation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Change `MetadataHashable` to per function implementation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Use metadata hashes functions Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Use metadata hashes functions Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Make `get_type_uid` private Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen, subxt: Rename metadata functions `*_uid` to `*_hash` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Update `get_field_hash` to use `codec::Encode` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen, subxt: Move metadata check from client to subxt::Metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen, subxt: Rename metadata check functions to follow `*_hash` naming Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Update polkadot.rs to reflect naming changes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Use `encode_to` for metadata generation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Update polkadot.rs to reflect `encode_to` changes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Specific name for visited set Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Provide cache to hashing functions Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Compute metadata hash by sorted pallets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Get extrinsic hash Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Extend metadata hash with extrinsic and metadata type Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Add cache as metadata parameter Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen, subxt: Update metadata hash to use cache Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Implement Default trait for MetadataHasherCache Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Add cache for pallets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Move functionality to metadata crate Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen, subxt: Use subxt-metadata crate Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Remove metdata hashing functionality Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Add documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Fix vector capacity to include extrinisc and type hash Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Add empty CLI Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-cli: Fetch metadata from substrate nodes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-cli: Log metadata hashes of provided nodes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-cli: Group compatible nodes by metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-cli: Simplify hash map insertion Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-cli: Move full metadata check to function Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-cli: Group metadata validation at the pallet level Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Persist metadata cache Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Move compatibility cli from subxt-metadata to subxt-cli Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Remove cli from subxt-metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * cli: Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Fix compatible metadata when pallets are registered in different order Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Handle result of pallet hashing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Remove type cache for deterministic hashing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Add test assets from `substrate-node-template` tag `polkadot-v0.9.17` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-tests: Check cache hashing for Balances pallet Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Fix `get_type_hash` clippy issue Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-tests: Compare one time cache with persistent cache Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-test: Check metadata hash populates cache for pallets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-tests: Simplify `cache_deterministic_hash` test Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata-tests: Check deterministic metadata for different order pallets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Implement TransactionApiUnchecked for skipping pallet validation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Implement StorageApiUnchecked for skipping pallet validation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Remove skip_pallet_validation boolean Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Implement ClientUnchecked for skipping metadata validation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update examples of rpc_call to skip metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Remove heck dependency Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add pallet name as an identifier for pallet hashing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Implement MetadataHashDetails Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Adjust testing to `MetadataHashDetails` interface Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Remove extra `pallet_name` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Fix clippy issue Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Change StorageApi to support `_unchecked` methods Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Change TransactionApi to support `_unchecked` methods Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Switch back from `TryFrom` to `From` for `subxt::Client` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen, subxt: Remove `ClientUnchecked` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Expose `validate_metadata` as validation of compatibility method Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Update to the new interface Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update test integration to latest interface Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Check different pallet index order Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Check recursive type hashing Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Check recursive types registered in different order Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Fix recursive types warning Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Remove test assets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Extend tests to verify cached pallet values Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Add metadata compatiblity example Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Revert balance_transfer to initial form Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Add ConstantsApi metadata check Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Modify tests to accomodate ConstantsApi changes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Modify verified version Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Generate polkadot.rs from `0.9.18-4542a603cc-aarch64-macos` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Update polkadot_metadata.scale from `0.9.18-4542a603cc-aarch64-macos` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Update documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Modify default pallet usage Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Remove hex dependency Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Add MetadataTestType to capture complex types Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Update tests to use complex types Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Check metadata correctness via extending pallets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Extend pallet hash with Events Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Extend pallet hash with constants Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Extend pallet hash with error Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Extend metadata compatibiliy with StorageApi and ConstantsApi Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Modify comments and documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Benchmarks for full validation and pallet validation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/benches: Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Hash metadata just by inspecting the provided pallets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Make pallets generic over T for `AsRef<str>` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Expose the name of the pallets composing the metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/tests: Update polkadot.rs with pallets name Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Obtain metadata hash only by inspecting pallets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen,subxt: Extend the metadata hash to utilize just pallets Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/tests: Update polkadot.rs with client metadata has per pallet Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Test `get_metadata_per_pallet_hash` correctness Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/benches: Fix decode of metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * [static metadata] validate storage, calls and constants per call (#507) * validate storage, calls and constants per call * fix typo * cache per-thing hashing, move an Arc, remove some unused bits * create hash_cache to simplify metadata call/constant/storage caching * simplify/robustify the caching logic to help prevent mismatch between get and set * cargo fmt * Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * bench the per-call metadata functions * metadata: Add test for `node_template_runtime_variant` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * ensure criteron cli opts work * group benchmarks and avoid unwrap issues * metadata: Check template runtime for handling the pallet swap order case Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Remove debug logs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Optimise by removing field's name and type_name and type's path Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Refactor `get_type_hash` to break recursion earlier Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add tests for `hash_cache` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add tests for checking Metadata Inner cache Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Check semantic changes inside enum and struct fields Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Add enums named differently with compatible semantic meaning Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Guard testing of release versions for `node_template_runtime` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Improve documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata/tests: Manually construct type of `node_template_runtimeL::Call` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * no more special Call handling, avoid a little cloning, and actually sort by name * remove unused deps and fmt * RuntimeMetadataLastVersion => RuntimeMetadataV14 * remove a bunch of allocations in the metadata hashing, speed up from ~17ms to ~5ms * update release docs to release metadata crate too * subxt: Remove codegen dependency Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Replace std RwLock with parking_lot Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/tests: Add ws address to `TestNodeProcess` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/tests: Add metadata validation integration test Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Allow setting metadata on the ClientBuilder Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/tests: Check incompatible metadatas Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Fix constant hashing for deterministic output Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/tests: Check metadata validation for constants Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/tests: Test validation for calls Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/tests: Test validation for storage Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Expose `set_metadata` for testing only Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Guard metadata tests under integration-tests Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: James Wilson <james@jsdw.me> |
||
|
|
698f0242f3 |
Propagate documentation to runtime API (#511)
* codegen: Propagate documentation for Constants Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Propagate documentation for `CompositeDef` wrapper Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Propagate docs for enum variant of `CompositeDef` wrapper Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Propagate docs for Storage entries Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Move docs from internal structs to methods of StorageApi Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Propagate the same docs for storage iter variants Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * codegen: Move docs from call structs to methods of TransactionApi Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Update polkadot.rs Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> |
||
|
|
cc0b1ec84a |
Read constants from metadata at runtime (#494)
* Read constants from metadata at runtime * Update polkadot codegen * Update polkadot.rs * Update polkadot.rs |
||
|
|
4bed7eb716 |
Fix conversion of Call struct names to UpperCamelCase (#441)
* Fix conversion of `Call` struct names to UpperCamelCase * Update to latest heck and use ToUpperCamelCase |
||
|
|
5f5a7ef5f7 |
add constants api to codegen (#402)
* add constants api to codegen Signed-off-by: Gregory Hill <gregorydhill@outlook.com> * handle constant decoding error Signed-off-by: Gregory Hill <gregorydhill@outlook.com> * fix clippy and remove extra constants allocation Signed-off-by: Gregory Hill <gregorydhill@outlook.com> |