mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-26 00:15:23 +00:00
Start "Safe" with uppercase letter
This commit is contained in:
parent
84d19a4c1a
commit
b9501475f8
@ -36,7 +36,7 @@ const instanciateMasterCopies = async () => {
|
|||||||
const ProxyFactory = getCreateProxyFactoryContract(web3)
|
const ProxyFactory = getCreateProxyFactoryContract(web3)
|
||||||
proxyFactoryMaster = await ProxyFactory.deployed()
|
proxyFactoryMaster = await ProxyFactory.deployed()
|
||||||
|
|
||||||
// Initialize safe master copy
|
// Initialize Safe master copy
|
||||||
const GnosisSafe = getGnosisSafeContract(web3)
|
const GnosisSafe = getGnosisSafeContract(web3)
|
||||||
safeMaster = await GnosisSafe.deployed()
|
safeMaster = await GnosisSafe.deployed()
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ export const saveSafes = async (safes: Object) => {
|
|||||||
try {
|
try {
|
||||||
await saveToStorage(SAFES_KEY, safes)
|
await saveToStorage(SAFES_KEY, safes)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error storing safe info in localstorage', err)
|
console.error('Error storing Safe info in localstorage', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ export const saveDefaultSafe = async (safeAddress: string): Promise<void> => {
|
|||||||
await saveToStorage(DEFAULT_SAFE_KEY, safeAddress)
|
await saveToStorage(DEFAULT_SAFE_KEY, safeAddress)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.error('Error saving default safe to storage: ', err)
|
console.error('Error saving default Safe to storage: ', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import { loadFromStorage, saveToStorage } from '~/utils/storage'
|
|||||||
export const ACTIVE_TOKENS_KEY = 'ACTIVE_TOKENS'
|
export const ACTIVE_TOKENS_KEY = 'ACTIVE_TOKENS'
|
||||||
export const CUSTOM_TOKENS_KEY = 'CUSTOM_TOKENS'
|
export const CUSTOM_TOKENS_KEY = 'CUSTOM_TOKENS'
|
||||||
|
|
||||||
// Tokens which are active at least in one of used safes in the app should be saved to localstorage
|
// Tokens which are active at least in one of used Safes in the app should be saved to localstorage
|
||||||
// to avoid iterating a large amount of data of tokens from the backend
|
// to avoid iterating a large amount of data of tokens from the backend
|
||||||
// Custom tokens should be saved too unless they're deleted (marking them as inactive doesn't count)
|
// Custom tokens should be saved too unless they're deleted (marking them as inactive doesn't count)
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ const styles = () => ({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export const SAFE_INSTANCE_ERROR = 'Address given is not a safe instance'
|
export const SAFE_INSTANCE_ERROR = 'Address given is not a Safe instance'
|
||||||
export const SAFE_MASTERCOPY_ERROR = 'Mastercopy used by this safe is not the same'
|
export const SAFE_MASTERCOPY_ERROR = 'Mastercopy used by this Safe is not the same'
|
||||||
|
|
||||||
// In case of an error here, it will be swallowed by final-form
|
// In case of an error here, it will be swallowed by final-form
|
||||||
// So if you're experiencing any strang behaviours like freeze or hanging
|
// So if you're experiencing any strang behaviours like freeze or hanging
|
||||||
|
@ -17,7 +17,7 @@ const store = new Store({
|
|||||||
|
|
||||||
storiesOf('Routes /open', module)
|
storiesOf('Routes /open', module)
|
||||||
.addDecorator(FrameDecorator)
|
.addDecorator(FrameDecorator)
|
||||||
.add('Open safe with all props set', () => {
|
.add('Open Safe with all props set', () => {
|
||||||
getProviderInfo()
|
getProviderInfo()
|
||||||
const provider = 'METAMASK'
|
const provider = 'METAMASK'
|
||||||
const userAccount = '0x03db1a8b26d08df23337e9276a36b474510f0023'
|
const userAccount = '0x03db1a8b26d08df23337e9276a36b474510f0023'
|
||||||
|
@ -9,7 +9,7 @@ const FrameDecorator = (story) => <div className={styles.frame}>{story()}</div>
|
|||||||
|
|
||||||
storiesOf('Routes /opening', module)
|
storiesOf('Routes /opening', module)
|
||||||
.addDecorator(FrameDecorator)
|
.addDecorator(FrameDecorator)
|
||||||
.add('View while safe is being deployed', () => (
|
.add('View while Safe is being deployed', () => (
|
||||||
<Component
|
<Component
|
||||||
name="Super Vault 2000"
|
name="Super Vault 2000"
|
||||||
tx="0xed163e50e2e85695f5edafeba51d6be1758549858d12611ed4dcc96feaa19fc9"
|
tx="0xed163e50e2e85695f5edafeba51d6be1758549858d12611ed4dcc96feaa19fc9"
|
||||||
|
@ -72,7 +72,7 @@ const ReviewTx = ({
|
|||||||
txData = tokenInstance.contract.methods.transfer(tx.recipientAddress, txAmount).encodeABI()
|
txData = tokenInstance.contract.methods.transfer(tx.recipientAddress, txAmount).encodeABI()
|
||||||
// txAmount should be 0 if we send tokens
|
// txAmount should be 0 if we send tokens
|
||||||
// the real value is encoded in txData and will be used by the contract
|
// the real value is encoded in txData and will be used by the contract
|
||||||
// if txAmount > 0 it would send ETH from the safe
|
// if txAmount > 0 it would send ETH from the Safe
|
||||||
txAmount = 0
|
txAmount = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ const NoTransactions = () => (
|
|||||||
<Row data-testid={NO_TRANSACTION_ROW_TEST_ID}>
|
<Row data-testid={NO_TRANSACTION_ROW_TEST_ID}>
|
||||||
<Col xs={12} center="xs" sm={10} smOffset={2} start="sm" margin="md">
|
<Col xs={12} center="xs" sm={10} smOffset={2} start="sm" margin="md">
|
||||||
<Paragraph size="lg">
|
<Paragraph size="lg">
|
||||||
<Bold>No transactions found for this safe</Bold>
|
<Bold>No transactions found for this Safe</Bold>
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -43,7 +43,7 @@ export default (safeAddress: string) => async (dispatch: ReduxDispatch<GlobalSta
|
|||||||
dispatch(addSafe(safeProps))
|
dispatch(addSafe(safeProps))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.error('Error while updating safe information: ', err)
|
console.error('Error while updating Safe information: ', err)
|
||||||
|
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ const loadDefaultSafe = () => async (dispatch: ReduxDispatch<GlobalState>) => {
|
|||||||
dispatch(setDefaultSafe(defaultSafe))
|
dispatch(setDefaultSafe(defaultSafe))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.error('Error while getting defautl safe from storage:', err)
|
console.error('Error while getting defautl Safe from storage:', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ const loadSafesFromStorage = () => async (dispatch: ReduxDispatch<GlobalState>)
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.error('Error while getting safes from storage:', err)
|
console.error('Error while getting Safes from storage:', err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
|
@ -60,7 +60,7 @@ export default handleActions<SafeReducerState, *>(
|
|||||||
[ADD_SAFE]: (state: SafeReducerState, action: ActionType<Function>): SafeReducerState => {
|
[ADD_SAFE]: (state: SafeReducerState, action: ActionType<Function>): SafeReducerState => {
|
||||||
const { safe }: { safe: SafeProps } = action.payload
|
const { safe }: { safe: SafeProps } = action.payload
|
||||||
|
|
||||||
// if you add a new safe it needs to be set as a record
|
// if you add a new Safe it needs to be set as a record
|
||||||
// in case of update it shouldn't, because a record would be initialized
|
// in case of update it shouldn't, because a record would be initialized
|
||||||
// with initial props and it would overwrite existing ones
|
// with initial props and it would overwrite existing ones
|
||||||
|
|
||||||
|
@ -17,14 +17,14 @@ export type DomSafe = {
|
|||||||
export const renderSafeInDom = async (owners: number = 1, threshold: number = 1): Promise<DomSafe> => {
|
export const renderSafeInDom = async (owners: number = 1, threshold: number = 1): Promise<DomSafe> => {
|
||||||
// create store
|
// create store
|
||||||
const store = aNewStore()
|
const store = aNewStore()
|
||||||
// deploy safe updating store
|
// deploy Safe updating store
|
||||||
const address = await aMinedSafe(store, owners, threshold)
|
const address = await aMinedSafe(store, owners, threshold)
|
||||||
// have available accounts
|
// have available accounts
|
||||||
const accounts = await getWeb3().eth.getAccounts()
|
const accounts = await getWeb3().eth.getAccounts()
|
||||||
// navigate to SAFE route
|
// navigate to SAFE route
|
||||||
const SafeDom = renderSafeView(store, address)
|
const SafeDom = renderSafeView(store, address)
|
||||||
|
|
||||||
// add funds to safe
|
// add funds to Safe
|
||||||
await sendEtherTo(address, '0.1')
|
await sendEtherTo(address, '0.1')
|
||||||
// wait until funds are displayed and buttons are enabled
|
// wait until funds are displayed and buttons are enabled
|
||||||
await sleep(3000)
|
await sleep(3000)
|
||||||
|
@ -107,7 +107,7 @@ const deploySafe = async (createSafeForm: any, threshold: number, numOwners: num
|
|||||||
fireEvent.submit(form)
|
fireEvent.submit(form)
|
||||||
})
|
})
|
||||||
|
|
||||||
// giving some time to the component for updating its state with safe
|
// giving some time to the component for updating its state with Safe
|
||||||
// before destroying its context
|
// before destroying its context
|
||||||
return whenSafeDeployed()
|
return whenSafeDeployed()
|
||||||
}
|
}
|
||||||
@ -120,8 +120,8 @@ const aDeployedSafe = async (specificStore: Store<GlobalState>, threshold?: numb
|
|||||||
return safeAddress
|
return safeAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('DOM > Feature > CREATE a safe', () => {
|
describe('DOM > Feature > CREATE a Safe', () => {
|
||||||
it('fills correctly the safe form with 4 owners and 4 threshold and creates a safe', async () => {
|
it('fills correctly the Safe form with 4 owners and 4 threshold and creates a Safe', async () => {
|
||||||
const owners = 4
|
const owners = 4
|
||||||
const threshold = 4
|
const threshold = 4
|
||||||
const store = aNewStore()
|
const store = aNewStore()
|
||||||
|
@ -42,8 +42,8 @@ const renderLoadSafe = async (localStore: Store<GlobalState>) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('DOM > Feature > LOAD a safe', () => {
|
describe('DOM > Feature > LOAD a Safe', () => {
|
||||||
it('load correctly a created safe', async () => {
|
it('load correctly a created Safe', async () => {
|
||||||
const store = aNewStore()
|
const store = aNewStore()
|
||||||
const address = await aMinedSafe(store)
|
const address = await aMinedSafe(store)
|
||||||
const LoadSafePage = await renderLoadSafe(store)
|
const LoadSafePage = await renderLoadSafe(store)
|
||||||
|
@ -17,7 +17,7 @@ describe('DOM > Feature > Settings - Name', () => {
|
|||||||
safeAddress = await aMinedSafe(store)
|
safeAddress = await aMinedSafe(store)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Changes safe name', async () => {
|
it('Changes Safe name', async () => {
|
||||||
const INITIAL_NAME = 'Safe Name'
|
const INITIAL_NAME = 'Safe Name'
|
||||||
const NEW_NAME = 'NEW SAFE NAME'
|
const NEW_NAME = 'NEW SAFE NAME'
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ describe('DOM > Feature > Sidebar', () => {
|
|||||||
safeAddress = await aMinedSafe(store)
|
safeAddress = await aMinedSafe(store)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Shows "default" label for a single safe', async () => {
|
it('Shows "default" label for a single Safe', async () => {
|
||||||
const SafeDom = await renderSafeView(store, safeAddress)
|
const SafeDom = await renderSafeView(store, safeAddress)
|
||||||
|
|
||||||
act(() => {
|
act(() => {
|
||||||
@ -29,7 +29,7 @@ describe('DOM > Feature > Sidebar', () => {
|
|||||||
expect(safes[0]).toContainElement(SafeDom.getByText('default'))
|
expect(safes[0]).toContainElement(SafeDom.getByText('default'))
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Changes default safe', async () => {
|
it('Changes default Safe', async () => {
|
||||||
const SafeDom = await renderSafeView(store, safeAddress)
|
const SafeDom = await renderSafeView(store, safeAddress)
|
||||||
await aMinedSafe(store)
|
await aMinedSafe(store)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user