update readme

This commit is contained in:
Mikhail Mikheev 2019-04-12 18:41:47 +04:00
parent a6249de48d
commit 49f000447c
6 changed files with 46 additions and 25 deletions

View File

@ -11,12 +11,14 @@ These instructions will get you a copy of the project up and running on your loc
What things you need to install the software and how to install them
```
npm install truffle // recommended usage of -g flag
npm install ganache-cli // recommended usage of -g flag
npm install flow-type // recommended usage of -g flag
yarn add truffle // recommended usage of -g flag
yarn add ganache-cli // recommended usage of -g flag
yarn add flow-type // recommended usage of -g flag
git clone https://github.com/gnosis/safe-contracts.git
```
We use [yarn](https://yarnpkg.com) in our infrastacture, so we decided to go with yarn in the README
### Installing
A step by step series of examples that tell you have to get a development env running
@ -29,14 +31,14 @@ ganache-cli -b 3
Start the project in the other one
```
cd safe-contracts && truffle compile && truffle migrate && cd ..
npm install
npm start
yarn install
yarn start
```
## Running the tests
```
npm test
yarn test
```

View File

@ -1,16 +1,13 @@
// @flow
import enableToken from '~/logic/tokens/store/actions/enableToken'
import disableToken from '~/logic/tokens/store/actions/disableToken'
import fetchTokens from '~/logic/tokens/store/actions/fetchTokens'
import updateActiveTokens from '~/routes/safe/store/actions/updateActiveTokens'
export type Actions = {
enableToken: Function,
disableToken: Function,
fetchTokens: Function
fetchTokens: Function,
updateActiveTokens: Function
}
export default {
enableToken,
disableToken,
fetchTokens,
updateActiveTokens,
}

View File

@ -6,7 +6,7 @@ import fetchTokenBalances from '~/routes/safe/store/actions/fetchTokenBalances'
export type Actions = {
fetchSafe: typeof fetchSafe,
loadActiveTokens: typeof loadActiveTokens,
fetchTokenBalances: typeof fetchTokenBalances
fetchTokenBalances: typeof fetchTokenBalances,
}
export default {

View File

@ -1,11 +1,11 @@
// @flow
import { List } from 'immutable'
import { createAction } from 'redux-actions'
import SafeRecord, { type Safe } from '~/routes/safe/store/models/safe'
import { saveSafes, setOwners } from '~/logic/safe/utils'
import { makeOwner, type Owner } from '~/routes/safe/store/models/owner'
import type { Dispatch as ReduxDispatch, GetState } from 'redux'
import { type GlobalState } from '~/store/index'
import { type GlobalState } from '~/store'
import { saveSafes, setOwners } from '~/logic/safe/utils'
import SafeRecord, { type Safe } from '~/routes/safe/store/models/safe'
import { makeOwner, type Owner } from '~/routes/safe/store/models/owner'
import { safesMapSelector } from '~/routes/safeList/store/selectors/index'
export const ADD_SAFE = 'ADD_SAFE'
@ -20,7 +20,7 @@ type ActionReturn = {
safe: Safe,
}
export const addSafe = createAction<string, *, *>(
export const addSafe = createAction<string, Function, ActionReturn>(
ADD_SAFE,
(safe: Safe): ActionReturn => ({
safe,

View File

@ -1,7 +1,29 @@
// @flow
import updateSafe from './updateSafe'
import type { SafeToken, Token } from '~/logic/tokens/store/model'
import { createAction } from 'redux-actions'
import type { Dispatch as ReduxDispatch } from 'redux'
import { type GlobalState } from '~/store'
import type { SafeToken } from '~/routes/safe/store/models/safeToken'
import SafeTokenRecord from '~/routes/safe/store/models/safeToken'
const updateActiveTokens = (tokenAddress: string) => {
}
export const UPDATE_SAFE_TOKENS = 'UPDATE_SAFE_TOKENS'
type ActionReturn = {
token: SafeToken,
}
export const updateTokenAction = createAction<string, Function, ActionReturn>(
UPDATE_SAFE_TOKENS,
(token: SafeToken): ActionReturn => ({
token,
}),
)
const updateActiveTokens = (safeAddress: string, tokenAddress: string) => async (
dispatch: ReduxDispatch<GlobalState>,
) => {
const token: SafeToken = SafeTokenRecord({ address: tokenAddress })
dispatch(updateTokenAction(token))
}
export default updateActiveTokens

View File

@ -8,9 +8,9 @@ export type SafeProps = {
name: string,
address: string,
threshold: number,
ethBalance: string,
owners: List<Owner>,
tokens?: List<SafeToken>,
ethBalance?: string,
}
const SafeRecord: RecordFactory<SafeProps> = Record({