add defaultBlock back

This commit is contained in:
Fabian Vogelsteller 2015-03-23 17:11:19 +01:00
parent b074a5e333
commit b915ceb43f
6 changed files with 17 additions and 17 deletions

13
dist/ethereum.js vendored
View File

@ -1155,7 +1155,7 @@ var setupMethods = function (obj, methods) {
params: params
};
if (callback) {
if (callback && web3.manager.sendAsync) {
return web3.manager.sendAsync(payload, function (err, result) {
callback(null, method.formatOutput(result));
});
@ -1880,15 +1880,13 @@ var compileSolidity = new Method({
var compileLLL = new Method({
name: 'compile.lll',
call: 'eth_compileLLL',
params: 1,
inputFormatter: utils.toHex
params: 1
});
var compileSerpent = new Method({
name: 'compile.serpent',
call: 'eth_compileSerpent',
params: 1,
inputFormatter: utils.toHex
params: 1
});
var flush = new Method({
@ -2282,6 +2280,7 @@ module.exports = filter;
*/
var utils = require('../utils/utils');
var config = require('../utils/config');
/**
* Should the format output to a big number
@ -2295,7 +2294,7 @@ var outputBigNumberFormatter = function (number) {
};
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.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -22,6 +22,7 @@
*/
var utils = require('../utils/utils');
var config = require('../utils/config');
/**
* Should the format output to a big number
@ -35,7 +36,7 @@ var outputBigNumberFormatter = function (number) {
};
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
};
/**

View File

@ -14,8 +14,8 @@ Package.onUse(function(api) {
// api.use('3stack:bignumber@2.0.0', 'client');
api.export('BigNumber', 'client');
api.export('web3', 'client');
// api.export('BigNumber', 'client');
api.export(['web3', 'BigNumber'], 'client');
api.addFiles('dist/ethereum.js', 'client');
api.addFiles('package-init.js', 'client');

View File

@ -25,7 +25,7 @@ var tests = [{
call: 'eth_getBalance'
}, {
args: [0x12d],
formattedArgs: ['0x12d', 'latest'], // here we might want to get current defaultBlock
formattedArgs: ['0x12d', web3.eth.defaultBlock],
result: '0x31981',
formattedResult: '0x31981',
call: 'eth_getBalance'