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

[Feature] Separate significant js code from UI-related code #46

Open
shahankhatch opened this issue Oct 6, 2021 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@shahankhatch
Copy link

Feature Description

Web3 related code is sprinkled into the front end. This leads to challenges wrt testing and reuse.
One way to resolve is to start separating the js code into its own file within the repo, towards the eventual goal of building a javascript helper library for the smart contract we implement.

Code looks like the following:

const receipt = contracts.methods.delegate(address).send({ from: accounts, gas: 300000 }).on("transactionHash", async (txhash: string) =>

const balance = await contracts.methods.balanceOf(accounts).call();

Once the web3 code is separated, it'll be easier to work on issues like #45.

@octavioamu
Copy link
Contributor

for the testing part I found this repo maybe once split is something we could use https://github.com/DePayFi/depay-web3-mock

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

No branches or pull requests

2 participants