-
Notifications
You must be signed in to change notification settings - Fork 97
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
chore(ctx): replace gstuff constructible with oncelock #2267
Conversation
mm2src/mm2_core/src/mm_ctx.rs
Outdated
use lazy_static::lazy_static; | ||
use libp2p::PeerId; | ||
use mm2_event_stream::{controller::Controller, Event, EventStreamConfiguration}; | ||
use mm2_metrics::{MetricsArc, MetricsOps}; | ||
use once_cell::sync::OnceCell; |
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.
Why not OnceLock from the standard library?
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.
ah thanks!, I promise, I didn't know this is stable already..also I've had OnceCell
on my mind for a long 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.
One comment inline, LGTM otherwise :)
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.
non-blockers.
LGTM :)
ad5dc59
to
72018af
Compare
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.
LGTM!
* feat(LRAPI): add 1inch classic swap rpc (#2222) This commit adds initial code to connect to 1inch Liquidity Routing API (LRAPI) provider and two new RPCs to use 1inch classic swap API. It also adds 'approve' and 'allowance' RPCs (for ERC20 tokens). * chore(release): bump mm2 version to 2.3.0-beta (#2285) * improvement(error-handling): main files (#2288) Makes KDF to check main files (config/coins/etc..) before reading them to prevent potential panics. * fix(rpc): remove character check blocking password input (#2287) This commit removes check for <, >, & characters in RPC request bodies that was incorrectly blocking valid password characters in get_mnemonic RPC call. These special characters should be allowed in passwords. This aligns native behavior with WASM implementation. * don't rely on core (#2289) Signed-off-by: onur-ozkan <work@onurozkan.dev> * chore(ctx): replace gstuff constructible with oncelock (#2267) * chore(adex-cli): use "Komodo DeFi Framework" name in adex_cli (#2290) * bump libp2p (#2296) Signed-off-by: onur-ozkan <work@onurozkan.dev> --------- Signed-off-by: onur-ozkan <work@onurozkan.dev> Co-authored-by: dimxy <dimxy@komodoplatform.com> Co-authored-by: Onur Özkan <work@onurozkan.dev> Co-authored-by: Samuel Onoja <samiodev@icloud.com> Co-authored-by: DeckerSU <support@decker.su>
#1309
Replaced
Constructible
from thegstuff
crate withonce_cell::sync::OnceCell
for managing lazy-initialized values inmm_ctx
for better performance and stronger thread safety.also add a slight improvement to
from_ctx