Commit 4dbade52 authored by Chi Kei Chan's avatar Chi Kei Chan Committed by GitHub

Add Documentation; Remove Pending Tx on reject (#114)

parent 058cfc26
...@@ -5,3 +5,24 @@ This is the repository for [uniswap.io](https://uniswap.io/). Uniswap is an inte ...@@ -5,3 +5,24 @@ This is the repository for [uniswap.io](https://uniswap.io/). Uniswap is an inte
* Join the reddit: [https://www.reddit.com/r/Uniswap/](https://www.reddit.com/r/UniSwap/) * Join the reddit: [https://www.reddit.com/r/Uniswap/](https://www.reddit.com/r/UniSwap/)
* Email us: [contact@uniswap.io](mailto:contact@uniswap.io) * Email us: [contact@uniswap.io](mailto:contact@uniswap.io)
* Read the whitepaper: [Link](https://hackmd.io/C-DvwDSfSxuh-Gd4WKE_ig) * Read the whitepaper: [Link](https://hackmd.io/C-DvwDSfSxuh-Gd4WKE_ig)
### To Start Development
###### Installing dependency
```bash
yarn
```
###### Running locally on Rinkeby
```bash
yarn start:rinkeby
```
###### Running locally on other testnet
```bash
REACT_APP_NETWORK_ID=2 REACT_APP_NETWORK='Ropsten Test Network' react-scripts start
```
### Contributions
Please open all pull requests against `dev` branch.
...@@ -342,18 +342,30 @@ export const sync = () => async (dispatch, getState) => { ...@@ -342,18 +342,30 @@ export const sync = () => async (dispatch, getState) => {
}); });
pending.forEach(async txId => { pending.forEach(async txId => {
const data = await web3.eth.getTransactionReceipt(txId) || {}; try {
if (data.status) { const data = await web3.eth.getTransactionReceipt(txId) || {};
dispatch({ dispatch({
type: REMOVE_PENDING_TX, type: REMOVE_PENDING_TX,
payload: txId, payload: txId,
}); });
if (data.status) {
dispatch({
type: ADD_CONFIRMED_TX,
payload: txId,
});
} else {
// TODO: dispatch ADD_REJECTED_TX
}
} catch (err) {
dispatch({ dispatch({
type: ADD_CONFIRMED_TX, type: REMOVE_PENDING_TX,
payload: txId, payload: txId,
}); });
// TODO: dispatch ADD_REJECTED_TX
} }
}); });
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment