Commit Graph

165 Commits

Author SHA1 Message Date
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
v0.5.0
2020-03-25 14:43:03 +00:00
Andrew Jones f5eecd746a Use jsonrpsee from crates.io 2020-03-20 11:23:05 +00:00
Black3HDF bee03e25df Fix submit_and_watch example (#77)
* fix submit_and_watch

* fix event name
2020-03-19 16:08:00 +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 b8022a8932 Upgrade parity-scale-codec to 1.2 2020-03-06 12:19:06 +00:00
Andrew Jones 626cf48df5 Add github workflow CI (#74)
* Create rust.yml

* Add build badge to README

* Fix readme badge link
2020-03-06 12:14:55 +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
Maciej Hirsz 691244fef2 feat: generic Extrinsic on System; Client::storage taking Option<T::Hash>; (#63) 2020-01-14 15:09:01 +00:00
Andrew Jones d9e7848161 Add Ord constraint to System::Hash 2020-01-10 13:39:19 +00:00
Andrew Jones f998444619 Remove unwrap and format code (#62)
* Remove unwrap from metadata fetch

* Format code
2020-01-09 17:26:50 +00:00
Andrew Jones b159d0dae1 Improve dynamic events type sizes API (#61)
* Do not error if type sizes missing: log warn

* Split out EventsSubscriber, allow updating events decoder

* Format code

* Check missing type sizes after registration

* Add example which for submit and watching events
2020-01-07 15:14:30 +00:00
Andrew Jones 80663ec6e3 Support blake2_128Concat key hashing (#60) 2020-01-06 13:22:57 +00:00
Jun Jiang 3aa3598114 Update metadata.rs (#59) 2020-01-06 09:22:10 +00:00
Maciej Hirsz 923013628b Add a method to fetch current finalized head hash (#57)
* chore: Update to latest substrate master renames

* feat: Introduce Client::finalized_head
2019-12-19 16:58: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
Andrew Jones c2097aa2e3 Ignore PhantomData primitives, they are 0 (#53) 2019-12-13 17:20:41 +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
Andrew Jones 02e4826662 Update SystemEvent with DispatchInfo (#45) 2019-11-26 12:49:29 +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 0b39bbbc30 Implement DispatchInfo type for SignedExtension (#39) 2019-11-22 14:55:54 +00:00
Andrew Jones 17abfb49b2 Refactor: simplify module call definitions (#24)
* Refactor: simplify module call definitions

* Fix compilation errors after merge

* Add missing comments and remove unused imports

* Now it compiles
2019-11-21 17:53:45 +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 593646c2bc Update default runtime types to match substrate, format code (#34)
* Update default runtime types to match latest substrate

* Format code
2019-11-15 17:57:38 +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
Thomas Scholtes cb6ed508a3 Event arguments are Vec not HashSet (#27)
Event arguments in the metadata are treated as `Vec` instead of
`HashSet`. This fixes an issue with event arguments of the same name.

For example the `Balances::Transfer` event has four arguments:
`AccountId` (from), `AccountId` (to), `Balance` (value), `Balance`
(fee). Before this change the code would only try to parse the two
distinct arguments `AccountId` and `Balance` and decoding would fail.
2019-11-04 15:00:54 +00:00
Thomas Scholtes 29f8badb85 Don’t panic on storage decode error (#30)
Instead of panicking when the storage data reveived cannot be decoded we
pass on the error.
2019-11-04 14:21:00 +00:00
thiolliere 90eaf321ac fix for substrate master (#29) 2019-10-24 16:10:10 +01:00
Andrew Jones eacf7a6a94 Bump metadata version to V8 (#25) 2019-10-09 16:32:02 +01: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