Merge branch 'develop' into tests

This commit is contained in:
Marek Kotewicz 2015-01-09 16:48:44 +01:00
commit 29c60c000a
5 changed files with 20 additions and 12 deletions

9
dist/ethereum.js vendored
View File

@ -268,7 +268,7 @@ var methodSignature = function (json, name) {
result += inputTypes.join(','); result += inputTypes.join(',');
result += ')'; result += ')';
return web3.sha3(result); return web3.sha3(web3.fromAscii(result));
}; };
module.exports = { module.exports = {
@ -411,6 +411,9 @@ if ("build" !== 'build') {/*
var abi = require('./abi'); var abi = require('./abi');
// method signature length in bytes
var ETH_METHOD_SIGNATURE_LENGTH = 4;
var contract = function (address, desc) { var contract = function (address, desc) {
var inputParser = abi.inputParser(desc); var inputParser = abi.inputParser(desc);
var outputParser = abi.outputParser(desc); var outputParser = abi.outputParser(desc);
@ -431,7 +434,7 @@ var contract = function (address, desc) {
extra = extra || {}; extra = extra || {};
extra.to = address; extra.to = address;
return abi.methodSignature(desc, method.name).then(function (signature) { return abi.methodSignature(desc, method.name).then(function (signature) {
extra.data = signature.slice(0, 10) + parsed; extra.data = signature.slice(0, 2 + ETH_METHOD_SIGNATURE_LENGTH * 2) + parsed;
return web3.eth.call(extra).then(onSuccess); return web3.eth.call(extra).then(onSuccess);
}); });
}, },
@ -1101,6 +1104,7 @@ function messageHandler(data) {
} }
} }
if (typeof(module) !== "undefined")
module.exports = web3; module.exports = web3;
},{}],7:[function(require,module,exports){ },{}],7:[function(require,module,exports){
@ -1180,6 +1184,7 @@ Object.defineProperty(WebSocketProvider.prototype, "onmessage", {
set: function(provider) { this.onMessage(provider); } set: function(provider) { this.onMessage(provider); }
}); });
if (typeof(module) !== "undefined")
module.exports = WebSocketProvider; module.exports = WebSocketProvider;
},{}],"web3":[function(require,module,exports){ },{}],"web3":[function(require,module,exports){

10
dist/ethereum.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -267,7 +267,7 @@ var methodSignature = function (json, name) {
result += inputTypes.join(','); result += inputTypes.join(',');
result += ')'; result += ')';
return web3.sha3(result); return web3.sha3(web3.fromAscii(result));
}; };
module.exports = { module.exports = {

View File

@ -27,6 +27,9 @@ if (process.env.NODE_ENV !== 'build') {
var abi = require('./abi'); var abi = require('./abi');
// method signature length in bytes
var ETH_METHOD_SIGNATURE_LENGTH = 4;
var contract = function (address, desc) { var contract = function (address, desc) {
var inputParser = abi.inputParser(desc); var inputParser = abi.inputParser(desc);
var outputParser = abi.outputParser(desc); var outputParser = abi.outputParser(desc);
@ -47,7 +50,7 @@ var contract = function (address, desc) {
extra = extra || {}; extra = extra || {};
extra.to = address; extra.to = address;
return abi.methodSignature(desc, method.name).then(function (signature) { return abi.methodSignature(desc, method.name).then(function (signature) {
extra.data = signature.slice(0, 10) + parsed; extra.data = signature.slice(0, 2 + ETH_METHOD_SIGNATURE_LENGTH * 2) + parsed;
return web3.eth.call(extra).then(onSuccess); return web3.eth.call(extra).then(onSuccess);
}); });
}, },