* chore: use workspace inheritance for package info
* add rust-version field into workspace package
* .workspace = true
---------
Co-authored-by: James Wilson <james@jsdw.me>
* feat!: Allow for remapping type parameters in type substitutions
* chore: cargo fmt
* chore: cargo clippy
* chore: Remove some old code
* a little tidy
* address comment nit
Co-authored-by: James Wilson <james@jsdw.me>
* begin porting over traits; remove Config use of Hash
* port over the Header bits that we need
* sp_core_hashing where possible, move Verify to PairSigner, remove unused errors
* tidy up Config things and move related bits into one place
* fix codegen
* copy Era over
* move AccountId, Address, Signer to Signer trait and a pass over fixing examples
* impl MultiAddress, MultiSignature, AccountId32 and add back to Config (for decoding later)
* Copy over StorageKey, StorageData, StorageChangeSet
* subxt core compiling with no sp_core or sp_runtime
* Get examples compiling
* pass over fixing tests
* cargo fmt
* clippy tweaks and update polkadot.rs
* fix codegen docs
* port over special DigestItem encoding/decoding
* clippy and doc fixes
* cargo fmt and example fix
* more cargo fmt-ing...
* substrate-extra to substrate-compat
* cargo.toml comments
* simplify PairSigner trait bounds
* move RPC types to a separate file
* fix docs
* Add some tests for things and other PR feedback
* bump to latest sp deps
* avoid needing substrate-compat feature in a test
* refactor: Simplify collecting type substitutes
* Simplify ItemMod::from
* Preserve inner Rust items when expanding the subxt::subxt macro
* No named lifetimes
* Update codegen/src/api/mod.rs
Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Move passing UI tests under `ui_tests`
Co-authored-by: Andrew Jones <ascjones@gmail.com>
* get started
* make it work again
* make it compile again
* Use async-wasm-feature of jsonrpsee from the master branch
* Ensure we enable JS feature of getrandom for the wasm target
* Update subxt/src/lib.rs
* update jsonrpsee
* fix CI
* cargo fmt
* fix wasm test
* fix grumbles
* exclude wasm-tests from workspace
To avoid leaking `jsonrpsee-web` feature into the workspace
Co-authored-by: Igor Matuszewski <xanewok@gmail.com>
* Allow metadata to be pulled directly from a node with runtime_metadata_url
* Update docs
* https too, and abstract out block_on fn
* tweak a comment in the example
* 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
* 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>
* metadata: Exclude `field::type_name` from metadata validation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Adjust code-base to rust `1.62.0`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Composite fields docs
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Propagate docs for Event type
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Propagate docs for calls module
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 `TypeDefGenKind::Enum` kind
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Update polkadot.rs
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen/tests: Recursively obtain raw metadata documentation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen/tests: Generate runtime interface from node metadata
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen/tests: Obtain documentation from generated runtime API
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen/tests: Match raw documentation with the generated one
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Revert not longer needed "codegen: Composite fields docs"
This reverts commit 5460bbafc6262ac4f53e11d4ef11e44e1ce8296f.
* codegen/tests: Improve test regex documentation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Add integration-tests feature flag
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Guard integration tests under feature flag
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* test-runtime: Place build.rs under feature flag
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Pass `integration-tests` feature to `test-runtime`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* CI: Use `integration-tests` feature to run all tests
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Rely on `#[cfg(feature = "integration-tests")]` for integration
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt/metadata: Manually construct test metadata
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* artifacts: Move scale binary blob to dedicated folder
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* examples: Update path to metadata blob
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Rely on artifact metadata blob for benches
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Remove `test-runtime` dependency
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* examples: Modify runtime path for `custom_type_derives`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Remove tests folder
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* test-runtime: Remove `integration-tests` feature flag
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* integration-tests: Add an integration test crate for subxt
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Remove `test-runtime` dependency
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Add comment for feature flags
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* integration-tests: Trim dependencies
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* integration-tests: Move dependencies under dev
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Revert "CI: Use `integration-tests` feature to run all tests"
This reverts commit 8e5f38ba8c633ac40420fadf58700ac402f762d4.
* codegen: Move documentation test to integration crate
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen_documentation: Add license + fmt
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update `polkadot.rs`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Move test under `testing` folder
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update testing/integration-tests/src/codegen/codegen_documentation.rs
Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com>
Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com>
* 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>