hashgraph / hedera-json-rpc-relay

Implementation of Ethereum JSON-RPC APIs for Hedera
Apache License 2.0
68 stars 72 forks source link

feat: Added ability to load spending plans from environment variable.… #3201

Closed ebadiere closed 2 weeks ago

ebadiere commented 2 weeks ago

Cherry-pick. Added the ability to load spending plans from environment variable.

Issue: #3153

… (#3153)

fix: removed .only

fix: Cleaned up file and env var evaluation.

fix: Flaky unit test fix.

feat: Refactored implementation and updated tests.

fix: Test fix.

fix: Removed irrelevant test since we now use either env var or file for spending plan.

fix: Updated HBAR_SPENDING_PLANS_CONFIG from HBAR_SPENDING_PLANS_CONFIG_FILE

fix: Cleanup.



Description:

Related issue(s):

Fixes #

Notes for reviewer:

Checklist

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 2 weeks ago

Test Results

 20 files   -   3  256 suites   - 46   34m 4s :stopwatch: +43s 604 tests +  3  597 :white_check_mark: +  9  4 :zzz: +1  3 :x:  - 7  641 runs   - 198  634 :white_check_mark:  - 192  4 :zzz: +1  3 :x:  - 7 

For more details on these failures, see this check.

Results for commit d1109797. ± Comparison against base commit 1af16a2a.

:recycle: This comment has been updated with latest results.

codecov[bot] commented 5 hours ago

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.76%. Comparing base (1af16a2) to head (d110979). Report is 14 commits behind head on release/0.59.

Files with missing lines Patch % Lines
...ay/src/lib/config/hbarSpendingPlanConfigService.ts 84.61% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/0.59 #3201 +/- ## ================================================ - Coverage 83.39% 82.76% -0.64% ================================================ Files 66 69 +3 Lines 4283 4451 +168 Branches 835 875 +40 ================================================ + Hits 3572 3684 +112 - Misses 471 515 +44 - Partials 240 252 +12 ``` | [Flag](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Δ | | |---|---|---| | [config-service](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `98.14% <ø> (ø)` | | | [relay](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `85.54% <85.71%> (-0.06%)` | :arrow_down: | | [server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `83.52% <ø> (ø)` | | | [ws-server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `36.87% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Δ | | |---|---|---| | [...ckages/config-service/src/services/globalConfig.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201?src=pr&el=tree&filepath=packages%2Fconfig-service%2Fsrc%2Fservices%2FglobalConfig.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvY29uZmlnLXNlcnZpY2Uvc3JjL3NlcnZpY2VzL2dsb2JhbENvbmZpZy50cw==) | `100.00% <ø> (ø)` | | | [...kages/relay/src/lib/clients/cache/localLRUCache.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Fclients%2Fcache%2FlocalLRUCache.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi9jbGllbnRzL2NhY2hlL2xvY2FsTFJVQ2FjaGUudHM=) | `98.46% <100.00%> (+4.71%)` | :arrow_up: | | [...ay/src/lib/config/hbarSpendingPlanConfigService.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Fconfig%2FhbarSpendingPlanConfigService.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi9jb25maWcvaGJhclNwZW5kaW5nUGxhbkNvbmZpZ1NlcnZpY2UudHM=) | `95.49% <84.61%> (-2.60%)` | :arrow_down: | ... and [12 files with indirect coverage changes](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3201/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph)

🚨 Try these New Features: