Merge pull request #1844 from gnosis/release/v2.19.0

Merge release v2.19.0 back to development
This commit is contained in:
Daniel Sanchez 2021-02-03 08:49:13 +01:00 committed by GitHub
commit cbb7fb855b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 26 additions and 25 deletions

View File

@ -1,6 +1,6 @@
{
"name": "safe-react",
"version": "2.18.1",
"version": "2.19.1",
"description": "Allowing crypto users manage funds in a safer way",
"website": "https://github.com/gnosis/safe-react#readme",
"bugs": {

View File

@ -21,6 +21,9 @@ export const TransactionFees = ({
txEstimationExecutionStatus,
}: TransactionFailTextProps): React.ReactElement | null => {
let transactionAction
if (txEstimationExecutionStatus === EstimationStatus.LOADING) {
return null
}
if (isCreation) {
transactionAction = 'create'
} else if (isExecution) {

View File

@ -26,7 +26,7 @@ Sentry.init({
dsn: SENTRY_DSN,
release: `safe-react@${process.env.REACT_APP_APP_VERSION}`,
integrations: [new Integrations.BrowserTracing()],
sampleRate: 0.2,
sampleRate: 0.01,
})
const root = document.getElementById('root')

View File

@ -182,15 +182,17 @@ const calculateMinimumGasForTransaction = async (
const amountOfGasToTryTx = txGasEstimation + dataGasEstimation + additionalGas
console.info(`Estimating transaction creation with gas amount: ${amountOfGasToTryTx}`)
try {
await getGasEstimationTxResponse({
const estimation = await getGasEstimationTxResponse({
to: safeAddress,
from: safeAddress,
data: estimateData,
gasPrice: 0,
gas: amountOfGasToTryTx,
})
console.info(`Gas estimation successfully finished with gas amount: ${amountOfGasToTryTx}`)
return amountOfGasToTryTx
if (estimation > 0) {
console.info(`Gas estimation successfully finished with gas amount: ${amountOfGasToTryTx}`)
return amountOfGasToTryTx
}
} catch (error) {
console.log(`Error trying to estimate gas with amount: ${amountOfGasToTryTx}`)
}

View File

@ -21,7 +21,6 @@ import ThresholdForm from './screens/ThresholdForm'
const styles = createStyles({
biggerModalWindow: {
width: '775px',
minHeight: '500px',
height: 'auto',
},
})

View File

@ -18,7 +18,6 @@ import { TxParameters } from 'src/routes/safe/container/hooks/useTransactionPara
const styles = createStyles({
biggerModalWindow: {
width: '775px',
minHeight: '500px',
height: 'auto',
},
})

View File

@ -216,16 +216,18 @@ export const ReviewRemoveOwnerModal = ({
isTransactionExecution={isExecution}
/>
<Block className={classes.gasCostsContainer}>
<TransactionFees
gasCostFormatted={gasCostFormatted}
isExecution={isExecution}
isCreation={isCreation}
isOffChainSignature={isOffChainSignature}
txEstimationExecutionStatus={txEstimationExecutionStatus}
/>
</Block>
<Hairline />
{txEstimationExecutionStatus === EstimationStatus.LOADING ? null : (
<Block className={classes.gasCostsContainer}>
<TransactionFees
gasCostFormatted={gasCostFormatted}
isExecution={isExecution}
isCreation={isCreation}
isOffChainSignature={isOffChainSignature}
txEstimationExecutionStatus={txEstimationExecutionStatus}
/>
<Hairline />
</Block>
)}
<Row align="center" className={classes.buttonRow}>
<Button minHeight={42} minWidth={140} onClick={onClickBack}>
Back

View File

@ -21,7 +21,6 @@ import { TxParameters } from 'src/routes/safe/container/hooks/useTransactionPara
const styles = createStyles({
biggerModalWindow: {
width: '775px',
minHeight: '500px',
height: 'auto',
},
})

View File

@ -120,6 +120,8 @@ const calculateSpendingLimitsTxData = (
if (transactions.length === 0) {
spendingLimitTxData = setSpendingLimitTx({ spendingLimitArgs, safeAddress })
} else {
const encodedTxForMultisend = setSpendingLimitMultiSendTx({ spendingLimitArgs, safeAddress })
transactions.push(encodedTxForMultisend)
spendingLimitTxData = spendingLimitMultiSendTx({ transactions, safeAddress })
}
@ -193,7 +195,7 @@ export const ReviewSpendingLimits = ({ onBack, onClose, txToken, values }: Revie
ethGasLimit: ethGasLimit || gasLimit,
}
if (safeAddress) {
const { spendingLimitTxData, transactions, spendingLimitArgs } = calculateSpendingLimitsTxData(
const { spendingLimitTxData } = calculateSpendingLimitsTxData(
safeAddress,
spendingLimits,
existentSpendingLimit,
@ -201,12 +203,7 @@ export const ReviewSpendingLimits = ({ onBack, onClose, txToken, values }: Revie
values,
advancedOptionsTxParameters,
)
// if there's no tx for enable module or adding a delegate, then we avoid using multiSend Tx
if (transactions.length === 0) {
dispatch(createTransaction(spendingLimitTxData))
return
}
transactions.push(setSpendingLimitMultiSendTx({ spendingLimitArgs, safeAddress }))
dispatch(createTransaction(spendingLimitTxData))
}
}