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

refactor this #6

Open
grahamwaters opened this issue Dec 26, 2022 · 1 comment
Open

refactor this #6

grahamwaters opened this issue Dec 26, 2022 · 1 comment

Comments

@grahamwaters
Copy link
Contributor

https://github.com/grahamwaters/mkyNetwork/blob/7bb88a0103df378f3b88b74787beffa742820a36/scripts/mkyBanker.js#L131

@grahamwaters
Copy link
Contributor Author

grahamwaters commented Dec 26, 2022

There are a few ways that you could refactor the Reg2Transaction class:

You could refactor the saveTransaction function to use a prepared statement with placeholders for the values being inserted. This would help to prevent SQL injection attacks, and would make the code more readable.

refactor saveTransaction function to use a Promise, which would allow you to use async/await syntax and make the code more readable.

refactor confirmAndSave function to use a Promise, which would allow you to use async/await syntax and make the code more readable.

refactor getWalletPubKey function to use a Promise, which would allow you to use async/await syntax and make the code more readable.

refactor calculateHash function to use a Promise, which would allow you to use async/await syntax and make the code more readable.

refactor Reg2Transaction class to use a more modern JavaScript syntax, such as class fields and arrow functions. This would make the code more concise and easier to read.

refactor Reg2Transaction class to use modern JavaScript features such as the spread operator, which would make the code more concise and easier to read.

refactor Reg2Transaction class to use modern JavaScript features such as destructuring, which would make the code more concise and easier to read.

refactor Reg2Transaction class to use modern JavaScript features such as template strings, which would make the code more concise and easier to read.

refactor Reg2Transaction class to use modern JavaScript features such as the for-of loop, which would make the code more concise and easier to read.

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

No branches or pull requests

1 participant