* deps: update jsonrpsee 0.2.0
The motivation is to avoid pinning certain alpha versions and to avoid
breaking users builds without having to some `Cargo.lock` updating.
* cargo fmt
* fix tests
* fix a few clippy lints
* cargo fmt
When we build a `Client` for a substrate chain, we can only access the
methods exposed in `Client` which does not cover all the RPC interfaces
in the chain, it's not feasible to request the methods like `chain_getKeys`
with `Client` only. The downstream user of this library has to build another
`RpcClient` for the uncovered RPC interfaces, which can be unneccessary.
* Remove integration-tests feature, use test node process
* Allow tests to run in parallel
* Fmt
* Fix errors
* Fix more errors
* Use test node process in test context
* Remove code for managing accounts for contract tests
* Update contract dispatchables
* Fix up contract calls for 3.0 compat
* Fmt
* Fix up some tests
* Fix some more tests
* Fix some more tests
* Fmt
* Move tests to module in own file
* Add test-node-proc crate
* Move test node to main lib, fix compilation errors
* Fmt
* Attempted port scanning
* Use global static port to allocate open ports
* Register missing type sizes
* Fix port scanning and balances test
* Don't wait for blocks on insert_jey test
* Fmt
* Remove unused dependencies
* Download v3.0.0 rust binary
* Move substrate bin to home dir
* Add test instructions to README
* Figure out the $PATH
* Remove path echo
* Add check for missing substrate binary on the PATH
* @niklasad1 review: don't include client feature for tests
* implement session handling for unsubscribe in subxt-client
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
* update jsonrpsee to `v0.2.0-alpha.2`
Closes#241
* use new jsonrpsee request message types in subxt client
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
* hacky integration with jsonrpsee v2
* stray todos
* fmt
* add http support
* make test build compile
* Update src/rpc.rs
* bring back set_client
* use crates.io version jsonrpsee
* WIP: workaround for embedded subxt client (#236)
* workaround for embedded subxt client
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
* increase default channel size on subxt client
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
* remove client tests due to inference problem on From
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
* add comments for missing impls
* more verbose errors
* make subscription notifs buffer bigger
* fmt
Co-authored-by: Greg Hill <gregorydhill@outlook.com>
* Global registration of type segmenters for event decoding
* Perform type sizes check when building client
* Introduce EventTypeRegistry for global runtime type sizes
* Fmt
* Register runtime type sizes on creation of EventTypeRegistry
* Register more default dispatch types
* Add missing type sizes
* fmt
* Fix up register_type_size builder method
* Update doc comments
* Make register_default_type_sizes public
* Don't allow duplicate registered types
* Remove call to supertraits type registration, done manually in Runtime
* Fix tests and warnings
* Fix duplicate type registration
* Fmt
* review: use is_empty()
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
* Add panic docs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
* Refactor event type decoding hand declartion
Fixes#196, #181, #28
## Dyanmic sized types
Before this change, the event decoder assume all the event types
have fixed sizes. Some counterexamples are: Hashes, AuthorityList.
In this change, instead of decoding by skipping the fixed-length bytes,
we introduce `type_segmenter` registry which decodes the raw event
bytes with the actual scale codec. So variable length types can be
handled correctly.
## New attribute for pallet type definition
In the past, trait associated type is the only way to add types to
the EventsDecoder implementation of a pallet. But in reality it's
common that the events in a pallet references some types not defined
in the trait associated types. Some examples are: `IdentificationTuple`
and `SessionIndex` in Session pallet.
In this change, we introduce more attributes to add the types:
```rust
#[module]
trait Pallet: System {
#![event_type(SomeType)]
#![event_alias(TypeNameAlias = SomeType)]
#![event_alias(SomeOtherAlias = TypeWithAssociatedTypes<T>)]
}
```
## Tested
Compile with `nightly-2020-10-01`; smoke test to sync a full
Phala bockchain.
* Format code
* Make rustfmt::skip an outer attribute
* Ignore the sample code
* Alias the event segmenter closure
* Copy AuthorityList from sp_finality_grandpa
* Remove the unused static event type size
* Make segmenter as a trait, resue grandpa::Public
* Wrap PhantomData in struct TypeMarker
* Add Balances Locks
* Pass fmt
* Add tests for Balances Locks
In order to write this test, I just added the new staking::BondCall :).
* .
* In case you want to run multiple tests at the same time
* Return Result in integration test
* Derive `Clone` for `PairSigner`
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
* Specify the date of nightly toolchain to fix CI
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
* Upgrade to substrate 2.0.0
* WIP implement Subcommand manually (see https://github.com/paritytech/substrate/pull/6894#issuecomment-676060197)
* Add pallet-staking/std to the std feature
* Sort out the subcommand impl
* Sort out the module index (ty @ascjones)
Sort out the RefCount type (ty @dvc94ch)
Random tweaks to make test-node more similar to the vanilla node-template
* obey the fmt
* Add changelog and bump versions
* Merge #165 and update CHANGELOG
* Update test-node/runtime/src/lib.rs
Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>
* Update CHANGELOG.md
Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>
Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>
* Revert contracts put_code test to pure code (not using the macro)
* Test contract instantiate
* Fmt
* Extract put_code and new_client functions
* Generate fresh accounts for contract tests to allow reruns without a chain purge
* Fetch and increment nonce to allow concurrent test runs
* fmt
* Failing contract call test
* Fmt and fix compilation
* Fix error message for contract call
* Fix call test
* Update contract execution event comment
* Remove redundant feature flags, now on module
* Update event data comment
* Use fetch_add
* Fmt
* Upgrade to substrate 2.0.0
* WIP implement Subcommand manually (see https://github.com/paritytech/substrate/pull/6894#issuecomment-676060197)
* Add pallet-staking/std to the std feature
* Sort out the subcommand impl
* Sort out the module index (ty @ascjones)
Sort out the RefCount type (ty @dvc94ch)
Random tweaks to make test-node more similar to the vanilla node-template
* obey the fmt
* cleanup
* more cleanup
* Initial Staking API
* Add more staking types
* Reformat
* Remove dead code
* Fix missing documentation
* Reformat
* Staking: use proc macros
* Add partial session support
* Reformat
* Try to implement nomination
This currently fails with compilation errors I do not understand.
* Use the #[module] macro
This fixes a compile error
* Explain undefined method diagnostics
* Use ‘#[module]’ and implement session for Kusama
* Don’t impl ‘Staking’ for all ‘T: System’
* Add staking payout support
* Fix compilation errors and remove useless lifetimes
* Respond to code review
This fixes most of the issues found during review, with the exception of
tests.
* 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).
* Reformat
* Refactor as suggested by Andrew Jones (@ascjones).
* Trait cleanups
* Make the `Signer` impl require Send + Sync
This is what Ledgeracio needs.
* Use the correct key for staking maps
They use the key type, not ‘PhantomData’.
* Implement set_payee call
* Switch to associated types for Staking
* Implement `set_keys`
This is needed for Ledgeracio.
* Remove impl of Signer for Box<dyn Signer + Send + Sync>
It isn’t needed, since Box implements Deref.
* Fix Polkadot and Kusama ‘SessionKey’ structs
I had failed to include the ‘Parachains’ component, which the default
Substrate runtime doesn’t have.
* Include a copy of `ValidatorId`
This avoids needing to depend on Polkadot.
* Fix syntax error in Cargo.toml
* Fix compile errors
* Add Debug impls
* Fix return type of `BondedStore`
* Use some upstream type definitions
Also add `Default` impls.
* Bump deps and fix build
* Remove last reference to Kusama feature
* Fix compilation errors
* Implement the `concat` in `twox_64_concat`
* Expose properties and per-era preferences
* Era rewards point support
I also did some refactoring.
* Expose clipped exposure
* Era reward points support
* Make `PayoutStakersCall` public
* Add in all default features for debugging
* Chill support and update to latest Substrate
* If property fetch fails, use dummy values
* Fix tests
* Fix header
* Remove some code Ledgeracio does not need
* More deletions
* Remove more code not needed for Ledgeracio
* Remove a pointless change in Cargo.toml
w.r.t. upstream.
* Remove more junk
* Revert contracts put_code test to pure code (not using the macro)
* Test contract instantiate
* Fmt
* WIP
* Add some more submission tests
* Reformat
* More tests
* Cleanup
* Hopefully fix CI
* Remove dead code
* Test chill
* Add missing docs
* Remove unnecessary use
* Revert "Remove unnecessary use"
This reverts commit bc8bc36bde581f1892ea88a778dfe0fe5bff24d7.
* Retry on temporary failures
* Ignore the staking tests on CI
* Obey the fmt
* Run CI with at most one test thread
* Implement tests for staking
* More tests
* Remove unhelpful println!
* Revert changes in contract tests
* Reformat
* Remove spurious diff
* More tests
Co-authored-by: Demi M. Obenour <demiobenour@gmail.com>
Co-authored-by: David Palm <dvdplm@gmail.com>
Co-authored-by: Andrew Jones <ascjones@gmail.com>