-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add Filecoin FEVM #662
Add Filecoin FEVM #662
Conversation
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.
Thanks for cleaning this up. Can you move the Filecoin commits to the end of the pull request? That way we just have some clean refactoring, followed by a new currency that uses the fresh features.
// { | ||
// filfoxUrl: 'https://filfox.info/api/v1', | ||
// filscanUrl: 'https://api-v2.filscan.io/api/v1', | ||
// hdPathCoinType: 461, |
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.
hdPathCoinType
already exists below.
}, | ||
|
||
async getInnerPlugin() { | ||
/* webpackChunkName: "filecoinfevmcalibration" */ |
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.
Delete this webpackChunkName
. The ethereumInfo
file defines the chunk name for the Ethereum sources, so this line will conflict with that.
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 thought ethereumInfo
was a peer of all the other EVM info files. Looks like you're right that those other info files don't have the webpackChunkName set for them, but I'm curious as to why? Wouldn't it make sense to chunk each info file as they're slurped up by ethereumInfos.ts
(the index file of all the other EVM infos, not the info file for Ethereum)?
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.
The webpackChunkName comment gives the final name of the file being imported in this import()
expression. So we are saying that, once bundled on disk, the "EthereumTools.ts" file should be called "ethereum-[hash].js". This bundled file will include "EthereumTools.ts" (of course), but also any unique transitive dependencies not shared with other chunks. So we would expect files like "EthereumEngine.ts" to also get bundled into "ethereum-[hash].js", along with some SDK bits from node_modules.
This is completely unnecessary on a technical level. Nobody is going to see the file names that get embedded into the app, and filenames don't matter to the WebView either. However, it does sometimes help with debugging packaging problems and with better stack traces, so it's worth doing.
src/ethereum/EthereumNetwork.ts
Outdated
[method in UpdateMethods]: Array< | ||
(...args: any[]) => Promise<EthereumNetworkUpdate> | ||
> | ||
type NetworkAdaptorUpdateMethod = 'blockheight' | 'nonce' | 'tokenBal' | 'txs' |
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.
Should this be keyof NetworkAdaptor
, instead of hard-coding it?
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.
Later in the PR, not all keys are update methods. Perhaps I can couple the types though using TS utility types.
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.
Oh, that makes sense.
9a8c421
to
dfd9ad8
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.
Excellent work!
bcb0a9a
to
88fd389
Compare
This makes the method names clearer that they're are retrieval methods.
Now that the call signature for `EthereumNetwork.multicastRpc` matches `NetworkAdaptor.multicastRpc`, there is no need for the case handling for each method.
88fd389
to
cbe08ea
Compare
cbe08ea
to
786e371
Compare
Now that the call signature for
EthereumNetwork.multicastRpc
matchesNetworkAdaptor.multicastRpc
, there is no need for the case handlingfor each method.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
none