Skip to content

Commit

Permalink
Merge pull request #37 from avolabs-io/pf/remove-web3
Browse files Browse the repository at this point in the history
remove web3 (#34)
  • Loading branch information
JasoonS authored Mar 16, 2021
2 parents 24def13 + f69f692 commit 3aa47c4
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 332 deletions.
3 changes: 1 addition & 2 deletions dApp/user/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
"react-app-rewired": "^2.1.8",
"react-scripts": "^4.0.1",
"reason-react": "^0.9.1",
"rescript-apollo-client": "^1.0.0",
"web3": "^1.3.3"
"rescript-apollo-client": "^1.0.0"
},
"browserslist": {
"production": [
Expand Down
2 changes: 0 additions & 2 deletions dApp/user/src/lib/Old/BN.bs.js

This file was deleted.

23 changes: 0 additions & 23 deletions dApp/user/src/lib/Old/BN.res

This file was deleted.

89 changes: 0 additions & 89 deletions dApp/user/src/lib/Old/Eth.bs.js

This file was deleted.

67 changes: 0 additions & 67 deletions dApp/user/src/lib/Old/Eth.res

This file was deleted.

2 changes: 1 addition & 1 deletion dApp/user/src/lib/Old/Helper.res
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ let elipsifyMiddle: (string, int, int) => string = (inputString, maxLength, trai

let bnToMoment = bn =>
bn
->BN.toString
->Ethers.BigNumber.toString
->int_of_string /* trusting that gql will be reliable here */
->MomentRe.momentWithUnix
5 changes: 1 addition & 4 deletions dApp/user/src/lib/Old/RootProvider.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dApp/user/src/lib/Old/RootProvider.res
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module RootWithWeb3 = {
dispatch(
LoadAddress(
account,
newBalance->Option.flatMap(balance => Eth.make(balance->Ethers.BigNumber.toString)),
newBalance,
),
)
)
Expand Down Expand Up @@ -147,7 +147,7 @@ let useIsAddressCurrentUser: Ethers.ethAddress => bool = address => {
}
}

let useEthBalance: unit => option<Eth.t> = () => {
let useEthBalance: unit => option<Ethers.BigNumber.t> = () => {
let (state, _) = React.useContext(RootContext.context)
switch state.ethState {
| Connected(_address, balance) => balance
Expand Down
4 changes: 2 additions & 2 deletions dApp/user/src/lib/Old/RootProviderTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ type web3reactContext = {

type rec rootActions =
| Logout
| LoadAddress(Ethers.ethAddress, option<Eth.t>)
| LoadAddress(Ethers.ethAddress, option<Ethers.BigNumber.t>)
type ethState =
| Disconnected
| Connected(Ethers.ethAddress, option<Eth.t>)
| Connected(Ethers.ethAddress, option<Ethers.BigNumber.t>)

type state = {ethState: ethState}
2 changes: 0 additions & 2 deletions dApp/user/src/lib/Old/Web3.bs.js

This file was deleted.

137 changes: 0 additions & 137 deletions dApp/user/src/lib/Old/Web3.res

This file was deleted.

Loading

0 comments on commit 3aa47c4

Please sign in to comment.