This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
feat(investor-foxy): switch from web3 to ethers and JsonRpcBatchProvider #1032
Open
gomesalexandre
wants to merge
17
commits into
main
Choose a base branch
from
feat_investor_foxy_ethers_js_batch_provider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
gomesalexandre
force-pushed
the
feat_investor_foxy_ethers_js_batch_provider
branch
2 times, most recently
from
September 20, 2022 18:31
61f8257
to
2fa46a9
Compare
gomesalexandre
commented
Sep 21, 2022
Comment on lines
+86
to
+88
public provider: JsonRpcBatchProvider | ||
private providerUrl: string | ||
public jsonRpcProvider: JsonRpcProvider | ||
public web3: Web3 | ||
private foxyStakingContracts: Contract[] | ||
private liquidityReserveContracts: Contract[] | ||
public jsonRpcProvider: JsonRpcBatchProvider |
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 still need both?
gomesalexandre
commented
Sep 21, 2022
gomesalexandre
commented
Sep 21, 2022
const sendSignedTx = await this.web3.eth.sendSignedTransaction(signedTx) | ||
return sendSignedTx?.blockHash | ||
const sendSignedTx = await this.provider.sendTransaction(signedTx) | ||
return sendSignedTx?.blockHash ?? '' |
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 is conforming to the sendTransaction
return type - runtime logic didn't change here
gomesalexandre
commented
Sep 21, 2022
gomesalexandre
commented
Sep 21, 2022
gomesalexandre
commented
Sep 21, 2022
gomesalexandre
commented
Sep 21, 2022
Comment on lines
+973
to
+974
amount, | ||
gons, | ||
expiry, |
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.
Explicit vs. implicit, this was previously rugged
Opening for early review, added self-review comments |
This was referenced Dec 8, 2022
gomesalexandre
force-pushed
the
feat_investor_foxy_ethers_js_batch_provider
branch
from
December 9, 2022 14:58
de36c42
to
65dbd5f
Compare
…ializable string outputs
gomesalexandre
force-pushed
the
feat_investor_foxy_ethers_js_batch_provider
branch
from
December 31, 2022 00:33
65dbd5f
to
7a69378
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This switches the current investor-foxy API implementation from web3.js to ethers.js, to be able to use JsonRpcBatchProvider.
web3.js also provides a
BatchRequest
API, unfortunately after spending more than a day on it, it seems like that API is rugged currently and isn't compatible with our programmatic calls with blockNumber specified.Batch promises together so the underlying JSON RPC calls are automagically batched byThis will better live in a follow-up PR. Let's get the switch to ethers.js merged first, and then we can improve the business logicJsonRpcBatchProvider
Issue
N/A
Risks
Everything FOXy could be borked - test locally against latest
@shapeshiftoss/investor-foxy
.