-
Notifications
You must be signed in to change notification settings - Fork 3
Added fees #71
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
Added fees #71
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ const { | |
| purchaseContract, | ||
| setContractDeleteStatus, | ||
| editContract, | ||
| getMarketplaceFee | ||
| } = require('./api') | ||
| const { ContractEventsListener } = require('./events-listener') | ||
|
|
||
|
|
@@ -91,10 +92,11 @@ function createPlugin() { | |
| return { | ||
| api: { | ||
| refreshContracts: refreshContracts(web3, lumerin, cloneFactory), | ||
| createContract: createContract(web3, cloneFactory, plugins), | ||
| cancelContract: cancelContract(web3), | ||
| createContract: createContract(web3, cloneFactory), | ||
| cancelContract: cancelContract(web3, cloneFactory), | ||
| purchaseContract: purchaseContract(web3, cloneFactory, lumerin), | ||
| editContract: editContract(web3, cloneFactory, lumerin), | ||
| getMarketplaceFee: getMarketplaceFee(cloneFactory), | ||
| setContractDeleteStatus: setContractDeleteStatus( | ||
| web3, | ||
| cloneFactory, | ||
|
Comment on lines
92
to
102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code is creating new instances of the functions To improve performance, consider refactoring the code to create these function instances only once and reuse them. This could be achieved by moving the function instantiation to a higher scope or using a design pattern that ensures only a single instance of each function is created, such as the Singleton or Factory patterns. |
||
|
|
||
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.
The function
getMarketplaceFeeis defined as a double arrow function, which is unnecessary and could lead to confusion. The outer function takescloneFactoryas a parameter but the inner function doesn't take any parameters. This could lead to potential issues if you expect to pass parameters to the inner function. I recommend simplifying this by removing the outer function and passingcloneFactorydirectly to the inner function.