Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
fether
Commits
e801843a
Commit
e801843a
authored
May 28, 2019
by
Luke Schoen
Browse files
fix: Add Gas Limit of 150000 for all transactions with a value in the data field
parent
6cc59cfd
Pipeline
#149655
failed with stage
Changes
3
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
packages/fether-electron/package.json
View file @
e801843a
...
...
@@ -37,7 +37,7 @@
"package"
:
"electron-builder"
,
"prerelease"
:
"./scripts/revertElectronBug.sh"
,
"release"
:
"electron-builder"
,
"start"
:
"cross-env ELECTRON_START_URL=http://localhost:3000 electron-webpack dev
--chain goerli
"
,
"start"
:
"cross-env ELECTRON_START_URL=http://localhost:3000 electron-webpack dev"
,
"test"
:
"jest --all --color --coverage"
},
"dependencies"
:
{
...
...
packages/fether-react/src/Send/TxForm/TxDetails/TxDetails.js
View file @
e801843a
...
...
@@ -9,6 +9,7 @@ import { fromWei, toWei } from '@parity/api/lib/util/wei';
import
i18n
,
{
packageNS
}
from
'
../../../i18n
'
;
import
{
chainIdToString
,
isNotErc20TokenAddress
}
from
'
../../../utils/chain
'
;
import
{
GAS_LIMIT_DATA
}
from
'
../../../utils/transaction
'
;
class
TxDetails
extends
Component
{
renderDetails
=
()
=>
{
...
...
@@ -51,7 +52,7 @@ ${this.renderTotalAmount()}`;
// higher Gas Limit. On
if
(
values
.
data
)
{
return
i18n
.
t
(
`
${
packageNS
}
:tx.form.details.gas_limit`
,
{
gas_limit
:
new
BigNumber
(
200000
)
gas_limit
:
GAS_LIMIT_DATA
});
}
...
...
packages/fether-react/src/utils/transaction.js
View file @
e801843a
...
...
@@ -18,6 +18,7 @@ import EthereumTx from 'ethereumjs-tx';
const
debug
=
Debug
(
'
transaction
'
);
const
GAS_MULT_FACTOR
=
1.25
;
// Since estimateGas is not always accurate, we add a 25% factor for buffer.
export
const
GAS_LIMIT_DATA
=
new
BigNumber
(
150000
);
export
const
contractForToken
=
memoize
(
tokenAddress
=>
makeContract
(
tokenAddress
,
abi
)
...
...
@@ -100,7 +101,7 @@ export const txForErc20 = (tx, token) => {
};
if
(
tx
.
gas
)
{
output
.
options
.
gas
=
tx
.
gas
;
output
.
options
.
gas
=
tx
.
data
?
GAS_LIMIT_DATA
:
tx
.
gas
;
}
return
output
;
...
...
@@ -120,7 +121,7 @@ export const txForEth = tx => {
};
// gas field should not be present when the function is called for gas estimation.
if
(
tx
.
gas
)
{
output
.
gas
=
tx
.
gas
;
output
.
gas
=
tx
.
data
?
GAS_LIMIT_DATA
:
tx
.
gas
;
}
return
output
;
};
...
...
@@ -141,9 +142,12 @@ const getEthereumTx = tx => {
transactionCount
}
=
tx
;
// Temporary solution
const
gasLimit
=
data
?
GAS_LIMIT_DATA
:
gas
;
const
txParams
=
{
nonce
:
'
0x
'
+
transactionCount
.
toNumber
().
toString
(
16
),
gasLimit
:
'
0x
'
+
gas
.
toNumber
().
toString
(
16
),
gasLimit
:
'
0x
'
+
gas
Limit
.
toNumber
().
toString
(
16
),
gasPrice
:
toWei
(
gasPrice
,
'
shannon
'
).
toNumber
(),
chainId
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment