-
Notifications
You must be signed in to change notification settings - Fork 20
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
Sol Balance VC with an abort strategy example implementation #2572
Conversation
result = *item; | ||
|
||
if *item == "item4" { | ||
return Ok(false) |
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.
nitpick: should we pass an optional named struct for better readability? i.e. return Ok(LoopControls.Break)
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.
resolved now
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 general, it looks very good. I left two small comments. The main idea is to introduce the less env variable the better.
@@ -130,6 +130,7 @@ services: | |||
- SORA_QUIZ_MASTER_ID=SORA_QUIZ_MASTER_ID | |||
- SORA_QUIZ_ATTENDEE_ID=SORA_QUIZ_ATTENDEE_ID | |||
- MORALIS_API_URL=http://localhost:19527 | |||
- MORALIS_SOLANA_API_URL=http://localhost:19527/moralis_solana/ |
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.
Can we just use MORALIS_API_URL
? Add the extra part with code?
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.
moralis_api_url is totally different from moralis_solana_api_url, I think this way is better than merging them together
moralis_api_url: "https://deep-index.moralis.io/api/v2.2/".to_string(),
moralis_solana_api_url: "https://solana-gateway.moralis.io/".to_string(),
@@ -308,6 +310,9 @@ impl DataProviderConfig { | |||
if let Ok(v) = env::var("MORALIS_API_URL") { | |||
config.set_moralis_api_url(v)?; | |||
} | |||
if let Ok(v) = env::var("MORALIS_SOLANA_API_URL") { |
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.
These two branches can be merged together.
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.
same as above, not worth merging them
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 only checked the AbortStrategy
impl part, looks good!
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.
If there is no strong reason, I still insist to MORALIS_SOLANA_API_URL
.
* P-583: add sol token balance * P-298: add abort strategy for calling dp with multiple account * fix clippy * optimize morails_api_url mock config, add enum LoopControls for the loop_with_abort_strategy * add missed batch vc config --------- Co-authored-by: higherordertech <higherordertech>
Context
Labels
Please apply following PR-related labels when appropriate:
C0-breaking
: if your change could break the existing client, e.g. API change, critical logic changeC1-noteworthy
: if your change is non-breaking, but is still worth noticing for the client, e.g. reference code improvementHow (Optional)
Testing Evidences
Please attach any relevant evidences if applicable