* generate docs for feature-gated items on crates.io
* add newline in Cargo.toml
* unify newlines
* fix clippy
* introduce macros for features
* commit missing file
* Update subxt/src/lib.rs
* make it compile
* 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>
* codegen: Generate type alias for storage return types
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Generate type alias for call function arguments
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* testing: Update polkadot.rs code from commit 2e2a75ff81
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Type aliases for runtime API parameters
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Type alias for runtime apis output
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* storage: Change path of the aliased module
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Adjust module indentation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Do not alias for api::runtime_types with unresolved generics
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Fix and document runtime API alias generation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update artifacts
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update cargo.lock file
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Generate composite structs with alias unnamed fields
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* testing: Update polkadot.rs file
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Alias storage unnamed parameters
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update polkadot.rs
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* examples: Change polkadot to rococo runtime
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Fix compiling tests in the codegen crate
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Extend storage test with alias module
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cli/tests: Adjust exepcted commands to the latest metadata
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Remove missleading comment and docs
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Ensure unique names for generated runtime API types
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen/tests: Test expected runtime type generation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen/tests: Check duplicate params in runtime APIs
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen/tests: Test colliding names of type aliases and parameters
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Fix clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Separate alias module from struct definition
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update polkadot.rs
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* codegen: Remove outdated docs from composite def
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* subxt: Remove unstable lints that cause compile warnings
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cargo: Switch to workspace lints
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cargo: Fix codec package at root level
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cargo: Move profiles to the root level
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Fix lightclient and metadata crates
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Revert "cargo: Fix codec package at root level"
This reverts commit cdf9e1628d708a972673eb3a9e967b6896edbd73.
* Fix complexity clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cargo: Remove lints to be replaced by `cargo machete`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cargo: Remove unused dependencies (detected by machete)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* ci: Add machete step
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cargo: Bump rust version
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* ci: Rename machete step
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* ci: Rename cargo machete step
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* add web feature to subxt codegen
* add getrandom
* remove compile error
* metadata: Generate runtime outer enums if not present in V14 (#1174)
* metadata: Extend outer enum generation for V14
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Generate outer enums if not present
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Porpagate v14 error instead of panic
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Try to find `RuntimeCall` then `Call` enums
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Ensure the returned type is variant for outer enums
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Replace or with or_else
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Apply clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Return error and generate only `RuntimeError`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata: Remove modified path
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* metadata/tests: Check missing runtime types
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* add empty use of getrandom
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
* refactor: support default port in URL
Update jsonrpsee to v0.20 to support the default port number in URLs.
* fix nit, revert web feature
* fix lightclient code
* WIP updating to syn 2.0.0
* WIP darling compat
* Update darling and syn workspace deps
* NestedMeta::parse_meta_list
* Rename attribute keyword type property to path
* Fmt
* Update more type to path
* Unused darling
* Cargo.lock
* Add missing syn features
* Move all deps to workspace toml
* cargo fmt and codec 3.4, removing now unneeded 'full' feature
* add wasm-tests to workspace and fix subxt inheritng
* cargo fmt
* wasm-test thing can't be in workspace so revert that
* remove unwanted target dir from wasm-tests
* chore: use workspace inheritance for package info
* add rust-version field into workspace package
* .workspace = true
---------
Co-authored-by: James Wilson <james@jsdw.me>
* 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
* WIP implement custom derives per type
* WIP wiring up specific type derives
* Fmt
* Rename GeneratedTypeDerives to Derives
* Fmt
* Fix errors
* Fix test runtime
* Make derives appear in alphabetic order
* Clippy
* Add derive_for_type attribute to example
* Add docs to example
* Rename GeneratedTypeDerive
* Rename ty to type in attribute
* Update darling
* Update codegen/src/types/derives.rs
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
* Update codegen/src/types/mod.rs
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
* Update codegen/src/types/mod.rs
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
* review: update method name
* Add unit tests for combined derives
* Remove out of date docs
* Add macro usage docs
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>