-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add MirrorNodeState
init with subcomponents
#9793
base: main
Are you sure you want to change the base?
Add MirrorNodeState
init with subcomponents
#9793
Conversation
Signed-off-by: Bilyana Gospodinova <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9793 +/- ##
============================================
+ Coverage 88.72% 92.32% +3.59%
- Complexity 1166 7693 +6527
============================================
Files 378 933 +555
Lines 12135 32252 +20117
Branches 1715 4094 +2379
============================================
+ Hits 10767 29777 +19010
- Misses 1224 1511 +287
- Partials 144 964 +820 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
hedera-mirror-web3/src/test/java/com/hedera/mirror/web3/state/MirrorNodeStateTest.java
Show resolved
Hide resolved
@@ -79,6 +79,10 @@ public static ContractCallContext get() { | |||
return SCOPED_VALUE.get(); | |||
} | |||
|
|||
public static Optional<Long> getTimestamp() { | |||
return SCOPED_VALUE.isBound() ? SCOPED_VALUE.get().timestamp : Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this PR, it seems it might be beneficial to return Optional.of current/instant time. Do we have checks that are connected tightly to have Optional.empty() as return value that won't work with having the instant timestamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a lot of tests we mock that the returned timestamp is Optional.empty()
, so this will break a lot of tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, then for now we can leave it like this.
|
||
private Map<Long, Function<Configuration, Bytes>> genesisContentProviders( | ||
final NetworkInfo networkInfo, final com.swirlds.config.api.Configuration config) { | ||
final var genesisSchema = new V0490FileSchema(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we plan to use dynamically the most recent schema? Having a hardcoded schema will mean we will have to support it and change it from time to time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the example in TransactionExecutorsTest
. I haven't investigated yet if we need to pass here the latest schema. This can be done in a separate PR after we clear up most of the issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, that we can check the schema population and adapt it if needed, in a future PR.
filesConfig.exchangeRates(), genesisSchema::genesisExchangeRates, | ||
filesConfig.networkProperties(), genesisSchema::genesisNetworkProperties, | ||
filesConfig.hapiPermissions(), genesisSchema::genesisHapiPermissions, | ||
filesConfig.throttleDefinitions(), genesisSchema::genesisThrottleDefinitions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would execution fail if we leave only filesConfig.feeSchedules()
and filesConfig.exchangeRates()
to be set?
Signed-off-by: Bilyana Gospodinova <[email protected]>
Signed-off-by: Bilyana Gospodinova <[email protected]>
Signed-off-by: Bilyana Gospodinova <[email protected]>
Quality Gate passedIssues Measures |
Description:
This PR adds the
MirrorNodeState
initialization and subcomponents invocation. Some additional changes were made in order for the init method to finish successfully.It will stay in draft until the PR with the flag introduction is merged.
Fixes #9791