Commit Graph

56 Commits

Author SHA1 Message Date
Andrew Jones 4ed8e37ffe Fix up contracts pallet tests (#163)
* Revert contracts put_code test to pure code (not using the macro)

* Test contract instantiate

* Fmt
2020-09-15 08:32:33 +01:00
Andrew Jones af45c39fb1 Release v0.12.0 (#157)
* Bump version, update changelog

* Bump proc-macro crate

* Bump client crate
2020-09-01 15:54:01 +01:00
David Craven 3ea9d3b8bb Update to rc6. (#155)
* Update to rc6.

* Fix clippy warnings.
2020-08-25 09:50:14 +01:00
Andrew Jones d3e7bd2282 Release v0.11.0 (#145)
* Bump versions

* Update changelog

* Update PR links

* Fix changelog linebreak

* Remove explicit wabt-sys dependency

* Update changelog

* Update parity-scale-codec version
2020-07-31 11:02:21 +01:00
hewigovens cb23cb24e0 Fix build error, wabt 0.9.2 is yanked (#146) 2020-07-31 08:29:48 +01:00
David Craven e6f3a82f99 Rc5 (#143)
* Update to rc6.

* Update runtime.

* Update node to rc6.

* Update client.

* Fix node.

* Add option to enable telemetry.
2020-07-27 08:53:02 +01:00
Andrew Jones cd6b8f43f1 Refactor: extract functions and types for creating extrinsics (#138)
* Extract extrinsic

* Extract extrinsic types to own module

* Fix compiler errors

* Fix warnings

* Fmt

* Pin wabt-sys to 0.7.1, it fails (on my machine) with 0.7.2

* Fix up tests

* Fmt

* Reexport RuntimeVersion
2020-07-20 09:17:19 +01:00
Andrew Jones cc25207a2a Release client v0.2.0 (#133)
* Bump client version

* Bump client dev dependency version

* Changelog

* Bump subxt version
2020-06-29 10:12:21 +01:00
Andrew Jones d3e9e3f757 Upgrade to substrate rc4 release (#131)
* Upgrade to substrate rc4 release

* Fix up test-node/service

* Fix up client node config

* Fix up remaining compilation errors

* Fmt

* Remove fixme

* Fix test

* Release v0.10.0
2020-06-29 09:32:07 +01:00
Andrew Jones 5fd83f8bdb Release v0.9.0 (#129)
* Bump version, update changelog

* Add client version
2020-06-25 10:49:28 +01:00
David Craven 7f0847107c Events sub (#126)
* Make event subscription logic more generic.

* Fix build.

* Add test-node.

* Update deps.

* Address review comments.
2020-06-25 07:05:00 +01:00
David Craven 3080ec91a6 Improve error handling in proc-macros, handle DispatchError etc. (#123)
* Improve error handling.

* Fix build.

* Handle runtime errors.

* Add runtime trait for better type inference.

* Use runtime trait part 1.

* wip

* Add support for sudo.

* Finish error handling.

* Fix tests.

* Fix clippy warnings.
2020-06-22 07:39:40 +01:00
David Craven 21d07c6c24 Support embedded full/light node clients. (#91)
* Add support for light clients.

* Add wasm toolchain to ci.

* Fix ci tests.

* Address review comments.

* Use expect instead of unwrap.

* Purge light client chain too.

* Add README section.
2020-06-15 08:01:16 +01: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
Andrew Jones 5f9ebf28da Release v0.8.0 (#117)
* Bump version to 0.8

* Update changelog
2020-05-26 14:53:52 +01: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
Andrew Jones 6e6a8bbd28 Substrate alpha.8 2020-05-22 07:39:35 +01:00
Andrew Jones bec7e47d8c v0.7.0 release extras (#110)
* Explicit proc-macro version for crates.io release

* Upgrade partity-scale-codec

* Add proc-macro crate metadata
2020-05-13 10:16:04 +01:00
Andrew Jones e8b4eb3030 Release v0.7.0 (#109)
* Bump version and update changelog

* Add link to examples in README
2020-05-13 09:13:53 +01: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
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
Andrew Jones b8159efcab Release v0.6.0 (#90)
* Update to substrate alpha 6

* Bump version and add release notes

* Upgrade async-std dev dependency

* Fix readme license links
2020-04-15 09:40:14 +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
Andrew Jones f5eecd746a Use jsonrpsee from crates.io 2020-03-20 11:23:05 +00:00
Andrew Jones b8022a8932 Upgrade parity-scale-codec to 1.2 2020-03-06 12:19:06 +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 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
Andrew Jones a9df35c570 Add FromStr constraint to BlockNumber, bump version (#56) 2019-12-17 12:33:46 +00:00
Andrew Jones 6561535467 Remove pallet crates to improve compilation time (#55) 2019-12-17 11:41:40 +00:00
Andrew Jones daa1415297 Fix contracts instantiation (#51)
* Move contracts tests to contracts module

* Add test for instantiating a contract

* Fix InstantiateArgs encoding

* Ignore PhantomData primitives, they are 0

* Increase endowment and log code hash

* Update SystemEvent

* Fix codec import

* Oops

* Write buffer directly to output to avoid encoding vec

* Debug with StorageChanges encoded as hex

* Logging and format code
2019-12-17 09:39:56 +00:00
Andrew Jones f1926f55cf Update substrate and codec crate aliases (#54)
* Replace substrate crate aliases with actual crate names

* Alias parity-scale-codec to just codec, like in substrate

* Format code
2019-12-16 15:57:48 +00:00
Yuanchao Sun fdb423a7a4 Update package name (#52) 2019-12-13 17:16:36 +00:00
Andrew Jones 625621e6ab New substrate crate renames (#50) 2019-12-02 13:41:20 +00:00
Yuanchao Sun 5108bce467 Fix the module index used to create a encoded func (#47)
* Fix the module index used to create a encoded func

Same as Events, modules with no calls should be ignored when calculating
the module index.

* Update substrate
2019-11-28 12:46:39 +00:00
Andrew Jones a6439500eb Update to latest substrate changes (#48) 2019-11-27 10:54:02 +00:00
Qinxuan Chen 4769b4b016 Use thiserror instead of derive_more (#44)
- Use thiserror instead of derive_more
- Format code
- Fix clippy warnings
- Add LICENSE_TEMPLATE

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2019-11-26 12:09:17 +00:00
Hero Bird 40a8ed3f58 update version 0.2 -> 0.3 (#42) 2019-11-25 09:04:39 +00:00
Andrew Jones 55e067a294 Rename palette -> frame (#41) 2019-11-22 18:35:36 +00:00
Andrew Jones 5242939f4d Rename paint -> palette with pallets (#38) 2019-11-21 10:08:54 +00:00
Andrew Jones 5ec410baeb Bump version to 0.2.0 2019-11-15 18:03:31 +00:00
Andrew Jones b39ff1771a New substrate signing API, srml -> paint rename (#33)
* Update jsonrpc to align with substrate

* Update to new substrate signing

* Default to MultiSignature

* Add missing event type sizes

* Rename TakeFees check to ChargeTransactionPayment

* Fix extrinsic Signature

* Ignore AuthorityList type size

* Rename srml to paint (#32)
2019-11-15 15:04:06 +00:00
Andrew Plaza 32ce13c599 update deps for jsonrpc (#31) 2019-11-06 11:52:08 +00:00
Andrew Jones 58959db9d4 Define node_runtime compatible Runtime types (#23)
* Define default `node_runtime` compatible Runtime

* rustfmt
2019-10-04 17:54:16 +01:00
Andrew Jones 98e3bb8640 Depend on txpool subcrate for Status to avoid big dependency graph (#22) 2019-10-04 09:55:41 +01:00
Andrew Jones 90cb9fc4cc Remove runtime dependency (#21)
* Remove System::Event type

* WIP: removing requirement for concrete Runtime impl for extras

* Use built in substrate types for constructing/signing the extrinsic

* Implement SignedExtension for copied types

* Fix remaining compilation errors

* Allow plugging in of predefined runtime types with blanket impls

* rustfmt

* Add CheckBlockGasLimit

* Construct DefaultExtrinsic in XtBuilder

* Derive Debug for extras

* Replace SignedExtension macro with explicit implementations

* Replace Lookup associated type with Address

* Move balances and contracts to main deps
2019-10-03 18:17:28 +01:00
Andrew Jones ee6db12917 Runtime agnostic Events (#20)
* Introduce OpaqueEvent

* Look up event by module and variant

* Index events by module

* Get events by module

* Dynamically decode events

* Decode System events and EventRecord topics

* Use type sizes to decode raw events

* Remove unused imports

* rustfmt

* Unify error types, fix some compiler errors

* Make dynamic event decoding work

- fix compilation errors
- skip modules with no events when indexing
- preallocate vec for raw event data

* Remove printlns, replace where required with log

* Remove unused import

* Check missing type sizes

* Ignore unknown event arg type sizes

* Decode concrete System events, assumes every Runtime has the module

* Reorganise usings

* pub use some types

* Code docs

* Export Error

* Error Display impls

* Format code
2019-09-26 17:48:25 +01:00
Andrew Plaza f9ae14bdb9 add substrate-rpc-primitives to use NubmerOrHex in rpc.rs (#19) 2019-09-16 11:20:54 +01:00
Yuanchao Sun 650c6d3bb0 Fix compile errors (#17)
* Fix compile errors

* Fix tests, close #13 BTW
2019-09-12 20:31:05 +01:00