lighthouse-pulse/beacon_node
Paul Hauner 38050fa460 Allow TaskExecutor to be used in async tests (#3178)
# Description

Since the `TaskExecutor` currently requires a `Weak<Runtime>`, it's impossible to use it in an async test where the `Runtime` is created outside our scope. Whilst we *could* create a new `Runtime` instance inside the async test, dropping that `Runtime` would cause a panic (you can't drop a `Runtime` in an async context).

To address this issue, this PR creates the `enum Handle`, which supports either:

- A `Weak<Runtime>` (for use in our production code)
- A `Handle` to a runtime (for use in testing)

In theory, there should be no change to the behaviour of our production code (beyond some slightly different descriptions in HTTP 500 errors), or even our tests. If there is no change, you might ask *"why bother?"*. There are two PRs (#3070 and #3175) that are waiting on these fixes to introduce some new tests. Since we've added the EL to the `BeaconChain` (for the merge), we are now doing more async stuff in tests.

I've also added a `RuntimeExecutor` to the `BeaconChainTestHarness`. Whilst that's not immediately useful, it will become useful in the near future with all the new async testing.
2022-05-16 08:35:59 +00:00
..
beacon_chain Allow TaskExecutor to be used in async tests (#3178) 2022-05-16 08:35:59 +00:00
client Allow TaskExecutor to be used in async tests (#3178) 2022-05-16 08:35:59 +00:00
eth1 v2.2.0 (#3139) 2022-04-05 02:53:09 +00:00
execution_layer Allow TaskExecutor to be used in async tests (#3178) 2022-05-16 08:35:59 +00:00
genesis Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
http_api Allow TaskExecutor to be used in async tests (#3178) 2022-05-16 08:35:59 +00:00
http_metrics Support IPv6 in BN and VC HTTP APIs (#3104) 2022-03-24 00:04:49 +00:00
lighthouse_network [refactor] Refactor Option/Result combinators (#3180) 2022-05-16 01:59:47 +00:00
network Allow TaskExecutor to be used in async tests (#3178) 2022-05-16 08:35:59 +00:00
operation_pool Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
src Fix SPRP default value in cli (#3145) 2022-04-07 04:04:11 +00:00
store Separate execution payloads in the DB (#3157) 2022-05-12 00:42:17 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Update to Rust 1.59 and 2021 edition (#3038) 2022-02-25 00:10:17 +00:00
Cargo.toml v2.2.1 (#3149) 2022-04-12 02:52:12 +00:00