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

Manager - Code Hygiene #312

Merged
merged 11 commits into from
Apr 10, 2023
Merged

Manager - Code Hygiene #312

merged 11 commits into from
Apr 10, 2023

Conversation

ItsLuized
Copy link
Contributor

@ItsLuized ItsLuized commented Mar 29, 2023

This pull request improves the code quality of manager.

To make the code hygiene of manager as it was discussed in arch week n1, the following fixes were done:

  • Move ABI functions to common package
  • Validate Body and Query parameters with express-validator
  • Remove 'as any' from 'req.body'

(There is a relative import of rpch/common because of file needed)

Closes #304

- Move ABI functions to common package
- Validate Body and Query parameters with express-validator
- Remove 'as any' from 'req.body'

(There is a relative import of rpch/common because of file needed)
@ItsLuized ItsLuized self-assigned this Mar 29, 2023
@ItsLuized ItsLuized added the enhancement New feature or request label Mar 29, 2023
Copy link
Contributor

@nionis nionis left a comment

Choose a reason for hiding this comment

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

@diegoalzate are there other areas where we can re-use these ABI functions?

@diegoalzate
Copy link
Contributor

@diegoalzate are there other areas where we can re-use these ABI functions?

i dont think so, the functions seen in the abi.ts can not be re used in funding service which is the other place where we interact with smart contracts.

Copy link
Contributor

@nionis nionis left a comment

Choose a reason for hiding this comment

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

Please move the smart contract related code from funding service to commons too

@ItsLuized ItsLuized requested a review from a team March 31, 2023 15:48
Copy link
Contributor

@nionis nionis left a comment

Choose a reason for hiding this comment

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

LGTM
can @diegoalzate also check this to make sure moving the hardhat file will not cause any problems? E2E test worked so I think it's ok

Copy link
Contributor

@diegoalzate diegoalzate left a comment

Choose a reason for hiding this comment

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

It looks like it will work. I would rename the abi file in commons to blockchain, seems like a lot is happening in that file or maybe even split it up into abi.ts and blockchain.ts. Also I saw that the function sendTransaction does not receive abi through params and receives it globally, i would update those type of functions to receive the abi through params and that way it can be easier to test.

@nionis
Copy link
Contributor

nionis commented Apr 4, 2023

@diegoalzate I agree with the name change

@nionis
Copy link
Contributor

nionis commented Apr 6, 2023

@ItsLuized name change is pending here

@nionis nionis merged commit b062aba into main Apr 10, 2023
@nionis nionis deleted the manager-hygiene branch April 10, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code Hygiene - Manager
3 participants