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

Update real-fvr branch #109

Open
wants to merge 227 commits into
base: real-fvr
Choose a base branch
from
Open

Conversation

Quicksaver
Copy link
Contributor

@Quicksaver Quicksaver commented Nov 15, 2021

NOTE

Still WIP as we are finalizing thorough testing on our side, but I'd appreciate your eyes going through the code in the meantime, to see if anything jumps up just by looking. I will update this PR when testing on our side is finished before merging. So please don't merge until then as we don't want this in production just yet. 😄

List of changes

  • updated with master
    • brings it one step closer to start contributing functionalities to bepro-js
  • made a few tweaks to the watch and build steps to help with using a hot-localhost copy in our projects
  • committed yarn.lock for consistency across environments
  • removed hard lock on node minor version
    • any v14 (LTS) node should be ok to use as minor versions don't (or shouldn't) include breaking changes
  • gas prices estimated from web3
    • implemented gasFactor, gasAmount, gasPrice parameters applied to transactions
    • __sendTx() now expects a second argument to override these values, hopefully I didn't add any compatibility issues with this
  • left both ERC721Contract and ERC721Standard - didn't want to mess with existing code that might depend with one or the other specifically, couldn't tell which was supposed to be "the one" overall
  • updated babel and eslint
    • eslint is still not perfect as I couldn't get my IDE to work with it, but should provide cleaner code pre-commit as usual
    • also follows updated standards
  • when initializing contracts, only start web3Connection if needed, but ensure it's started
  • I didn't run any tests as I don't have an eth network setup locally, probably broke a few?
  • Allow passing opt.provider to Web3Connection, with assumed connection logic (no need for internal start() or login())
    • this allows us to leverage bepro-js through web3 wallets other than metamask
    • a next step would be to implement specific wallet logic directly into bepro-js, as it already does for Metamask, but one step at a time 😄

sgoia and others added 30 commits May 10, 2021 17:21
-removed unused old file 'src/models/ERC20TokenLock' that was relocated somewhere else.
-file 'src/Web3Connection' for Web3 creation selecting the correct network, is based on old file src/Application.js
-added a short tests file for Application class.
-removed all getContract functions from Application, and export each contract model ready for use.
-src/models updated to use Web3Connection.js
NOTE: src/IContract.js base class has the Web3Connection.js object to setup proper network.
-Tests were updated to match the new exported models.
[BUGFIX]
*This is related to issue 39: 'Each Test has to have its own ERC20Contract new deployment' this is on ganache local blockchain testing, so unit tests are isolated and tested clean and independent from anything else.
…o i19-rm-getcontract-func

# resolved the following conflicts:
#	build/models/ERC20/ERC20Contract.js
#	build/models/ERC20/ERC20TokenLock.js
#	src/Application.js
#	src/models/ERC20/ERC20Contract.js
#	src/models/ERC20/ERC20TokenLock.js
-latest merge from master had a few conflicts left unresolved.
…o i19-rm-getcontract-func

# resolved all conflicts:
#	build/Application.js
#	build/contracts/Address.json
#	build/contracts/BEPRONetwork.json
#	build/contracts/CappedToken.json
#	build/contracts/Context.json
#	build/contracts/ERC165.json
#	build/contracts/ERC20.json
#	build/contracts/ERC20Test.json
#	build/contracts/ERC20TokenLock.json
#	build/contracts/ERC721.json
#	build/contracts/ERC721Colectibles.json
#	build/contracts/ERC721Standard.json
#	build/contracts/EnumerableMap.json
#	build/contracts/EnumerableSet.json
#	build/contracts/Exchange.json
#	build/contracts/IERC165.json
#	build/contracts/IERC20.json
#	build/contracts/IERC721.json
#	build/contracts/IERC721Enumerable.json
#	build/contracts/IERC721Metadata.json
#	build/contracts/IERC721Receiver.json
#	build/contracts/Migrations.json
#	build/contracts/Opener.json
#	build/contracts/OpenerRealFvr.json
#	build/contracts/Ownable.json
#	build/contracts/Pausable.json
#	build/contracts/SafeMath.json
#	build/contracts/StakingContract.json
#	build/contracts/Strings.json
#	build/contracts/Token.json
#	build/contracts/_IERC20.json
#	build/models/BEPRO/Network.js
#	build/models/ERC20/ERC20Contract.js
#	build/models/ERC20/ERC20TokenLock.js
#	build/models/ERC721/ERC721Collectibles.js
#	build/models/ERC721/ERC721Standard.js
#	build/models/IContract.js
#	build/models/PredictionMarkets/ExchangeContract.js
#	build/models/Staking/StakingContract.js
#	index.js
#	src/Application.js
#	src/models/BEPRO/Network.js
#	src/models/ERC20/ERC20Contract.js
#	src/models/ERC20/ERC20TokenLock.js
#	src/models/ERC721/ERC721Collectibles.js
#	src/models/ERC721/ERC721Standard.js
#	src/models/IContract.js
#	src/models/Staking/StakingContract.js
#	tests/erc20Contract.js
#	tests/erc20TokenLock.js
#	tests/erc721Collectibles.js
#	tests/exchangeContract.js
#	tests/index.js
#	tests/stakingContract.js
#	xunit.xml
-fixed StakingContract constructor when creating ERC20Contract, give it the correct params.tokensAddress
-fixed erc20TokenLock test bug when deploying ERC20TokenLock
-fixed missing declaration for "erc20Contract" variable in stakingContract tests.

[REFACTORY]
-added "params" object in comments on all models wherever it was missing.
-removed "mainnet" property from config object params when testing as latest code refactory made it obsolete.
-added Web3Connection functions to IContract base model.

[UPDATE]
-added more nit tests for Application to assert proper functionalities.
-updated README.md for new usage of package exported models.
-some code cleaning and improvements were made in tests files.

[NEW]
-added generic test file "tests/generics.js" for common behaviour found in all exported models.

[UPDATES]
-source file "src/Web3Connection.js" updated:
-functions "start", "getETHNetwork", "getAddress" and "getETHBalance" were made normal from lambda (arrow).
-function "_loadDataFromWeb3Connection" added in "src/models/IContract.js" file.
-function "start" was added back into "src/models/IContract.js" file.
-fixed test from "tests/generics.js" file.
-README file updated with small note on "start" function.
…o i19-rm-getcontract-func

# Conflicts:
#	src/Application.js
#	src/models/BEPRO/Network.js
#	src/models/IContract.js
#	src/models/custom/RealFvr/OpenerRealFvr.js
@Quicksaver Quicksaver changed the title WIP: Update real-fvr branch Update real-fvr branch Nov 25, 2021
moshmage added a commit that referenced this pull request May 1, 2022
Review Update real-fvr branch #109 to merge with master
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.

5 participants