Adjust blockchain logic to send approved signatures when executing tx

This commit is contained in:
apanizo 2018-10-05 17:31:31 +02:00
parent 81fccccdab
commit 85dc4f8b8b
2 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,5 @@
// @flow
import { List } from 'immutable'
import { calculateGasOf, checkReceiptStatus, calculateGasPrice } from '~/logic/wallets/ethTransactions'
import { type Operation, submitOperation } from '~/logic/safe/safeTxHistory'
import { getDailyLimitModuleFrom } from '~/logic/contracts/dailyLimitContracts'
@ -53,6 +54,7 @@ export const executeTransaction = async (
operation: Operation,
nonce: number,
sender: string,
ownersWhoHasSigned: List<string>,
) => {
const gasPrice = await calculateGasPrice()
@ -92,7 +94,6 @@ export const executeTransaction = async (
}
const gnosisSafe = await getSafeEthereumInstance(safeAddress)
const ownersWhoHasSigned = [] // to obtain from tx-history-service
const signatures = buildSignaturesFrom(ownersWhoHasSigned, sender)
const txExecutionData =
gnosisSafe.contract.execTransaction.getData(to, valueInWei, data, operation, 0, 0, 0, 0, 0, signatures)

View File

@ -1,4 +1,5 @@
// @flow
import { List } from 'immutable'
import { type Transaction } from '~/routes/safe/store/model/transaction'
import { executeDailyLimit, executeTransaction, approveTransaction } from '~/logic/safe/safeBlockchainOperations'
import { EMPTY_DATA } from '~/logic/wallets/ethTransactions'
@ -47,7 +48,7 @@ export const createTransaction = async (
const isExecution = hasOneOwner(safe) || threshold === 1
const txHash = isExecution
? await executeTransaction(safeAddress, to, valueInWei, data, CALL, nonce, sender)
? await executeTransaction(safeAddress, to, valueInWei, data, CALL, nonce, sender, List([]))
: await approveTransaction(safeAddress, to, valueInWei, data, CALL, nonce, sender)
storeSubject(safeAddress, nonce, name)
@ -61,6 +62,7 @@ export const processTransaction = async (
alreadyConfirmed: number,
sender: string,
threshold: number,
usersConfirmed: List<string>,
) => {
const nonce = tx.get('nonce')
const valueInWei = tx.get('value')
@ -70,7 +72,7 @@ export const processTransaction = async (
const thresholdReached = threshold === alreadyConfirmed + 1
const txHash = thresholdReached
? await executeTransaction(safeAddress, to, valueInWei, data, CALL, nonce, sender)
? await executeTransaction(safeAddress, to, valueInWei, data, CALL, nonce, sender, usersConfirmed)
: await approveTransaction(safeAddress, to, valueInWei, data, CALL, nonce, sender)
return txHash