Additional work on the JS stuff to make it more similar to Solidity.
This commit is contained in:
parent
113a3809ab
commit
d223ac0379
18
dist/ethereum.js
vendored
18
dist/ethereum.js
vendored
@ -486,6 +486,15 @@ var contract = function (address, desc) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
result._options = {};
|
||||||
|
['gas', 'gasPrice', 'value', 'from'].forEach(function(p) {
|
||||||
|
result[p] = function (v) {
|
||||||
|
result._options[p] = v;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
desc.forEach(function (method) {
|
desc.forEach(function (method) {
|
||||||
|
|
||||||
var displayName = abi.methodDisplayName(method.name);
|
var displayName = abi.methodDisplayName(method.name);
|
||||||
@ -1096,6 +1105,15 @@ var web3 = {
|
|||||||
|
|
||||||
/// eth object prototype
|
/// eth object prototype
|
||||||
eth: {
|
eth: {
|
||||||
|
contractFromAbi: function (abi) {
|
||||||
|
return function(addr) {
|
||||||
|
// Default to address of Config. TODO: rremove prior to genesis.
|
||||||
|
addr = addr || '0xc6d9d2cd449a754c494264e1809c50e34d64562b';
|
||||||
|
var ret = web3.eth.contract(addr, abi);
|
||||||
|
ret.address = addr;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
},
|
||||||
watch: function (params) {
|
watch: function (params) {
|
||||||
return new web3.filter(params, ethWatch);
|
return new web3.filter(params, ethWatch);
|
||||||
}
|
}
|
||||||
|
6
dist/ethereum.js.map
vendored
6
dist/ethereum.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethereum.min.js
vendored
2
dist/ethereum.min.js
vendored
File diff suppressed because one or more lines are too long
@ -75,6 +75,15 @@ var contract = function (address, desc) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
result._options = {};
|
||||||
|
['gas', 'gasPrice', 'value', 'from'].forEach(function(p) {
|
||||||
|
result[p] = function (v) {
|
||||||
|
result._options[p] = v;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
desc.forEach(function (method) {
|
desc.forEach(function (method) {
|
||||||
|
|
||||||
var displayName = abi.methodDisplayName(method.name);
|
var displayName = abi.methodDisplayName(method.name);
|
||||||
|
@ -268,6 +268,15 @@ var web3 = {
|
|||||||
|
|
||||||
/// eth object prototype
|
/// eth object prototype
|
||||||
eth: {
|
eth: {
|
||||||
|
contractFromAbi: function (abi) {
|
||||||
|
return function(addr) {
|
||||||
|
// Default to address of Config. TODO: rremove prior to genesis.
|
||||||
|
addr = addr || '0xc6d9d2cd449a754c494264e1809c50e34d64562b';
|
||||||
|
var ret = web3.eth.contract(addr, abi);
|
||||||
|
ret.address = addr;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
},
|
||||||
watch: function (params) {
|
watch: function (params) {
|
||||||
return new web3.filter(params, ethWatch);
|
return new web3.filter(params, ethWatch);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user