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

Move evm logic to evm utils #521

Merged
merged 12 commits into from
Jul 25, 2022
Merged

Move evm logic to evm utils #521

merged 12 commits into from
Jul 25, 2022

Conversation

ErnoW
Copy link
Member

@ErnoW ErnoW commented Jul 21, 2022


name: 'Pull request'
about: A new pull request

New Pull Request

Checklist

  • I am not disclosing a vulnerability.
  • My code is conform the code style
  • I have made corresponding changes to the documentation
  • I have updated Typescript definitions when needed

Issue Description

  • Moved all Evm dataTypes to evm-utils
  • Moved register of config of formatEvmAddress and formatEvmChainId to evm-utils
  • Moved register of config of defaultEvmApiChain to evm-api

Other fixes/improvements

  • Naming of setupEvmApi
  • Config of eslint was broken (syntax error)
  • Fixed versioning of newly created packages
  • cache format function in nx
  • Fix prettier versioning as devDependency
  • Fix building of test-node demo app by using symLinked packages when building

@ErnoW ErnoW requested review from b4rtaz and sogunshola July 21, 2022 19:29
@changeset-bot
Copy link

changeset-bot bot commented Jul 21, 2022

🦋 Changeset detected

Latest commit: beaae52

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
test-node Patch
@moralisweb3/api Patch
@moralisweb3/auth Patch
@moralisweb3/core Patch
@moralisweb3/evm-api Patch
@moralisweb3/evm-utils Patch
@moralisweb3/integration Patch
moralis Patch
@moralisweb3/sol-api Patch

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

@ErnoW ErnoW mentioned this pull request Jul 21, 2022
4 tasks
Copy link
Collaborator

@b4rtaz b4rtaz left a 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.

Comment on lines 32 to 33
"@ethersproject/bignumber": "^5.6.0",
"@ethersproject/units": "^5.6.0",
Copy link
Collaborator

@b4rtaz b4rtaz Jul 22, 2022

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?

Copy link
Member Author

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.

Comment on lines 6 to 11
if (!config.hasKey(EvmUtilsConfig.formatEvmAddress)) {
config.registerKey(EvmUtilsConfig.formatEvmAddress);
}

if (!config.hasKey(EvmUtilsConfig.formatEvmChainId)) {
config.registerKey(EvmUtilsConfig.formatEvmChainId);
Copy link
Collaborator

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.

import { MoralisCoreProvider } from '@moralisweb3/core';
import { MoralisEvmUtils } from '../MoralisEvmUtils';

export const setupEvm = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be setupEvmUtils().

@b4rtaz b4rtaz enabled auto-merge (squash) July 22, 2022 09:50
@b4rtaz b4rtaz disabled auto-merge July 25, 2022 10:05
@b4rtaz b4rtaz self-requested a review July 25, 2022 10:05
@b4rtaz b4rtaz merged commit 61b8759 into alpha Jul 25, 2022
@b4rtaz b4rtaz deleted the move-evm-logic-to-evm-utils branch July 25, 2022 10:08
@github-actions github-actions bot mentioned this pull request Aug 10, 2022
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