mirror of https://github.com/status-im/web3.js.git
add defaultBlock back
This commit is contained in:
parent
b074a5e333
commit
b915ceb43f
|
@ -1155,7 +1155,7 @@ var setupMethods = function (obj, methods) {
|
||||||
params: params
|
params: params
|
||||||
};
|
};
|
||||||
|
|
||||||
if (callback) {
|
if (callback && web3.manager.sendAsync) {
|
||||||
return web3.manager.sendAsync(payload, function (err, result) {
|
return web3.manager.sendAsync(payload, function (err, result) {
|
||||||
callback(null, method.formatOutput(result));
|
callback(null, method.formatOutput(result));
|
||||||
});
|
});
|
||||||
|
@ -1880,15 +1880,13 @@ var compileSolidity = new Method({
|
||||||
var compileLLL = new Method({
|
var compileLLL = new Method({
|
||||||
name: 'compile.lll',
|
name: 'compile.lll',
|
||||||
call: 'eth_compileLLL',
|
call: 'eth_compileLLL',
|
||||||
params: 1,
|
params: 1
|
||||||
inputFormatter: utils.toHex
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var compileSerpent = new Method({
|
var compileSerpent = new Method({
|
||||||
name: 'compile.serpent',
|
name: 'compile.serpent',
|
||||||
call: 'eth_compileSerpent',
|
call: 'eth_compileSerpent',
|
||||||
params: 1,
|
params: 1
|
||||||
inputFormatter: utils.toHex
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var flush = new Method({
|
var flush = new Method({
|
||||||
|
@ -2282,6 +2280,7 @@ module.exports = filter;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var utils = require('../utils/utils');
|
var utils = require('../utils/utils');
|
||||||
|
var config = require('../utils/config');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should the format output to a big number
|
* Should the format output to a big number
|
||||||
|
@ -2295,7 +2294,7 @@ var outputBigNumberFormatter = function (number) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var inputDefaultBlockNumberFormatter = function (blockNumber) {
|
var inputDefaultBlockNumberFormatter = function (blockNumber) {
|
||||||
return blockNumber === undefined ? "latest" : utils.toHex(blockNumber); // instead use default block number here
|
return blockNumber === undefined ? config.ETH_DEFAULTBLOCK : utils.toHex(blockNumber); // instead use default block number here
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2464,7 +2463,7 @@ module.exports = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
},{"../utils/utils":6}],16:[function(require,module,exports){
|
},{"../utils/config":5,"../utils/utils":6}],16:[function(require,module,exports){
|
||||||
/*
|
/*
|
||||||
This file is part of ethereum.js.
|
This file is part of ethereum.js.
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var utils = require('../utils/utils');
|
var utils = require('../utils/utils');
|
||||||
|
var config = require('../utils/config');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should the format output to a big number
|
* Should the format output to a big number
|
||||||
|
@ -35,7 +36,7 @@ var outputBigNumberFormatter = function (number) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var inputDefaultBlockNumberFormatter = function (blockNumber) {
|
var inputDefaultBlockNumberFormatter = function (blockNumber) {
|
||||||
return blockNumber === undefined ? "latest" : utils.toHex(blockNumber); // instead use default block number here
|
return blockNumber === undefined ? config.ETH_DEFAULTBLOCK : utils.toHex(blockNumber); // instead use default block number here
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,8 +14,8 @@ Package.onUse(function(api) {
|
||||||
|
|
||||||
// api.use('3stack:bignumber@2.0.0', 'client');
|
// api.use('3stack:bignumber@2.0.0', 'client');
|
||||||
|
|
||||||
api.export('BigNumber', 'client');
|
// api.export('BigNumber', 'client');
|
||||||
api.export('web3', 'client');
|
api.export(['web3', 'BigNumber'], 'client');
|
||||||
|
|
||||||
api.addFiles('dist/ethereum.js', 'client');
|
api.addFiles('dist/ethereum.js', 'client');
|
||||||
api.addFiles('package-init.js', 'client');
|
api.addFiles('package-init.js', 'client');
|
||||||
|
|
|
@ -25,7 +25,7 @@ var tests = [{
|
||||||
call: 'eth_getBalance'
|
call: 'eth_getBalance'
|
||||||
}, {
|
}, {
|
||||||
args: [0x12d],
|
args: [0x12d],
|
||||||
formattedArgs: ['0x12d', 'latest'], // here we might want to get current defaultBlock
|
formattedArgs: ['0x12d', web3.eth.defaultBlock],
|
||||||
result: '0x31981',
|
result: '0x31981',
|
||||||
formattedResult: '0x31981',
|
formattedResult: '0x31981',
|
||||||
call: 'eth_getBalance'
|
call: 'eth_getBalance'
|
||||||
|
|
Loading…
Reference in New Issue