* Sketch out how to support different bridge pallet instances
* Create a common interface for using pallet instances
* Start introducing generic instance parameter
Attemps to make the compiler happy, but I'm having second thoughts about
this approach. Commiting now as a way to have a checkpoint, but I think
I'm going to need to re-consider my approach here.
Ideally I want a change which introduces minimal changes, but this seems
to be propagating around the codebase in ways I don't want.
* Use trait objects instead of generics
* Implement traits for Boxed trait objects
This is done in order to statisfy trait bounds by types
which use these new trait objects
* Remove Clone usage for sync parameters
* Remove implementation of Default for sync params
* Require that BridgeInstance implements Debug
* Ensure that BridgeInstance trait implements Send/Sync
* Add documentation related to instances
* Rust Fmt
* Remove needless format
* Make instance CLI option case insensitive
* Replace `with_*` constructors with `new`
* Clean up usage of instance structs
* Enforce a default instance in the CLI params
* Build sync params as we process input from CLI
* Remove case insensitivity from sub-tx-mode
I think this should happen, but maybe as part of a different PR
* Process default Eth contract deployment config in CLI
* Build EthereumExchangeParams in CLI
* Process EthereumExchangeSubmitParams params in CLI
* fixed PoA contract deploy (granda_authorities call)
* pause if all submitted headers were rejected
* give funds to Bertha and Carlos
* max 1 active PoA transaction in headers sync :(
* display initial header id when deploying PoA contract
* cargo fmt + clipy
* fix compilation
* Update relays/ethereum/src/sync_types.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Update relays/ethereum/src/utils.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Move EthereumRpc implementation to Eth client
* Move SubstrateRpc implementation to SubstrateClient
* Update deploy_contract to use new RPC interface
* Fix some types in the Substrate client
* Swap out method bodies in Eth sync loop
* Swap out method bodies in Substrate sync loop
* Remove Client from SourceClient trait return types
* Remove Client from TargetClient trait return types
* Remove client from Source select! arms
* Remove client from Target select! arms
* Add missing mutable refs in Substrate client
* Use mutable references in Source/Target Client traits
* Try and use mutable references in Source/Client trait implementations
* Handle errors more gracefully
* Remove unused imports
* Remove dead_code and unused_variables lints
* Remove usage of `jsonrpsee::RawClient`
By using a `jsonrpsee::Client` we are able to remove all the shared
mutable references required when interacting with the RPC server. This
is convenient as trying to sharing mutable references in code that uses
async/await is a bit of a pain.
However, using a `Client` instead of a `RawClient` is not yet supported
by the `jsonrpsee::rpc_api` macro, so a fork must be used for the moment.
* Clean up dead code and warnings
* Clean up higher level RPCs
Some of the RPCs that were "high level" didn't necessarily belong
as part of the trait, so they were removed.
* Use positional parameters for RPCs
Both Substrate and Ethereum's RPCs use positional (array) parameters,
so in order to be compatible with both we need to make sure that
our API is defined with positional paramters in mind.
* Rename argument for eth_getBlockByNumber
* Remove some unecessary Ok-wraps
* Process client requests synchonously
Before the refactoring the sync loop would wait until a client finished
handling a request before issuing another one. This behaviour was
inadvertently changed during the refactoring leading to race conditions.
This commit makes sure that the previous behaviour is respected.
* Reduce the errors that are considered a connection error
* Only decode bridge contract once
* Set genesis_config at RPC client startup
* Fetch genesis hash in SubstrateRpcClient::new()
* Move Decode error into SubstrateNodeError
* Suppress warnings caused by `rpc_api!`
* Implement From RpcError for String
* Handle Substrate client initalization errors more gracefully
* Remove match in favour of ?
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
* Use async_trait for SourceClient
* Use aync_trait for TargetClient
* Revert async_trait usage for Source/Target client
This reverts commit f636ffaffd60197e90e887362b4a0c35a0dc5a6c.
This reverts commit 2c15755e8c93318f8e0a605852efe87d72edb769.
I'm having a very hard time finding out what is causing compilation
issues, and I think it's best to start over again.
* Use async_trait for TargetClient
* Use async_trait for SourceClient
* Move where non-async methods are
* RustFmt
* QueuedHeader holds Arc to actual data
* Clean up async return type
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
* Clean up async return type
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
* Clean up async return type
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
* Remove unused import
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>