Commit Graph

93 Commits

Author SHA1 Message Date
Demi M. Obenour 49b3b1e820 Use the correct key for staking maps
They use the key type, not ‘PhantomData’.
2020-05-31 16:57:39 -04:00
Demi M. Obenour 06aa7e2d3b Make the Signer impl require Send + Sync
This is what Ledgeracio needs.
2020-05-29 19:41:12 -04:00
Demi M. Obenour ba4f90cb24 Merge branch 'master' into staking
Also implement Signer for Box<dyn Signer>
2020-05-29 18:42:12 -04:00
Demi Obenour a2eead0c3d Make signing fallable and asynchronous (#119)
* Make signing fallable and asynchronous

This is needed for hardware wallets, which require human confirmation to
sign transactions.  Blocking on a human to sign transactions is not a
good idea, and the signing might fail for many reasons (device
unplugged, authorization not granted, etc).

* Reformat

* Refactor as suggested by Andrew Jones (@ascjones).

* Use future::ok

Co-authored-by: Andrew Jones <ascjones@gmail.com>
2020-05-29 08:49:27 +01:00
Demi M. Obenour e3e30cf7bb Trait cleanups 2020-05-28 20:50:20 -04:00
Demi M. Obenour c6ade8b3a1 Refactor as suggested by Andrew Jones (@ascjones). 2020-05-28 12:36:38 -04:00
Demi M. Obenour c4942c45a8 Reformat 2020-05-28 12:34:08 -04:00
Demi M. Obenour 7868f2c3f4 Merge branch 'async-signer' into staking 2020-05-27 22:01:01 -04:00
Demi M. Obenour 193104c5e9 Make signing fallable and asynchronous
This is needed for hardware wallets, which require human confirmation to
sign transactions.  Blocking on a human to sign transactions is not a
good idea, and the signing might fail for many reasons (device
unplugged, authorization not granted, etc).
2020-05-27 21:55:07 -04:00
Demi M. Obenour ab9612b381 Respond to code review
This fixes most of the issues found during review, with the exception of
tests.
2020-05-27 14:40:09 -04:00
Demi M. Obenour 58da21745e Merge branch 'master' into staking 2020-05-26 20:17:47 -04:00
Andrew Jones 0d58f4b67c Update to Substrate release candidate (#116)
* Substrate rc1

* Add tx version extra

* Remove CheckBlockGasLimit

* Substrate rc2
2020-05-26 13:53:08 +01:00
David Craven 4dadb2c9b5 Update to alpha.8 (#114) 2020-05-26 10:55:54 +01:00
David Craven 67f3ce529e Refactors the api (#113)
* Refactor api.

* Try fix ci.

* Fix test.

* Address review comments.
2020-05-26 10:04:44 +01:00
Demi M. Obenour aaf190e1b9 Fix compilation errors and remove useless lifetimes 2020-05-18 19:20:18 -04:00
Demi M. Obenour ebfdc17459 Add staking payout support 2020-05-17 17:34:24 -04:00
Demi M. Obenour 1b4dc07f77 Don’t impl ‘Staking’ for all ‘T: System’ 2020-05-17 15:50:02 -04:00
Demi M. Obenour ffbffd44eb Use ‘#[module]’ and implement session for Kusama 2020-05-17 15:34:50 -04:00
Demi M. Obenour 88ac3cb2a8 Use the #[module] macro
This fixes a compile error
2020-05-17 13:46:15 -04:00
Demi M. Obenour 716dd13313 Try to implement nomination
This currently fails with compilation errors I do not understand.
2020-05-16 20:56:14 -04:00
Demi M. Obenour ff967e9ff6 Reformat 2020-05-15 18:22:09 -04:00
Demi M. Obenour cfabfe8ca2 Add partial session support 2020-05-15 18:17:55 -04:00
Demi M. Obenour a28fb20264 Staking: use proc macros 2020-05-15 16:25:28 -04:00
Demi M. Obenour 872123766b Merge branch 'master' into staking 2020-05-14 12:22:18 -04:00
David Craven f861f3fac4 Split subxt (#102)
* Proc macro improvements.

* Use proc-macros.

* Update examples.

* Fix build.

* Run rustfmt.

* Fix total issuance test.

* Remove gas limit from put code call.

* Handle runtime errors.

* Fix tests.

* Make test more reliable.

* Revert "Handle runtime errors."

This reverts commit 26f30a9f4cfcfddfb3e49308cded46cfe6468697.

* Use expect instead of unwrap.

* Parse marker type.

* Fetch doesn't fail.
2020-05-12 12:25:22 +01:00
Yuanchao Sun 825f3ab64c Add support for RPC state_getReadProof (#106)
* Add support for RPC `state_getReadProof`

* Format code

* Add test
2020-05-07 07:41:27 +01:00
Andrew Jones f2c42f88cf Update to substrate alpha.7 release (#105)
* Update to substrate alpha.7

* Remove gas limit from contracts put code

* Rename SystemEvent::ReapedAccount to KilledAccount

* Log debug event received before attempting to decode

* Temporary registration of Balance type before #102 merged

* Show contract test errors, increase instantiate gas_limit
2020-05-06 09:15:14 +01:00
Demi M. Obenour 3d6e2eebbc Reformat 2020-05-05 10:30:59 -04:00
Demi M. Obenour fef1260a00 Fix missing documentation 2020-05-01 17:57:36 -04:00
Demi M. Obenour 93c347cb18 Remove dead code 2020-05-01 15:31:19 -04:00
Demi M. Obenour c08e22a873 Reformat 2020-04-30 20:46:18 -04:00
Demi M. Obenour d4a085af7f Add more staking types 2020-04-30 20:36:36 -04:00
Demi M. Obenour 10667e319a Merge branch 'master' of github.com:paritytech/substrate-subxt 2020-04-30 18:18:44 -04:00
Demi M. Obenour 6bdf5e8d8b Initial Staking API 2020-04-30 18:15:28 -04:00
Andrew Jones 194c7bcf2f Add missing license headers and CI check (#98)
* Add missing license headers and add CI check

* Remove log line

* Remove stale todos
2020-04-30 22:26:22 +01:00
David Craven 6f27489378 Double map and plain storage support, introduce macros (#93)
* Support custom clients.

* Simplify trait bounds.

* Plain and double map storage support.

* Simplify more trait bounds.

* Add proc macro.

* Add Call, Event and Store traits.

* Update proc-macros.

* Add with_system for proc-macro.

* proc-macro: test: support signature and extra fields.

* proc-macro: test: support sharing state accross steps.

* proc-macro: test: fetch state sequentially.

* Elide lifetimes.

* Add test for plain storage.

* Run rustfmt.
2020-04-28 20:04:26 +01:00
bwty 216b5614dd Raw payload return SignedPayload struct (#92)
* create SignedPayload struct

* align with generic extra updates

Co-authored-by: bwty <whalelephant@users.noreply.github.com>
2020-04-20 07:25:37 +01:00
Andrew Jones dc2a73dc4a Wrap and export BlockNumber (#87)
* Add fetch example and wrap BlockNumber impl

* Fmt
2020-04-15 08:45:58 +01:00
David Craven 8cf652605f Custom extra (#89)
* Run rustfmt.

* Make extra customizable.

* Update to alpha 6.
2020-04-15 08:21:19 +01:00
bwty bb465782dc raw_payload w/test (#83)
Co-authored-by: bwty <whalelephant@users.noreply.github.com>
2020-04-03 09:47:00 +01:00
Andrew Jones fb00479a3d Release v0.5.0 (#80)
* Update README.md

* Update to alpha.5 substrate packages

* Add identity storage hasher

* Bump version

* Add CHANGELOG.md

* Update crate metadata for publishing

* Update url crate
2020-03-25 14:43:03 +00:00
Black3HDF f4ef19edc9 Remove unused things (#76)
* remove unused imports

* remove unused type alias

* remove unused imports
2020-03-19 16:07:08 +00:00
Andrew Jones c36b8494ee Add kusama runtime and example (#75) 2020-03-16 15:16:14 +00:00
Andrew Jones 8ea264d7b0 Upgrade to substrate alpha.3 crates.io dependencies (#73)
* Use substrate dependencies from crates.io

* Remove test that depends on node_runtime.

Because node_runtime is not on crates.io and was downloading duplicate substrate dependencies. The integration tests will test whether the serialization of keys and calls works.

* Fix updated jsonrpsee compilation errors

* Add missing frame-metadata dependency
2020-03-06 11:58:23 +00:00
Andrew Jones dcc6b91d10 Use new AccountInfo struct for "System Account" storage data (#71)
* Add AccountInfo struct for "System Account" data

* Fmt

* Simplify AccountInfo struct constraints
2020-02-25 17:18:10 +00:00
Andrew Jones b7565ff435 Latest substrate updates (#70)
* Fix compilation errors with latest substrate

* System::Account replaces FreeBalance and Nonce

* System::Account replaces FreeBalance and Nonce

* Remove Balances FreeBalance, replaced with System Account

* Update system event, fix instantiate

* reorder deps
2020-02-20 13:09:11 +00:00
Andrew Jones 399ac68cb1 Allow irrefutable let pattern for subscriptions, remove legacy lint 2020-01-31 11:52:30 +00:00
Yuanchao Sun 1a5e74ac76 Update substrate, bump metadata version to v11 (#67) 2020-01-31 11:40:45 +00:00
Yuanchao Sun 3618b03dee Add methods to get header and storage change set (#65) 2020-01-21 09:43:10 +00:00
Andrew Jones 253a7d8b0b Convert to std futures (#58)
* WIP

* Begin converting rpc layer to use std futures and jsonrpsee

* Convert metadata to async/await

* Convert block_hash to async/await

* Convert more methods to async/await

* Remove sp_rpc

* Fix more compilation errors

* Remove connect

* Starting to convert subscription functions

* Use jsonrpsee branch from PR for public client types

* Implement subscribe events with jsonrpsee subscription

* Converting subscriptions and wait_for_block_events

* WIP converting lib methods to async

* Use shared client reference directly for rpc call

`rpc_api!` macro currently only supports RawClient (which cannot be shared).
Also supports named params only which is not currently compatible with substrate rpd which accepts only positional params.

* Use &self instead of &mut self for shared Client

* Convert submit_and_watch to async/await

* Convert more Client fns to async

* Pin some trait futures

* Add serde error

* Fix client creation

* Fix client request compiler errors

* Unify metadata errors

* Add WS handshake error variant

* Fix some more compiler errors

* Fix more compiler errors

* Convert submit_extrinsic to async

* Convert submit and submit_and_watch

* Add Send + Sync constraints

* Clone clients

* Fix EventArg conversion error

* Fix remaining warnings/errors

* Replace deny warnings with specific lints

* Infallable subscription loops

* Use jsonrpsee wss branch

* Fix example

* Start to fix up tests

* Make contracts tests compile

* Make some more tests pass

* Fix up remaining tests

* Fmt

* Use correct event storage key type

* Fix finding events

* Use master jsonrpsee
2020-01-20 12:00:08 +00:00