Commit Graph

135 Commits

Author SHA1 Message Date
tadeohepperle ce8a00a39f Update Artifacts (auto-generated) 2024-04-22 00:20:21 +00:00
Alexandru Vasile 33a891b9da Stabilize transactionWatch methods (#1539)
* Stabilize transactionWatch

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

* Keep consistency in naming method class

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2024-04-20 14:31:05 +02:00
Alexandru Vasile c57df0845c Stabilize transactionBroadcast methods (#1540)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2024-04-20 13:58:58 +02:00
Alexandru Vasile c124e17336 Stabilize chainHead methods (#1538)
* Stabilize chainHead methods

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

* Rename fn snake case

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

* docs: Fix documentation

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-19 11:27:50 +02:00
James Wilson ac606cf625 Rename traits to remove T suffix (#1535)
* Rename traits to renmove T suffix

* Fix doc links

* Fix straggler doc links
2024-04-16 16:35:14 +01:00
James Wilson 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
2024-04-15 15:20:11 +01:00
Alexandru Vasile c07ee0cd7f storage_type: Strip key proper hash and entry bytes (32 instead of 16) (#1522)
* storage_type: Strip key proper hash and entry bytes (32 instead of 16)

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

* storage_type: Fix typo

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

* storage/tests: Check keys decode properly and don't cause errors

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

* Update testing/integration-tests/src/full_client/storage/mod.rs

Co-authored-by: James Wilson <james@jsdw.me>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>
2024-04-09 14:08:36 +03:00
Alexandru Vasile b31131d21d testing: Prepare light client testing with substrate binary and add subxt-test macro (#1507)
* testing: Add long running light client flag and cfg aliases

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

* testing: Expose clients depending on feature flags

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

* subxt: Use unstable backend for light client

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

* testing: Disable flaky lightclient tests

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

* ci: Add long runnnig step

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

* Revert "subxt: Use unstable backend for light client"

This reverts commit ea6f3cc58b.

* ci: Long running tests for 60 mins

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

* ci: Use 16 cores for light-client testing

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

* ci: Isolate light-client testing to save CI minutes

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

* testing: Retry on Tx::Dropped for lightclinet only

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

* testing: Wait for more blocks for the lightclient init

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

* subxt: Use unstable backend for light client

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

* testing: Disable legacy RPC tests

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

* testing: Disable sudo and contracts tests

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

* testing: Retry constructing lightclient on read-proof errors

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

* testing: Disable tx dynamic test

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

* proc-macro: Timeout for tests

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

* testing: Add timeout 800 seconds

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

* proc-macro/tests: Adjust subxt-test proc-macro

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

* proc-macro: Rename crate to subxt-test-proc-macro

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

* Use default subxt-proc-macro timeout

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

* light-client: Remove println

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

* subxt: Remove tokio as dependency, use it only for testing

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

* testing: Chagne default timeout to 6 seconds

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

* proc-macro: Add env timeout variable

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

* ci: Add subxt env var for controling test timeouts

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

* tests/tx-retries: Retry on `Non node available` error

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

* testing: Use unstable backend for testing lightclient

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

* testing: Remove old lightclient object

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

* testing: Adjust for the new interface

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

* backend/rpc: Allow older version of the initialized event

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

* rpc/tests: Check initialized decodes correctly

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

* ci: Reset workflow

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

* Apply cargo fmt

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

* Remove unused dep

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

* Remove gitmerge old file

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

* Remove unused dep

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

* rename proc-macro to subxt-test-macro

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

* tests: Remove txretries for lightclient

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

* tests: Wait for 5 blocks for the lightclient full testing suite

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

* tests: Group imports

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

* macro: Rename const value

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-08 11:34:20 +03:00
Tadeo Hepperle 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>
2024-03-27 08:55:08 +00:00
Alexandru Vasile 92c1ba7f66 unstable_rpc: Add transactionBroadcast and transactionStop (#1497)
* unstable_rpc: Add transactionBroadcast and transactionStop

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

* tests: Check transactionBroadcast works

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

* testing: Enable default feature for subxt-signer

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

* tests: Increase number of blocks to look for

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

* Fix clippy for unneed let binds

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

* Update subxt/src/backend/unstable/rpc_methods.rs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* tests: Adjust txBroadcast test

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

* tests: Add test for txStop

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

* tests: Ignore compact encoded lenght prefix

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2024-03-26 17:14:54 +02:00
James Wilson 9810406db2 Prep to release 0.35 (#1489)
* Prep to release 0.35

* Remove newline

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Fix a couple of small nits

---------

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2024-03-21 16:37:12 +00:00
paritytech-subxt-pr-maker[bot] 22e2796787 Update Artifacts (auto-generated) (#1480)
Co-authored-by: tadeohepperle <62739623+tadeohepperle@users.noreply.github.com>
2024-03-18 10:35:15 +01:00
James Wilson b069c4425a Rework light client (#1475)
* WIP second pass over light client code for simpler API

* First pass new light client

* pub(crate) LightClientRpc::new_raw(), and fmt

* Update examples and add back a way to configure boot nodes and fetch chainspec from a URL

* Fix light client examples

* remove unused deps and tidy lightclient feature flags

* fix wasm error

* LightClientRpc can be cloned

* update light client tests

* Other small fixes

* exclude mod unless jsonrpsee

* Fix wasm-lightclient-tests

* add back docsrs bit and web+native feature flag compile error

* update book and light client example names

* fix docs
2024-03-15 15:21:06 +00:00
paritytech-subxt-pr-maker[bot] a44d28b26b Update Artifacts (auto-generated) (#1469)
Co-authored-by: tadeohepperle <62739623+tadeohepperle@users.noreply.github.com>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2024-03-12 19:43:37 +01:00
Niklas Adolfsson dfd6e108cd rpc v2: chainhead support multiple finalized block hashes in FollowEvent::Initialized (#1476)
* chainhead rpc `block_hash -> finalized_block_hashs`

* cleanup

* address grumbles

* address grumbles: inc this.rel_block_num

* rel_block_num => rel_block_age for clarity

---------

Co-authored-by: James Wilson <james@jsdw.me>
2024-03-12 17:42:29 +00:00
Tadeo Hepperle a2ee750365 Typed Storage Keys (#1419)
* first iteration on storage multi keys

* decoding values from concat style hashers

* move util functions and remove comments

* change codegen for storage keys and fix examples

* trait bounds don't match scale value...

* fix trait bounds and examples

* reconstruct storage keys in iterations

* build(deps): bump js-sys from 0.3.67 to 0.3.68 (#1428)

Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.67 to 0.3.68.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: js-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump clap from 4.4.18 to 4.5.0 (#1427)

Bumps [clap](https://github.com/clap-rs/clap) from 4.4.18 to 4.5.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.18...clap_complete-v4.5.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump either from 1.9.0 to 1.10.0 (#1425)

Bumps [either](https://github.com/rayon-rs/either) from 1.9.0 to 1.10.0.
- [Commits](https://github.com/rayon-rs/either/compare/1.9.0...1.10.0)

---
updated-dependencies:
- dependency-name: either
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump thiserror from 1.0.56 to 1.0.57 (#1424)

Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.56 to 1.0.57.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.56...1.0.57)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump jsonrpsee from 0.21.0 to 0.22.0 (#1426)

* build(deps): bump jsonrpsee from 0.21.0 to 0.22.0

Bumps [jsonrpsee](https://github.com/paritytech/jsonrpsee) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/paritytech/jsonrpsee/releases)
- [Changelog](https://github.com/paritytech/jsonrpsee/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paritytech/jsonrpsee/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: jsonrpsee
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Cargo.lock

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* subxt: Derive `std::cmp` traits for subxt payloads and addresses (#1429)

* subxt/tx: Derive std::cmp traits

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

* subxt/runtime_api: Derive std::cmp traits

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

* subxt/constants: Derive std::cmp traits

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

* subxt/custom_values: Derive std::cmp traits

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

* subxt/storage: Derive std::cmp traits

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

* subxt: Fix non_canonical_partial_ord_impl clippy introduced in 1.73

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

* subxt: Add comment wrt derivative issue that triggers clippy warning

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

* Update subxt/src/backend/mod.rs

* Update subxt/src/constants/constant_address.rs

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* fix clippy

* add integration tests

* fix doc tests

* change hashing logic for hashers=1

* refactor

* clippy and fmt

* regenerate polkadot file which got changed by the automatic PR

* nested design for storage keys

* refactor codegen

* codegen adjustments

* fix storage hasher codegen test

* Suggestions for storage value decoding (#1457)

* Storage decode tweaks

* doc tweak

* more precise error when leftover or not enough bytes

* integrate nits from PR

* add fuzztest for storage keys, fix decoding bug

* clippy and fmt

* clippy

* Niklas Suggestions

* lifetime issues and iterator impls

* fmt and clippy

* regenerate polkadot.rs

* fix storage key encoding for empty keys

* rename trait methods for storage keys

* fix hasher bug...

* impl nits, add iterator struct seperate from `StorageHashers`

* clippy fix

* remove println

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
2024-03-06 14:04:51 +01:00
paritytech-subxt-pr-maker[bot] 9773cb53c9 Update Artifacts (auto-generated) (#1463)
Co-authored-by: tadeohepperle <62739623+tadeohepperle@users.noreply.github.com>
2024-03-04 10:20:25 +01:00
Tadeo Hepperle 2727f77910 Extrinsic Params Refinement (#1439)
* refinement based approach to params

* doc and test fixes

* bundle refine data into struct
2024-03-01 10:04:34 +01:00
James Wilson ddd0865fa9 Make storage_page_size for the LegacyBackend configurable (#1458) 2024-02-29 13:13:58 +00:00
paritytech-subxt-pr-maker[bot] 08ae4059d8 Update Artifacts (auto-generated) (#1446)
Co-authored-by: tadeohepperle <62739623+tadeohepperle@users.noreply.github.com>
2024-02-26 11:28:46 +00:00
paritytech-subxt-pr-maker[bot] 1ea84c6cde Update Artifacts (auto-generated) (#1433)
Co-authored-by: tadeohepperle <62739623+tadeohepperle@users.noreply.github.com>
2024-02-19 10:32:24 +01:00
Tadeo Hepperle e39791a5bc Add missing codegen mod in integration tests (#1418)
* add codgen mod to the module tree

* port codegen tests to scale-typegen

* remove test flag
2024-02-14 17:17:08 +01:00
Tadeo Hepperle 8fa496b866 Build Polkadot Nodes in CI - fixes artifact generation (#1410)
* new workflow and adjust node builder

* fix examples by fixing artifacts script

* use-nodes instead of use-substrate

* update yamls

* build polkadot

* remove the on-push trigger again, now that polkadot built in the CI

* add default implementation again
2024-02-01 21:54:30 +01:00
Alexandru Vasile c1073bc8d1 ci: Better job parallelism, cancel pipeline on failure and extra clippy checks (#1409)
* ci: Change CI order for better parallelism

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

* ci: Cancel ongoing jobs

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

* TO REVERT: Check early termination due to clipp/check

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

* ci/clippy: Extend clippy checks for lightclient and web feature flags

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

* ci: Use cancel-action@3

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

* lightclient: Derive Default

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

* subxt/rpc: Resolve redundant closure

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

* tests: Fix clippy

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

* lightclient: Fix clippy warnings

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

* ci: Extend clippy rules

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

* lightclient: Remove redundant clone

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

* ci: Use subxt instead of subxt-lightclient

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

* ci: Add wasm clippy step

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

* ci: Simplify the clippy step into a single run command

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

* ci: Pin version for cancel-action

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

* ci: Fix pinned version

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-01-31 11:53:33 +02:00
James Wilson f4acd1bae8 resolve clippy err 2024-01-18 10:27:16 +00:00
James Wilson 6b83016a6d Add logging to submit_transaction and unstable driver, and ensure unpin evs complete 2024-01-17 17:07:40 +00:00
Tadeo Hepperle 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>
2024-01-11 16:42:51 +01:00
Niklas Adolfsson 38d8e714ec fix clippy (#1334) 2024-01-03 12:18:56 +01:00
Alexandru Vasile c976d0dbce codegen: Generate type aliases for better API ergonomics (#1249)
* 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>
2023-12-08 15:07:50 +02:00
James Wilson df06cf9afb Prep for v0.33.0 release (#1311)
* Prep for v0.33.0 release

* only ignore failing test on unstable-backend-client

* Fix typos and wee grammar things

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com>

* omit uninteresting PRs and issue link for ignored test

---------

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com>
2023-12-07 11:00:22 +00:00
Alexandru Vasile b03679fcd9 storage: Fix partial key storage iteration (#1298)
* storage/fix: Use partial key instead of root key for iter

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

* storage: Allow partial key construction

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

* storage: Allow less provided types than num of hashes

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

* storage: Error on more fields than types

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

* testing: Check partial key iteration

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

* storage: Rename variable wrt partial address bytes

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

* storage: Identical storage key to root key if no keys are provided

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-12-01 15:33:33 +02:00
James Wilson 2c528854da Improve SignedExtension matching logic and remove SkipCheckIfFeeless bits (#1283)
* First pass making matching on signed exts more general and handlng SkipCheckifFeeless

* remove unneeded derives (only exts we can decode into are handled by the user)

* No SkipCheckIfFeeless in integration tests either

* Cargo fmt

* Remove SkipCheckIfFeeless specific logic

* clippy

* matches to just return bool, not result

* remove now-invalid comment

* return error from find if .iter() errors
2023-11-23 15:44:35 +00:00
Alexandru Vasile 25e107cc0c config: Add SkipCheckIfFeeless signed extension (#1264)
* config: Add `SkipCheckIfFeeless` signed extension

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

* config: Add extra extension to the default params

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

* examples: Adjust signed extension example

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

* config: Extend SkipCheckIfFeeless with inner signed extension

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

* config: Configure SkipCheck with inner signed extension params

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

* config: Implement Deafult for SkipCheckIfFeelessParams with Option

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

* examples: Fix example with proper extension

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

* config: Extend <T as Config>::AssetId with EncodeAsType and Clone

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

* config: Add SkipCheck with AssetTx

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

* config: Encode as type from metadata the inner signed extensions

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

* Adjust examples

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

* blocks: Use `SkipCheckIfFeeless` for decoding the tip of extensions

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

* config: Decode `SkipCheckIfFeeless` with `Self`

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

* tests: Adjust testing

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

* config: Descriptive errors for building `SkipCheckIfFeeless`

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

* config: Add docs for extra error types

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

* subxt: Add extra derives to signed extensions

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

* config: Use `Default::default` to simplify type init

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-11-16 16:22:18 +02:00
Tadeo Hepperle 56d0cdae78 Static Decoding of Signed Extensions: Simple Approach (#1235)
* skeleton commit

* signed extension decoding

* fix some minor things

* make api more similar to Extrinsics

* defer decoding of signed extensions

* fix byte slices

* add test for nonce signed extension

* adjust test and extend for tip

* clippy

* support both  ChargeTransactionPayment and ChargeAssetTxPayment

* address PR comments

* Extend lifetimes, expose pub structs, remove as_type

* add signed extensions to block subscribing example

* add Decoded type

* fix merging bug and tests

* add decoded type in CustomSignedExtension

* fix minor issues, extend test

* cargo fmt differences

* remove the `decoded` function

* new as_signed_extra fn, do not expose as_type anymore

* fix Result-Option order, simplify obtaining Nonce

* tx: Remove `wait_for_in_block` helper method (#1237)

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

* Update smoldot to 0.12 (#1212)

* Update lightclient

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

* testing: Fix typo

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

* testing: Update cargo.toml

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

* lightclient: Add tracing logs to improve debugging

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

* lightclient: Add socket buffers module for `PlatformRef`

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

* lightclient: Update `SubxtPlatform`

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

* cargo: Add lightclient dependencies

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

* Update cargo.lock of wasm tests

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

* lightclient: Add constant for with-buffer module

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

* lightclient: Replace rand crate with getrandom

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

* example: Update cargo lock file

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

* examples: Update deps

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com>

* ChargeAssetTxPayment: support providing u32 or MultiLocation in default impl (#1227)

* Asset Id in Config trait

* add example configuring the config

* fmt

* fix Default trait bound

* merge examples, fix default again

* adjust config in examples

* Update subxt/src/config/mod.rs

Co-authored-by: James Wilson <james@jsdw.me>

---------

Co-authored-by: James Wilson <james@jsdw.me>

* generic AssetId

* fix generics

* fmt

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
2023-11-10 18:32:58 +01:00
Tadeo Hepperle 1b88ebf78e Support decoding signed extensions (#1209)
* skeleton commit

* signed extension decoding

* fix some minor things

* make api more similar to Extrinsics

* defer decoding of signed extensions

* fix byte slices

* add test for nonce signed extension

* adjust test and extend for tip

* clippy

* support both  ChargeTransactionPayment and ChargeAssetTxPayment

* address PR comments

* Extend lifetimes, expose pub structs, remove as_type

* add signed extensions to block subscribing example

* make example less ugly

---------

Co-authored-by: James Wilson <james@jsdw.me>
2023-10-31 10:40:23 +01:00
Alexandru Vasile e53df87e72 tests: Wait for transaction to be in a finalized block (#1236)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-10-31 10:35:40 +01:00
James Wilson 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
2023-10-27 16:35:18 +01:00
James Wilson 71fbfebf5a Clone + Debug on Payloads/Addresses, and compare child storage results (#1203)
* Clone + Debug on Payloads/Addresses, and compare child storage results

* , to .

* clippy and fixes

* fix

* use derivative instead to remove boilerplate impls

* add missing import

* tidy up and extend wasm test timeout

* try 5 mins instead of 2
2023-10-18 22:05:38 +01:00
Tadeo Hepperle f0b72b9104 Add subxt feature in subxt-signer crate to default features (#1193)
* add subxt to subxt-signer default features

* distinguish between native and web in signer

* fix formatting and clippy

* rustfmt
2023-10-06 15:54:14 +02:00
James Wilson cf7e2db1b7 chainHead based backend implementation (#1161)
* add follow_stream impl

* follow_stream_unpin first draft

* add tests for follow_stream_unpin

* more tests and fixes for follow_stream_unpin

* first pass follow_stream_driver

* follow_stream_driver: add tests, fix things, buffer events from last finalized

* First pass finishing Backend impl

* Fix test compile issues

* clippy fixes

* clippy fix and consistify light_client

* revert lightclient tweak

* revert other lightclient thing

* cargo fmt

* start testing unstable backend behind feature flag

* more test fixes and move test-runtime metadata path just incase

* fix compile error

* ensure transaction progress stream actually used and fix another test

* cargo fmt

* CI tweak

* improve some comments and address some feedback bits

* update CI to use our own nightly binary

* wait for finalized block perhaps
2023-09-26 16:58:30 +01:00
Alexandru Vasile c047d7f14e integration-tests: Increase the number of expected events (#1152)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-09-05 18:03:51 +02:00
James Wilson a3d25db846 Unstable Backend: add back the old chainHead RPCs/tests (#1137)
* add back unstable APIs and tests

* clippy fixes

* fmt with new rust

* deserialize from object or array into api versions

* remove inspect

* add some of the other unstable RPC methods we might want

* clippy fix

* no unused deps warning in test crate

* fix doc fails

* legacy -> unstable

Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com>

* runtime_updates -> with_runtiem

* add test and be consistent with naming of unstable RPCs

---------

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com>
2023-08-29 12:35:35 +01:00
James Wilson d7124b56f7 Introduce Backend trait to allow different RPC (or other) backends to be implemented (#1126)
* WIP backend trait

* WIP converting higher level stuff to using Backend impl

* more implementing new backend trait, mainly storage focused

* Get core code compiling with new backend bits

* subxt crate checks passing

* fix tests

* cargo fmt

* clippy/fixes

* merging and other fixes

* fix test

* fix lightclient code

* Fix some broken doc links

* another book link fix

* fix broken test when moving default_rpc_client

* fix dry_run test

* fix more tests; lightclient and wasm

* fix wasm tests

* fix some doc examples

* use next() instead of next_item()

* missing next_item() -> next()s

* move legacy RPc methods to LegacyRpcMethods type to host generic param instead of RpcClient

* standardise on all RpcClient types prefixed with Rpc, and 'raw' trait types prefixed with RawRpc so it's less ocnfusing which is which

* rename fixes

* doc fixes

* Add back system_dryRun RPC method and rename tx.dry_run() to tx.validate(), to signal that the calls are different

* Add a test that we return the correct extrinsic hash from submit()

* add TransactionValid details back, and protect against out of range bytes

* add test for decoding transaction validation from empty bytes

* fix clippy warning
2023-08-22 12:32:22 +01:00
Tadeo Hepperle 43809ee592 Storage: Support iterating over NMaps with partial keys (#1079)
* implement partial key iters

* format

* make tests compile

* fix docs and try example

* codegen: Fetch and decode metadata version then fallback (#1092)

* codegen: Fetch and decode metadata version then fallback

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

* cli: Add `unstable-metadata` attribute to the subxt macro

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

* docs: Add missing comma

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

* macro: Add `GenerateRuntimeApi`

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

* Update subxt/src/lib.rs

Co-authored-by: James Wilson <james@jsdw.me>

* Update macro/src/lib.rs

Co-authored-by: James Wilson <james@jsdw.me>

* subxt: Adjust docs

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

* cli: Import `GenerateRuntimeApi`

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>

* Bump darling from 0.20.1 to 0.20.3 (#1085)

Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.1 to 0.20.3.
- [Release notes](https://github.com/TedDriggs/darling/releases)
- [Changelog](https://github.com/TedDriggs/darling/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TedDriggs/darling/compare/v0.20.1...v0.20.3)

---
updated-dependencies:
- dependency-name: darling
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>

* Bump either from 1.8.1 to 1.9.0 (#1084)

Bumps [either](https://github.com/bluss/either) from 1.8.1 to 1.9.0.
- [Commits](https://github.com/bluss/either/compare/1.8.1...1.9.0)

---
updated-dependencies:
- dependency-name: either
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>

* Bump clap from 4.3.11 to 4.3.19 (#1083)

Bumps [clap](https://github.com/clap-rs/clap) from 4.3.11 to 4.3.19.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.3.11...v4.3.19)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com>

* Bump trybuild from 1.0.81 to 1.0.82 (#1082)

Bumps [trybuild](https://github.com/dtolnay/trybuild) from 1.0.81 to 1.0.82.
- [Release notes](https://github.com/dtolnay/trybuild/releases)
- [Commits](https://github.com/dtolnay/trybuild/compare/1.0.81...1.0.82)

---
updated-dependencies:
- dependency-name: trybuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>

* Prep for 0.30.1 release (#1094)

* Set minimum supported `rust-version` to `1.70` (#1097)

* Bump serde_json from 1.0.103 to 1.0.104 (#1100)

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.103 to 1.0.104.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.103...v1.0.104)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump serde from 1.0.175 to 1.0.179 (#1101)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.175 to 1.0.179.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.175...v1.0.179)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Tests: support 'substrate-node' too and allow multiple binary paths (#1102)

* Support 'substrate-node' too and allow multiple binary paths

* fmt

* clippy

* fix path

* adjust book

* remove the partial iteration example. there was nothing good to show

* revert spaces in changelog

* Support more types in Storage entry constructors  (#1105)

* implement test for type alias being used

* Bump serde from 1.0.179 to 1.0.183 (#1112)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.179 to 1.0.183.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.179...v1.0.183)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump regex from 1.9.1 to 1.9.3 (#1110)

Bumps [regex](https://github.com/rust-lang/regex) from 1.9.1 to 1.9.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.9.1...1.9.3)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* revert yaml changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update subxt/src/book/usage/storage.rs

Co-authored-by: James Wilson <james@jsdw.me>

* remove dynamic_iter

* fix example

* format

* add example, adjust book

* Update subxt/src/book/usage/storage.rs

Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Jones <ascjones@gmail.com>
2023-08-11 16:06:41 +02:00
Tadeo Hepperle 9723a50969 Add storage_version() and runtime_wasm_code() to storage (#1111)
* add storage_version function

* get runtime code

* add tests

* clippy fix

* just support CODE, remove other well known keys

* remove u16 wrapper
2023-08-10 15:40:38 +02:00
Alexandru Vasile b97acc5df6 chainHead: Propagate results on the chainHead_follow (#1116)
* rpc/types: Update chainHead events

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

* rpc: Sync chainHead methods with spec

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

* testing: Adjust chainHead tests

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

* tests: Ignore block related events to avoid flaky tests

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

* tests: Adjust clippy

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

* test: Remove unused OfflineClientT

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

* Update subxt/src/rpc/types.rs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Update subxt/src/rpc/types.rs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Update subxt/src/rpc/types.rs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Update subxt/src/rpc/types.rs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* types: Remove serde flags for serialization

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2023-08-09 17:40:39 +03:00
James Wilson 2176ec9fa7 Bump to latest scale-encode/decode/value and fix test running (#1103)
* Bump to latest scale-encode,decode,value and fix test running

* remove patch deps

* update CI to spit out 'substrate-node' binary now

* fmt

* Fix test: compact type ID no longer present so can't re-encode Value in same way

* remove patch

* Fix cargo.lock

* Fix other compact test
2023-08-02 13:55:48 +01:00
James Wilson fd853b9b72 Tests: support 'substrate-node' too and allow multiple binary paths (#1102)
* Support 'substrate-node' too and allow multiple binary paths

* fmt

* clippy

* fix path
2023-07-31 12:25:50 +01:00
Alexandru Vasile 560432b92b chainHead: Adjust chainHead_storage api (#1087)
* types: Add storage ChainHeadStorageEvent

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

* rpc: Keep up with the spec for chainHead_storage

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

* testing: Adjust the chainHead_storage

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

* rpc: Fix types typo

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-07-24 17:18:55 +03:00
Alexandru Vasile fd8f60c8a9 runtime API: Substitute UncheckedExtrinsic with custom encoding (#1076)
* codegen: Add uncheckedExtrinsic substitute

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

* subxt: Add uncheckedExtrinsic replacement

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

* testing: Test uncheckedExtrinsic encoding

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

* testing: Apply clippy

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

* subxt: Implement encode_to instead of encode for uncheckedExtrinsic

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

* subxt: Remove encode_as_fields from uncheckedExtrinsic

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

* utils: Extend the UncheckedExtrinsic interface

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

* utils: Use Static<Encoded> for uncheckedExtrinsic

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

* utils: Remove extra impl on the uncheckedExtrinsic

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

* utils: Add back the EncodeAsType

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

* utils: Simplify the decode_as_type

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

* utils: Use encode_as_type

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

* utils: impl Decode for UncheckedExtrinsic

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

* Update subxt/src/utils/unchecked_extrinsic.rs

Co-authored-by: James Wilson <james@jsdw.me>

* utils: Apply cargo fmt

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

* utils: Check encoding / decoding of uncheckedExtrinsic

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

* utils/tests: Use an already encoded tx bytes to start with

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>
2023-07-21 13:34:34 +03:00