Skip to content

Commit

Permalink
Merge branch '1.0' into issue/1466
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida authored Aug 17, 2018
2 parents 2232df8 + 213d32b commit fd8cb55
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 239 deletions.
192 changes: 0 additions & 192 deletions docs/web3-eth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1372,198 +1372,6 @@ Example
},{...}]
------------------------------------------------------------------------------


getCompilers
=====================

.. code-block:: javascript
web3.eth.getCompilers([callback])
Gets a list of available compilers.

----------
Parameters
----------

1. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.

-------
Returns
-------

``Promise`` returns ``Array`` - An array of strings of available compilers.

-------
Example
-------


.. code-block:: javascript
web3.eth.getCompilers()
.then(console.log);
> ["lll", "solidity", "serpent"]
------------------------------------------------------------------------------

compile.solidity
=====================

.. code-block:: javascript
web3.eth.compile.solidity(sourceCode [, callback])
Compiles solidity source code.

----------
Parameters
----------

1. ``String`` - The solidity source code.
2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.

-------
Returns
-------

``Promise`` returns ``Object`` - Contract and compiler info.

-------
Example
-------


.. code-block:: javascript
var source = "" +
"contract test {\n" +
" function multiply(uint a) returns(uint d) {\n" +
" return a * 7;\n" +
" }\n" +
"}\n";
web3.eth.compile.solidity(source)
.then(console.log);
> {
"test": {
"code": "0x605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056",
"info": {
"source": "contract test {\n\tfunction multiply(uint a) returns(uint d) {\n\t\treturn a * 7;\n\t}\n}\n",
"language": "Solidity",
"languageVersion": "0",
"compilerVersion": "0.8.2",
"abiDefinition": [
{
"constant": false,
"inputs": [
{
"name": "a",
"type": "uint256"
}
],
"name": "multiply",
"outputs": [
{
"name": "d",
"type": "uint256"
}
],
"type": "function"
}
],
"userDoc": {
"methods": {}
},
"developerDoc": {
"methods": {}
}
}
}
}
------------------------------------------------------------------------------


compile.lll
=====================

.. code-block:: javascript
web3. eth.compile.lll(sourceCode [, callback])
Compiles LLL source code.

----------
Parameters
----------

1. ``String`` - The LLL source code.
2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.

-------
Returns
-------


``Promise`` returns ``String`` - The compiled LLL code as HEX string.


-------
Example
-------


.. code-block:: javascript
var source = "...";
web3.eth.compile.lll(source)
.then(console.log);
> "0x603880600c6000396000f3006001600060e060020a600035048063c6888fa114601857005b6021600435602b565b8060005260206000f35b600081600702905091905056"
------------------------------------------------------------------------------

compile.serpent
=====================

.. code-block:: javascript
web3.eth.compile.serpent(sourceCode [, callback])
Compiles serpent source code.

----------
Parameters
----------

1. ``String`` - The serpent source code.
2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.

-------
Returns
-------


``Promise`` returns ``String`` - The compiled serpent code as HEX string.


.. code-block:: javascript
var source = "...";
var code = web3.eth.compile.serpent(source)
.then(console.log);
> "0x603880600c6000396000f3006001600060e060020a600035048063c6888fa114601857005b6021600435602b565b8060005260206000f35b600081600702905091905056"
------------------------------------------------------------------------------

getWork
Expand Down
20 changes: 0 additions & 20 deletions packages/web3-eth/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,6 @@ var Eth = function Eth() {
inputFormatter: [formatter.inputCallFormatter],
outputFormatter: utils.hexToNumber
}),
new Method({
name: 'getCompilers',
call: 'eth_getCompilers',
params: 0
}),
new Method({
name: 'compile.solidity',
call: 'eth_compileSolidity',
params: 1
}),
new Method({
name: 'compile.lll',
call: 'eth_compileLLL',
params: 1
}),
new Method({
name: 'compile.serpent',
call: 'eth_compileSerpent',
params: 1
}),
new Method({
name: 'submitWork',
call: 'eth_submitWork',
Expand Down
4 changes: 4 additions & 0 deletions packages/web3-providers-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,9 @@ HttpProvider.prototype.send = function (payload, callback) {
}
};

HttpProvider.prototype.disconnect = function () {
//NO OP
}


module.exports = HttpProvider;
4 changes: 2 additions & 2 deletions packages/web3-providers-ws/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/web3-providers-ws/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,10 @@ WebsocketProvider.prototype.reset = function () {
this.addDefaultEvents();
};

WebsocketProvider.prototype.disconnect = function () {
if (this.connection) {
this.connection.close();
}
}

module.exports = WebsocketProvider;
21 changes: 0 additions & 21 deletions test/eth.getCompilers.js

This file was deleted.

4 changes: 0 additions & 4 deletions test/eth_methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ describe('eth', function() {
u.methodExists(eth, 'getBlock');
u.methodExists(eth, 'getTransaction');
u.methodExists(eth, 'getUncle');
u.methodExists(eth, 'getCompilers');
u.methodExists(eth.compile, 'lll');
u.methodExists(eth.compile, 'solidity');
u.methodExists(eth.compile, 'serpent');
u.methodExists(eth, 'getBlockTransactionCount');
u.methodExists(eth, 'getBlockUncleCount');
u.methodExists(eth, 'subscribe');
Expand Down

0 comments on commit fd8cb55

Please sign in to comment.