-
Notifications
You must be signed in to change notification settings - Fork 260
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
Move evm logic to evm utils #521
Conversation
🦋 Changeset detectedLatest commit: beaae52 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Just 3 remarks. Good job.
"@ethersproject/bignumber": "^5.6.0", | ||
"@ethersproject/units": "^5.6.0", |
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 need these dependencies here?
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.
Only as long as it is being used by the Sol datatypes in core.
if (!config.hasKey(EvmUtilsConfig.formatEvmAddress)) { | ||
config.registerKey(EvmUtilsConfig.formatEvmAddress); | ||
} | ||
|
||
if (!config.hasKey(EvmUtilsConfig.formatEvmChainId)) { | ||
config.registerKey(EvmUtilsConfig.formatEvmChainId); |
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 think this approach is wrong. This approach hides modules usage errors. You should get an error, if you use the module system in wrong way.
packages/evmUtils/src/test/setup.ts
Outdated
import { MoralisCoreProvider } from '@moralisweb3/core'; | ||
import { MoralisEvmUtils } from '../MoralisEvmUtils'; | ||
|
||
export const setupEvm = () => { |
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 be setupEvmUtils()
.
name: 'Pull request'
about: A new pull request
New Pull Request
Checklist
Issue Description
evm-utils
formatEvmAddress
andformatEvmChainId
toevm-utils
defaultEvmApiChain
toevm-api
Other fixes/improvements
setupEvmApi