Commit Graph

9 Commits

Author SHA1 Message Date
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 625621e6ab New substrate crate renames (#50) 2019-12-02 13:41:20 +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
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
David Craven 151c7f7e0a Refactor (#7)
* Increment nonce when submitting transaction.

* Refactor.

* use default values from metadata
* use functions from metadata

* Nonce fixup

* Add docs.

* Add contracts module.

* Add set_code.

* Add events to metadata.

* Support pretty printing metadata.

* Add subscriptions.

* Add submit_and_watch to XtBuilder.

* nits from review
2019-08-12 17:07:28 +02:00
David Craven 19604e8f2e Use substrate metadata, introduce builder for client (#4)
* Export Error type

* Fix license headers

* Remove unnecessary fully qualified associated types

* Update to parity-scale-codec, handles decoding errors

* rustfmt

* Add metadata.

* Use metadata for calls.

* Refactor generics.

* Storage metadata.

* Use builders.

* Finish making generic.

* Fix merge.

* Run rustfmt.

* Fix merge.
2019-08-08 15:04:50 +01:00
David Craven 6522bb08d0 Misc changes (#2)
* Remove dependency on tokio, submit returns a future
* Enable logging in tests
* Add fetch, fetch_or, fetch_or_default
2019-08-06 15:26:11 +01:00
Andrew Jones 5a046d043e Make generic, removing dependency on node_runtime (#1)
* Extract error to file

* Update readme

* Extract Rpc to separate file

* Make Rpc generic over Runtime

* Editor config etc.

* rustfmt

* Remove node-runtime dependency, generic soup

* Move generic trait bounds to impl

* rustfmt

* Remove unused stuff

* Add test for balance transfer call
2019-08-06 13:12:12 +01:00