aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-06-03 06:18:14 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-06-03 06:18:14 +0800
commit2b7d8424981fbbd0f6306b5ee7abf8754f9f7092 (patch)
tree3947f5acf75e8560a837d083373011c3444a6e38 /app
parent9eea990425f1f68eabca8b283bdfc662befcd226 (diff)
downloadtangerine-wallet-browser-2b7d8424981fbbd0f6306b5ee7abf8754f9f7092.tar.gz
tangerine-wallet-browser-2b7d8424981fbbd0f6306b5ee7abf8754f9f7092.tar.zst
tangerine-wallet-browser-2b7d8424981fbbd0f6306b5ee7abf8754f9f7092.zip
Update gasblocklimit params with every block.
Diffstat (limited to 'app')
-rw-r--r--app/scripts/lib/eth-store.js2
-rw-r--r--app/scripts/lib/tx-utils.js9
2 files changed, 2 insertions, 9 deletions
diff --git a/app/scripts/lib/eth-store.js b/app/scripts/lib/eth-store.js
index 6f04a9dd6..ebba98f5c 100644
--- a/app/scripts/lib/eth-store.js
+++ b/app/scripts/lib/eth-store.js
@@ -21,6 +21,7 @@ class EthereumStore extends ObservableStore {
transactions: {},
currentBlockNumber: '0',
currentBlockHash: '',
+ currentBlockGasLimit: '',
})
this._provider = opts.provider
this._query = new EthQuery(this._provider)
@@ -73,6 +74,7 @@ class EthereumStore extends ObservableStore {
this._currentBlockNumber = blockNumber
this.updateState({ currentBlockNumber: parseInt(blockNumber) })
this.updateState({ currentBlockHash: `0x${block.hash.toString('hex')}`})
+ this.updateState({ currentBlockGasLimit: `0x${block.gasLimit.toString('hex')}` })
async.parallel([
this._updateAccounts.bind(this),
this._updateTransactions.bind(this, blockNumber),
diff --git a/app/scripts/lib/tx-utils.js b/app/scripts/lib/tx-utils.js
index 658f3bedc..149d93102 100644
--- a/app/scripts/lib/tx-utils.js
+++ b/app/scripts/lib/tx-utils.js
@@ -21,21 +21,12 @@ module.exports = class txProviderUtils {
this.query.getBlockByNumber('latest', true, (err, block) => {
if (err) return cb(err)
async.waterfall([
- self.setBlockGasLimit.bind(self, txMeta, block.gasLimit),
self.estimateTxGas.bind(self, txMeta, block.gasLimit),
self.setTxGas.bind(self, txMeta, block.gasLimit),
], cb)
})
}
- setBlockGasLimit (txMeta, blockGasLimitHex, cb) {
- const blockGasLimitBN = hexToBn(blockGasLimitHex)
- const saferGasLimitBN = BnMultiplyByFraction(blockGasLimitBN, 19, 20)
- txMeta.blockGasLimit = bnToHex(saferGasLimitBN)
- cb()
- return
- }
-
estimateTxGas (txMeta, blockGasLimitHex, cb) {
const txParams = txMeta.txParams
// check if gasLimit is already specified
href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/lang/python-devel?h=gnome-3.24&id=ad184f5e530f678551f53fb7562ec653f88deaf4'>PORTREVISION => 1alane2002-11-221-0/+12 * PORTREVISION => 1alane2002-11-222-2/+168 * Simplified threads configuration.alane2002-11-211-3/+5 * Take over as maintainer since tg is taking a leave of absence from portalane2002-11-161-1/+1 * Upgrade to Python-2.2.2.perky2002-10-175-30/+44 * Use new PYTHONPREFIX_*DIR variables to make these ports PREFIX-clean.tg2002-06-141-6/+6 * Fix building on the Alpha.tg2002-05-162-4/+10 * Add patch from SF PR #541980. This fixes 4suite.tg2002-04-171-0/+14 * Upgrade to Python-2.2.tg2002-04-124-64/+6 * Add SourceForge as a well connected secondary MASTER_SITES location.tg2002-04-021-0/+2 * Explicitly enable IPv6 support.tg2002-04-021-2/+8 * Fix sizeof(wchar_t) calculation.tg2002-01-211-0/+10 * Implement PyObject_DelItemString(), which was obviously forgotten fortg2002-01-162-0/+57 * Upgrade lang/python to 2.2. Adjust bsd.python.mk accordingly.tg2002-01-074-134/+346 * Re-add fpectl.so to the plist to fix packaging. Re-enable supporttg2001-11-202-2/+2 * Don't build mpz extension, it's moved to a separate port.tg2001-10-193-10/+3 * Depend on math/libgmp when running a recent -current.tg2001-09-251-0/+6 * Upgrade to 2.1.1.tg2001-07-253-2/+10 * Upgrade to 2.1.tg2001-05-0212-1169/+876 * Fix building on -current.tg2001-04-261-0/+38 * -pthread --> ${PTHREAD_LIBS}sobomax2001-03-301-2/+2 * Allow MAINTAINER to be redefined in a slave port.sobomax2001-03-291-1/+1 * MASTER_SITE changed.tg2000-12-071-1/+2 * Install Demo/ dir to $PREFIX/share/examples/python.tg2000-11-292-3/+325 * Fix compilation on FreeBSD-3.x.tg2000-11-131-0/+6 * Upgrade to 2.0.tg2000-10-187-133/+302 * Rename PLIST.{Tools,gmp} to pkg-plist.{Tools,gmp}.asami2000-10-081-3/+3 * Use USE_PYTHON.tg2000-09-281-0/+1 * Upgrade to 1.6.tg2000-09-089-1239/+1726 * Don't create group-writable directories.tg2000-08-141-5/+12 * Clarify comment even further.tg2000-07-281-1/+1 * - Clarify comment on thread support.tg2000-07-271-6/+10 * Standardize all user defined options to the booleans WITH_FOO andreg2000-04-171-5/+3 * Convert to the PORTNAME - PORTVERSION syntax.obrien2000-04-121-3/+3 * Separate the Python Tk module from the main port. I've beentg2000-04-041-15/+1 * Fix packaging on -current.tg2000-03-242-5/+22 * move IPv6-enable python to python+ipv6 and revert origial pythonsumikawa2000-01-273-21/+3 * Add 'ipv6' on CATEGORIES.sumikawa2000-01-181-1/+1 * Oops, forgot to update the checksum file.tg2000-01-181-2/+2 * On second thought, put back DIST_SUBDIR. It's not only used for thetg2000-01-181-0/+1 * - Support IPv6.sumikawa2000-01-133-3/+20 * s/X11_BASE/X11BASE/.tg2000-01-101-1/+1 * - Install python-mode.el.tg