Mirror
This repo mirrors from THORChain Gitlab to Github. To contribute, please contact the team and commit to the Gitlab repo:
BEPSwap is UniSwap for BinanceChain. It will be the first go-to market product for THORChain and makes some compromises as to infrastructure and trustlessness. It will only swap BNB and BEP2 assets on Binance Chain using a second layer protocol that moves assets around on BNB accounts.
- React / Redux / Redux-Saga
- Ant Design
- Styled-components
- React-Intl
- Storybook
- Jest / Enzyme for Unit Test
- ESLint / Prettier for Code Linting
- GitLab CI
- Firebase Hosting
yarn
node v8^
firebase-tools
While environment variables are not required (sane defaults are set), you can configure them. Create .env
file while copying all content of .env.sample
and set all needed variables in there.
yarn install
yarn start
start
: start local development appstart-s
: start local development app with SSL allowedmainnet
: start local development app with mainnet modebuild
: build react projecttest
: unit test with jest / enzymetest:all
: Run entire test suitetest:unit
: unit test with jest / enzymetest:feat
: build the project and run all feature testscy:run
: run cypress tests in isolationstorybook
: run storybook for projectbuild-storybook
: build storybook into the dirbuild/storybook
deploy
: deploy the project on firebaselint
: lint code with eslint ruleslint:watch
: lint watch modeeject
: eject CRA (not recommended)generate:types
: Generate TypeScript types and API function calls for Midgards API endpointsfblogin
: firebase login
Example: yarn start
All types and api function calls for Midgard API are generated by openapi-generator. Whenever an endpoint of Midgards API has been added or updated, all types should be re-generated and changes are commited into the repository.
yarn generate:types
To run the entire test suite
yarn test
yarn test:unit
- Run all unit tests with jest/enzyme, react-test-renderer
To build the project and run all feature tests
yarn test:feat
- Create a new build
- Launch test server on http://localhost:8080 with a simple non-production ready file server
- Run feature tests over the build at http://localhost:8080
To run feature tests against a server set the CYPRESS_baseUrl
env var:
CYPRESS_baseUrl=https://testnet.bepswap.net yarn cy:run
The default is http://localhost:8080
- Run feature tests pointing to given url
To run tests against the local development server use cy:run:dev
First in one terminal window ensure your development server is up:
yarn start
Then in a second terminal run the tests
yarn cy:run:dev
NOTE: Sometimes gitlab heavily throttles CPU which can cause problems when running tests over code that does CPU intensive things such as cryptographic calculations. If this happens again I recommend to replicate/debug using chrome dev tools CPU throttling.
Firebase deploy:
yarn deploy
GitLab CI
- Test
- Deploy
Main Branch:
- master
- useInterval - trigger interval using hooks
- useTimeout - trigger timeout using hooks
- usePrevious - save previous state
- useFee - handle all fee related logic
- useNetwork - handle all thorchain data and logic
- usePrice - handle pricing logic
- React - React.JS
- Redux - For react global state management
- Styled-components - Style framework
- Storybook - Storybook UI for building components
- firebase - FaaS