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

ERC20 unit test refactor #80

Merged
merged 6 commits into from
Oct 4, 2023
Merged

Conversation

DefiCake
Copy link
Member

@DefiCake DefiCake commented Sep 30, 2023

This PR:

  • Removes redundancy around the erc20 tests
  • upgrades hardhat (increased setup speed)
  • Moves some code around for better reusability
  • Discards a part of getOrDeployERC721Gateway that was pasted from ERC20 gateway by mistake

@DefiCake DefiCake force-pushed the deficake/erc20-unit-test-refactor branch from 416c914 to b7d90fb Compare September 30, 2023 11:00
@DefiCake DefiCake marked this pull request as ready for review October 1, 2023 20:23
Comment on lines +2 to +3
import type { BigNumberish, BytesLike } from 'ethers';
import { BigNumber as BN, BigNumber, ethers } from 'ethers';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import type { BigNumberish, BytesLike } from 'ethers';
import { BigNumber as BN, BigNumber, ethers } from 'ethers';
import type { BigNumberish, BytesLike } from 'ethers';
import { BigNumber as BN, ethers } from 'ethers';

Haven't seen import type before. Can these two imports be merged?

Copy link
Member Author

Choose a reason for hiding this comment

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

To my knowledge they can be merged, but ESLint will complain about it. It was a rule introduced by @luizstacio if I recall correctly, it might have something to do with how the monorepo packages the typings etc.

return _messageSender;
}

function sendMessage(bytes32, bytes calldata) external pure {}
Copy link
Contributor

Choose a reason for hiding this comment

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

What purpose does this empty function serve?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is a mock contract - so it just implements the interface to accept these calls.

packages/solidity-contracts/protocol/utils.ts Outdated Show resolved Hide resolved
packages/solidity-contracts/test/erc20Gateway.ts Outdated Show resolved Hide resolved
@DefiCake DefiCake requested a review from Braqzen October 3, 2023 16:15
@DefiCake DefiCake merged commit f084b8e into main Oct 4, 2023
@DefiCake DefiCake deleted the deficake/erc20-unit-test-refactor branch October 4, 2023 07:06
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