Commit Graph

41 Commits

Author SHA1 Message Date
dependabot[bot] f8d51a0242 build(deps): bump tracing-subscriber in /signer/tests/wasm (#2111)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.18 to 0.3.20.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.18...tracing-subscriber-0.3.20)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-version: 0.3.20
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 10:17:16 +01:00
Alberto Nicolas Penayo a7d2423e92 chore(dev): increase number of dev accounts (#2068)
* increase number of dev accounts

* delete extra acc
2025-08-26 10:45:04 +01:00
James Wilson 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
2025-05-12 10:32:38 +01:00
James Wilson 23c62f3d5d Update to 2024 edition (#2001)
* Update to 2024 edition

* Update to 2024 edition; fmt, use<> and remove refs

* async functions
2025-05-09 16:12:18 +01:00
James Wilson 21b3f52191 Metadata V16: Be more dynamic over which hasher is used. (#1974)
* Use DynamicHasher256 to support Blake2 or Keccack depending on chain

* remove Config::Hash associated type, replace with HashFor<Config> alias

* Fix doc links

* fix wasm tests

* Don't strip system pallet associated types. check System.Hashing, not Hash. Rename BlockHash trait to Hash

* Tweak comment

* fmt

* fix merge

* Fix typo
2025-04-23 10:12:48 +01:00
James Wilson b6b9ac65c7 Support constructing and submitting V5 transactions (#1931)
* TransactionExtensions basic support for V5 VerifySignature and renames

* WIP: subxt-core v5 transaction support

* Subxt to support V5 extrinsics

* WIP tests failing with wsm trap error

* Actually encode mortality to fix tx encode issue

* fmt

* rename to sign_with_account_and_signature

* Add explicit methods for v4 and v5 ext construction

* clippy

* fix wasm example and no mut self where not needed

* fix doc example

* another doc fix

* Add tests for tx encoding and fix v5 encode issue

* add copyright and todo

* refactor APIs to have clear v4/v5 split in core and slightly nicer split in subxt proper

* rename Partial/SubmittableExtrinsic to *Transaction

* Remove SignerT::address since it's not needed

* doc fixes

* fmt

* doc fixes

* Fix comment number

* Clarify panic behaviour of inject_signature

* fmt
2025-03-11 11:14:27 +00:00
wgyt 396762510a update copyright year (#1924)
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2025-02-24 16:07:29 +00:00
Niklas Adolfsson 69ce6d726f deps: remove polkadot-sdk umbrella crate (#1926)
* deps: get rid of polkadot-sdk umbrella crate

* fix nits

* Update subxt/src/backend/mod.rs

* Update subxt/src/events/events_client.rs

* Update metadata/src/utils/validation.rs

* cargo clippy fix

* fix ui tests
2025-02-24 12:38:21 +01:00
James Wilson 816a86423b Split RPCs into a separate crate (#1910)
* WIP extract RPCs into separate crate

* fmt

* Fix test

* Remove unused deps

* fix import

* WIP: Fix up errors and most tests. Start extracintg some tests/code to rpc crate

* MockRpcClient sync or async

* MockRpcClient only async but better type inference

* WIP MockRpcClient FnMuts and some test updates to use it

* Get all but one test working with new MockRpcClient

* WIP trying to debug failure

* WIP, Tests mostly fixed, need to add back oen more

* Get mock RPC tests working

* fmt

* fmt

* Clippy and comment tweak

* update CI to explicitly check subxt-rpc features

* clippy

* small tweaks after pass over

* feature flag rename

* update some docs

* Fix some examples

* fmt

* Fix features flags to work with web/wasm32

* Fix unused dep warning

* explicit targets in wasm CI

* Add better crate level docs

* fmt

* Address review comments

* Comment out flaky test for now and make more obvious how similar POlkadot and Substrate configs are

* Not a doc comment

* Remove unused imports
2025-02-18 12:07:00 +00:00
James Wilson 29bf00e209 Fix and test sr25519 signing in nostd (#1872)
* Fix and test sr25519 signing in nostd

* Remove sr25519 signing test on nostd for thumbabi target

* Don't use sr25519 feature in nostd tests

* Fix nits, remove WASM deps from nostd test, improve comments

* Change copypasted comment

* fmt

* Update CI to account for signer tests
2025-01-30 17:13:58 +00:00
Niklas Adolfsson f5e9ce0d2c remove substrate compat (#1850)
* remove substrate compat

* add hacky example

* simplify substrate-compat example

* simplify substrate-compat example

* cargo fmt

* fix build

* add more examples

* fix nit

* fix test build

* Update subxt/examples/substrate_compat_signer.rs

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

* keep only polkadot signer example

* remove more substrate compat related stuff

* fix example

* link to substrate signer example in book

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

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

* address grumbles

* fix nits

---------

Co-authored-by: James Wilson <james@jsdw.me>
2024-11-27 16:46:38 +01:00
Pavlo Khrystenko 7d1002192e Migrate custom error trait impls to thiserror (#1856)
* Migrate to thiserror

* missing bits

* review comment

* Apply suggestions from code review

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

* From<scale_decode::visitor::Error> to remove Into::intos

* scale crates for core::error::Error

* bump msrv 1.81

* make signer crate compile

---------

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: James Wilson <james.wilson@parity.io>
2024-11-18 09:39:14 +00:00
Niklas Adolfsson f358a3864e chore(deps): bump subxt signer deps (#1840) 2024-10-24 12:35:16 +02:00
Niklas Adolfsson 9527165a40 fix: defalt-feature -> default-features Cargo.toml (#1828) 2024-10-14 17:15:46 +02:00
Niklas Adolfsson 0e86993cd7 deps: use polkadot-sdk umbrella crate (#1786)
* deps: unify usage of polkadot-sdk crates

* cargo fmt

* fix macro crate

* make tests compile

* fix more nits

* fix doc tests

* fix more nits

* more nits

* core: remove polkadot-sdk/std

* cargo fmt

* remove polkadot-sdk/std by default

* Update metadata/Cargo.toml

* remove more std

* Update Cargo.toml
2024-10-11 14:19:11 +02:00
Niklas Adolfsson dff16c6194 chore(deps): bump a few dependencies (#1788)
* chore(deps): bump a few dependencies

* signer: make it compile
2024-09-30 15:20:52 +02:00
drewstone aab1ef8a6c Upgrade sp-core, sp-runtime and sp-keyring (#1777)
* Upgrade sp-core to v34

* Update Cargo.toml

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

* Fix clippy

---------

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: James Wilson <james@jsdw.me>
2024-09-24 16:27:39 +02:00
Jonathan Brown c7ccc58e69 Support loading keys from Polkadot-JS accounts. (#1661)
* Import key pair from JSON.

* Get secret.

* Fix JSON decryption.

* Fix error handling.

* Fix warnings.

* Add polkadot-js links.

* Fix packages.

* Fix json feature.

* Add copyright message.

* Update Cargo.toml

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

* Improve error handling.

* Expect that provided parameters are valid.

* Add Scrypt parameters comment from JS implementation.

* Fix expect() message

* Make from_ed25519_bytes() pub(crate)

* Rename json feature to polkadot-js-compat

* Add comment about polkadot-js-compat dependencies.

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

* Add decrypt_json() public method.

* json.rs -> polkadot_js_compat.rs

* Simplify JSON structs.

* Only declare from_ed25519_bytes() with polkadot-js-compat

* Move decrypt_json() to top of file.

* Don't enable new crates on std feature

* Avoid enabling a couple of existing optional crates on std feature

---------

Co-authored-by: Jonathan Brown <jbrown@acuity.network>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: James Wilson <james@jsdw.me>
2024-08-23 17:52:46 +01:00
Matteo Muraca bb1a012560 Expose secret_key method for ecdsa::Keypair and eth::Keypair (#1628)
* Expose `secret_key` method for `ecdsa::Keypair` and `eth::Keypair`

* cargo fmt

* fix eth::secret_key

---------

Co-authored-by: James Wilson <james@jsdw.me>
2024-07-08 14:30:00 +01:00
Pavlo Khrystenko 5a5c5fc382 Add 20-byte account id to subxt_core (#1638)
* Add accountId20 impl to subxt_core

closes #1576
2024-06-19 13:31:04 +02:00
Pavlo Khrystenko 971c15cf3b Disable clippy::unwrap_or_default lint for the project (#1647)
* disable clippy lint trigerred by a macro

* typo in lint name

* Update macro/src/lib.rs

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

* move missing docs

* add workspace.lints = true for remaining crates

* lint fixes

* Update signer/src/eth.rs

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

---------

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: James Wilson <james@jsdw.me>
2024-06-18 18:45:40 +02:00
Niklas Adolfsson 52fce46e89 chore(deps): remove unused sp-core from signer (#1617) 2024-05-27 15:13:59 +02:00
Pavlo Khrystenko 5a0682c1e0 Remove derive_more (#1600)
* replace derive_more's 'From' in signer

* replace derive_more's 'From' in core

* Remove `derive_more`'s `Display` usages (#1601)

* Remove derive_more's 'Display' from core

* Remove derive_more's 'Display' from metadata

* Remove derive_more's 'Display' from signer

* Remove derive_more from dependencies (#1602)

closes #1503

* Update signer/src/eth.rs

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

* rename convert_error to impl_from

* rename convert_error to impl_from in core

---------

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2024-05-24 11:18:51 +02:00
Matteo Muraca ae5c0927c6 Implemented sign_prehashed for ecdsa::Keypair and eth::Keypair (#1598)
* Implemented `sign_prehashed` for `eth::Keypair`

* missing import

* fmt

* Implemented `sign_prehashed` for `ecdsa::Keypair`

* use `[u8; 32]` type

* ditched From impl
2024-05-24 09:48:55 +01:00
Niklas Adolfsson 25193d75af add frontier/ethereum example (#1557)
* add ethereum example

The ethereum config doesn't work with the default PolkadotConfig which
this shows how to do.

Tested with a frontier node

* address grumbles

* Update subxt/examples/tx_basic_frontier.rs

* Update subxt/examples/tx_basic_frontier.rs
2024-04-26 16:18:19 +02:00
Matteo Muraca 03fd95efcf Fixed import in subxt-signer::eth (#1553) 2024-04-24 12:08:01 +02:00
rustfix b5eeaf8e6b refactor: Optimize code based on cargo clippy suggestions (#1554)
Signed-off-by: rustfix <771054535@qq.com>
2024-04-23 11:00:26 +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
Ryan Lee b527c857ea feat(signer): ethereum implementation (#1501)
---------

Co-authored-by: James Wilson <james@jsdw.me>
2024-04-15 08:56:10 -04: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
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
James Wilson 98c4c0135b chore: rename sp-core-hashing to sp-crypto-hashing (#1490)
* rename sp-core-hashing to sp-crypto-hashing

* fmt
2024-03-21 16:18:00 +01:00
Tadeo Hepperle 4831f816f2 no_std compatibility for subxt-signer (#1477)
* subxt-signer no-std

* impl error

* address james comments

* fix signer wasm tests

* error impl for secret uri error
2024-03-14 11:04:27 +01:00
Niklas Adolfsson 437ff7ee41 generate docs for feature gated items (#1332)
* 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
2024-01-12 14:18:34 +01:00
Alexandru Vasile 14b71279ba cargo: Switch to workspace lints (#1299)
* 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>
2023-12-04 13:07:23 +02:00
Tadeo Hepperle ea8735f863 Update substrate- and signer-related dependencies (#1297)
* update crypto dependencies, adjust keypair

* add scale_info::TypeInfo derive in some places

* add multi signature derive
2023-11-30 14:54:41 +01:00
James Wilson 2e908025f0 Wee tidy to subxt-signer flags (#1200)
* Wee tidy to subxt-signer flags

* revert removing subxt?/foo features; need them for CI

* make the flag identical to subxt; forgot the 'all' case

* subxt-signer needs native flag now when --no-default-features
2023-10-09 22:15:42 +02: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
Alexandru Vasile 91a56fd580 Apply cargo fmt (#1146)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-08-28 15:03:29 +02:00
James Wilson fa16080a03 ECDSA Support in signer (#1064)
* Add ecdsa support to signer

* Remove nix. Cleanup.

* remove ecdsa example and small tidy

* fmt

* fix wasm test

* feature flag ecdsa/sr25519 support, use global signing context

* clippy fix

* ensure signers all impl Signer trait in doc test

* fix CI

* fix digner test

* remove dead code warnings when no features enabled

* move dead code attr to right place

* fix random clippy error that popped up

---------

Co-authored-by: Lech Głowiak <lech.glowiak@gmail.com>
2023-07-19 10:17:27 +01:00
James Wilson b4eb406ee5 Add subxt_signer crate for native & WASM compatible signing (#1016)
* Add and use subxt-signer crate for WASM compatible signing

* cargo fmt

* dev keypairs already references

* WIP fix various breakages

* re-jig features to be simpler and various test fixes etc

* doc and web fix

* fix various bits and pieces

* fix a test I broke

* dev-deps can't be linked to in docs, hrmph

* cargo fmt

* another doc link

* document the subxt_signer crate more thoroughly

* move feature flag for consistency

* more docs, no default subxt feature flag on signer, update release instrs

* Add missing license header

* unwrap_inner => into_inner

* extend a test a little to better check derive junctions

* note more clearly that the crypto bits come from sp_core::crypto
2023-06-20 11:32:12 +01:00