Skip to content
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

make some functions async and await calls #77

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

clangenb
Copy link
Contributor

It is general considered best practice to await or return promises within functions, and only decide to await or not await on the outermost function call to prevent some unforeseen effects.

I tested with this:

  • shielding
  • unshielding
  • private tx

All works very fast now.

@@ -1487,6 +1489,9 @@ const fetchNetworkStatus = async () => {
systemHealth.setShieldingTargetLightClientGenesisHashHex(genesis_hash);
}
});
promises.push(p2);

await Promise.all(promises);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like

@brenzi brenzi merged commit 5eed4a0 into master Oct 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants