keep-network / tbtc-dapp

Deposit BTC and redeem TBTC
http://dapp.test.tbtc.network/
MIT License
33 stars 31 forks source link

Slick Moves: Set up tBTC config by chain id #356

Closed Shadowfiend closed 4 years ago

Shadowfiend commented 4 years ago

Rather than using isMainnet, provide a config indexed by chain id, and use the already-looked-up chain id to determine which config to use at load time. Config also now includes the local network.

Spinoff of keep-network/local-setup#40, though it doesn't block that PR.

In draft because I haven't had a chance to give it a full test yet, but if the reviewer tests it satisfactorily I think we can land it. Whoever gets to it first can review :wink:

lukasz-zimnoch commented 4 years ago

Looks good but the linter isn't happy:

/home/circleci/project/src/wrappers/web3.js
  3:16  error  'EthereumHelpers' is defined but never used  no-unused-vars
  3:33  error  'BitcoinHelpers' is defined but never used   no-unused-vars
Shadowfiend commented 4 years ago

🤔 must have missed setting up pre-commit locally. Will fix!

Shadowfiend commented 4 years ago

Oh yeah, I missed setting up pre-commit because I was working in the local-setup checkouts :grimacing: Might be useful to make initialize-repositories also set up pre-commit for completeness 🤔 Anyway, later haha.

Shadowfiend commented 4 years ago

This should be ready to go.

lukasz-zimnoch commented 4 years ago

I approved but don't have write permissions to merge.