-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: move NightshadeRuntime to chain #10675
Conversation
d0cf8aa
to
8169346
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10675 +/- ##
==========================================
- Coverage 72.28% 72.26% -0.02%
==========================================
Files 732 734 +2
Lines 150408 150457 +49
Branches 150408 150457 +49
==========================================
+ Hits 108716 108732 +16
- Misses 36753 36781 +28
- Partials 4939 4944 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
8169346
to
731ff7c
Compare
Could you please expand on this part? Why is it necessary to make it possible to use it in a chain? There's a leap in the reasoning between this and the goal to get rid of the Mock thingy. |
Wow this is a big refactor. I can't really get through it today because unfortunately a lot of these changes are hard to review because they are moved around, but am I right that the only changes are to move code around and not to do anything else at all? |
@robin-near yes, this change is purely about moving the code around, nothing else is changed. |
In #10675 some of the constants and testing-related methods from `nearcore::config` were copied to `near_chain_configs::test_utils`. This PR removes it from `nearcore::configs` and replaces all the usages to take it from `near_chain_configs`. Also some of the constants are used not only for testing, so those are moved directly to `near_chain_configs`. Also wrap tests inside `nearcore::config` into `mod tests` because that is how it should be. This change doesn't introduce any functional changes to the codebase, it only moves code around.
This PR is a part of getting rid of
KeyValueRuntime
(#10678) andMockEpochManager
(#10634).Currently
NightshadeRuntime
is part ofnearcore
which makes it impossible to use it inchain
sincechain
depends onnearcore
. We need to useNightshadeRuntime
as a replacement forKeyValueRuntime
inchain
tests. Ideally it would be great to move it tonode-runtime
crate, but currently it has a lot of dependencies fromnear_chain
which makes it very challenging, so as the first step let's move it tochain
.This PR includes:
nearcore::runtime
tonear_chain::runtime
NightshadeRuntimeExt
to exposeNightshadeRuntime::from_config
separately sinceNearConfig
is part ofnearcore
GenesisExt
test methods directly toGenesis
, also duplicate some constants for now (will be refactored separately to reduce size of this PR).chain