Skip to content

Commit

Permalink
Modularize web3.js (web3#541)
Browse files Browse the repository at this point in the history
* added sub packages

* added lerna monopackage management

* check for package is instance

* added method, subscription and utils package

* moved almost all packages

* moved all packages, no umbrella package yet

* added extend to packages

* made contract pass

* made batch tests pass

* expose providers

* fixed test async

* fixed test errors

* fixed test event encode decode

* fixed test formatter tests

* fixed method tests

* fixed method utils

* fixed some eth methods

* fixed some eth methods 2

* bumped version 0.18.3 to republish meteor package

* fixed get* tests

* fixed subscribe tests

* added newBlockHeaders subscription

* remove unpublished package from package.json

* added sendTransaction test

* fixed call test

* moved files to done

* changed extend

* added iban tests

* Fixed ALL tests

* Fixed lint tests

* Fixed contract tests

* added method tests

* added more method tests to test promiEvents extensively

* added confirmation event

* improved method confirmation checking
  • Loading branch information
frozeman authored Jan 26, 2017
1 parent 0720bf3 commit bbfefb0
Show file tree
Hide file tree
Showing 208 changed files with 3,838 additions and 4,573 deletions.
18 changes: 5 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global

.DS_Store
*.swp
/coverage
/tmp
*/**/*un~
*un~
.DS_Store
*/**/.DS_Store
ethereum/ethereum
ethereal/ethereal
npm-debug.log
.npm/
/coverage
/tmp
example/js
node_modules
bower_components
npm-debug.log
/bower
.npm/
2 changes: 2 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
packages/**/node_modules/
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"eqeqeq": true,
"freeze": true,
"funcscope": false,
"maxcomplexity": 9,
"maxcomplexity": 8,
"maxdepth": 3,
"maxerr": 50,
/*"maxlen": 80*/ /*this should be our goal*/
Expand Down
4 changes: 0 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
example/js
node_modules
test
.gitignore
.editorconfig
.travis.yml
.npmignore
component.json
testling.html
4 changes: 4 additions & 0 deletions dist/web3-light.js
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,11 @@ module.exports = {

},{"./sha3.js":19,"bignumber.js":"bignumber.js","utf8":86}],21:[function(require,module,exports){
module.exports={
<<<<<<< HEAD
"version": "1.0.0"
=======
"version": "0.18.3"
>>>>>>> develop
}

},{}],22:[function(require,module,exports){
Expand Down
9 changes: 8 additions & 1 deletion dist/web3-light.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/web3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,11 @@ module.exports = {

},{"./sha3.js":19,"bignumber.js":"bignumber.js","utf8":86}],21:[function(require,module,exports){
module.exports={
<<<<<<< HEAD
"version": "1.0.0"
=======
"version": "0.18.3"
>>>>>>> develop
}

},{}],22:[function(require,module,exports){
Expand Down
7 changes: 7 additions & 0 deletions dist/web3.js.map

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion dist/web3.min.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions docs/web3-eth-contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ Example
.on('receipt', function(receipt){
// same as when the promise gets resolved, see below
})
.on('confirmation', function(confirmationNumber, receipt){ ... })
.then(function(receipt){
console.log(myContract.options.address) // gives the new contract address
});
Expand Down Expand Up @@ -351,7 +352,7 @@ Example
...
});
// or sending a transaction to a method
// or sending and using the events
myContract.methods.myMethod(123).send({from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'})
.on('transactionHash', function(hash){
Expand All @@ -360,6 +361,7 @@ Example
.on('receipt', function(receipt){
...
})
.on('confirmation', function(confirmationNumber, receipt){ ... })
.on('error', console.error);
Expand Down Expand Up @@ -435,7 +437,7 @@ Parameters
* ``String`` - **from**: The address the transaction should be send from.
* ``String`` - **gasPrice** (optional): The gas price in wei to use for this transaction.
* ``Number`` - **gas** (optional): The maximum gas provided for this transaction (gas limit).
2. ``Function`` - **callback** (optional): This callback will be fired first with the "transactionHash" and later for the "receipt" as second argument, or with an error object as the first argument.
2. ``Function`` - **callback** (optional): This callback will be fired first with the "transactionHash", or with an error object as the first argument.

-------
Returns
Expand All @@ -444,7 +446,8 @@ Returns
``PromiEvent``: A promise combined event emitter. Will be resolved when the transaction *receipt* is available. Additionally the following events are available:

- ``"transactionHash"`` returns ``String``: is fired right after the transaction is send and a transaction hash is available.
- ``"receipt"`` returns ``String``: is fired when the transaction receipt with the contract address is available.
- ``"receipt"`` returns ``Object``: is fired when the transaction receipt is available.
- ``"confirmation"`` returns ``Number``, ``Object``: is fired for every confirmation up to the 12th confirmation. Receives the confirmation number as the first and the receipt as the second argument.
- ``"error"`` returns ``Error``: is fired if an error occurs during deployment.


Expand Down Expand Up @@ -474,6 +477,7 @@ Example
.on('receipt', function(receipt){
...
})
.on('confirmation', function(confirmationNumber, receipt){ ... })
.on('error', console.error);
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict';

var version = require('./lib/version.json');
var version = require('./lerna.json');
var path = require('path');

var del = require('del');
Expand Down
8 changes: 0 additions & 8 deletions index.js

This file was deleted.

7 changes: 7 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": "1.0.0",
"lerna": "2.0.0-beta.32",
"packages": [
"packages/*"
]
}
Loading

0 comments on commit bbfefb0

Please sign in to comment.