WA-234 Refactor get safe contract instance

This commit is contained in:
apanizo 2018-06-07 21:47:36 +02:00
parent 6cf958c1b5
commit 3428329398
2 changed files with 9 additions and 9 deletions

View File

@ -10,11 +10,11 @@ import { confirmationsTransactionSelector, safeSelector, safeTransactionsSelecto
import { getTransactionFromReduxStore } from '~/routes/safe/test/testMultisig'
import { buildMathPropsFrom } from '~/test/buildReactRouterProps'
import { createTransaction } from '~/routes/safe/component/AddTransaction/createTransactions'
import { getGnosisSafeContract } from '~/wallets/safeContracts'
import fetchTransactions from '~/routes/safe/store/actions/fetchTransactions'
import { type GlobalState } from '~/store/index'
import { type Safe } from '~/routes/safe/store/model/safe'
import { type Transaction } from '~/routes/safe/store/model/transaction'
import { getGnosisSafeInstanceAt } from '~/wallets/safeContracts'
const getSafeFrom = (state: GlobalState, safeAddress: string): Safe => {
const match: Match = buildMathPropsFrom(safeAddress)
@ -24,14 +24,6 @@ const getSafeFrom = (state: GlobalState, safeAddress: string): Safe => {
return safe
}
const getGnosisSafeInstanceAt = async (safeAddress: string) => {
const web3 = getWeb3()
const GnosisSafe = await getGnosisSafeContract(web3)
const gnosisSafe = GnosisSafe.at(safeAddress)
return gnosisSafe
}
describe('React DOM TESTS > Add and remove owners', () => {
const assureExecuted = (transaction: Transaction) => {
expect(transaction.get('tx')).not.toBe(null)

View File

@ -136,3 +136,11 @@ export const deploySafeContract = async (
return proxyFactoryMaster.createProxy(safeMaster.address, gnosisSafeData, { from: userAccount, gas, gasPrice })
}
export const getGnosisSafeInstanceAt = async (safeAddress: string) => {
const web3 = getWeb3()
const GnosisSafe = await getGnosisSafeContract(web3)
const gnosisSafe = GnosisSafe.at(safeAddress)
return gnosisSafe
}