ethereumjs-account
Advanced tools
+27
| language: node_js | ||
| node_js: | ||
| - "0.11" | ||
| - "0.12" | ||
| - "4" | ||
| - "5" | ||
| env: | ||
| - CXX=g++-4.8 | ||
| addons: | ||
| apt: | ||
| sources: | ||
| - ubuntu-toolchain-r-test | ||
| packages: | ||
| - g++-4.8 | ||
| env: | ||
| matrix: | ||
| - CXX=g++-4.8 TEST_SUITE=test | ||
| matrix: | ||
| fast_finish: true | ||
| include: | ||
| - os: linux | ||
| node_js: "4" | ||
| env: CXX=g++-4.8 TEST_SUITE=coveralls | ||
| - os: linux | ||
| node_js: "4" | ||
| env: CXX=g++-4.8 TEST_SUITE=lint | ||
| script: npm run $TEST_SUITE |
+3
-18
@@ -39,25 +39,10 @@ const ethUtil = require('ethereumjs-util') | ||
| state.getRaw(this.codeHash, function (err, val) { | ||
| var compiled = val[0] === 1 | ||
| val = val.slice(1) | ||
| cb(err, val, compiled) | ||
| }) | ||
| state.getRaw(this.codeHash, cb) | ||
| } | ||
| Account.prototype.setCode = function (trie, code, compiled, cb) { | ||
| Account.prototype.setCode = function (trie, code, cb) { | ||
| var self = this | ||
| if (arguments.length === 3) { | ||
| cb = compiled | ||
| compiled = false | ||
| } | ||
| this.codeHash = ethUtil.sha3(code) | ||
| // store code for a new contract | ||
| if (!compiled) { | ||
| this.codeHash = ethUtil.sha3(code) | ||
| } | ||
| // set the compile flag | ||
| code = Buffer.concat([new Buffer([compiled]), code]) | ||
| if (this.codeHash.toString('hex') === ethUtil.SHA3_NULL_S) { | ||
@@ -64,0 +49,0 @@ cb(null, new Buffer([])) |
+5
-1
| { | ||
| "name": "ethereumjs-account", | ||
| "version": "2.0.2", | ||
| "version": "2.0.4", | ||
| "description": "Encoding, decoding and validation of Ethereum's Account schema", | ||
@@ -11,2 +11,4 @@ "main": "index.js", | ||
| "scripts": { | ||
| "coverage": "istanbul cover ./test/index.js", | ||
| "coveralls": "npm run coverage && coveralls <coverage/lcov.info", | ||
| "lint": "standard", | ||
@@ -30,2 +32,4 @@ "test": "tape ./test/index.js" | ||
| "devDependencies": { | ||
| "coveralls": "^2.11.4", | ||
| "istanbul": "^0.4.1", | ||
| "standard": "^5.4.1", | ||
@@ -32,0 +36,0 @@ "tape": "^4.0.3" |
+5
-0
| # SYNOPSIS | ||
| [](https://www.npmjs.org/package/ethereumjs-account) | ||
| [](https://travis-ci.org/ethereumjs/ethereumjs-account) | ||
| [](https://coveralls.io/r/ethereumjs/ethereumjs-account) | ||
| [](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode | ||
| [](https://github.com/feross/standard) [](https://gitter.im/ethereum/ethereumjs-lib?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) or #ethereumjs on freenode | ||
@@ -4,0 +9,0 @@ |
+5
-7
| const Account = require('../index.js') | ||
| const rlp = require('rlp') | ||
| const tape = require('tape') | ||
| const ethUtil = require('ethereumjs-util') | ||
@@ -22,6 +20,6 @@ tape('empty constructor', function (tester) { | ||
| var raw = [ | ||
| '0x02', //nonce | ||
| '0x0384', //balance | ||
| '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', //stateRoot | ||
| '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' //codeHash | ||
| '0x02', // nonce | ||
| '0x0384', // balance | ||
| '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', // stateRoot | ||
| '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' // codeHash | ||
| ] | ||
@@ -89,3 +87,3 @@ var account = new Account(raw) | ||
| codeHash: '0xc5d2461236f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' | ||
| }; | ||
| } | ||
| var account = new Account(raw) | ||
@@ -92,0 +90,0 @@ t.equal(account.isContract(), true) |
11253
8.14%5
25%98
5.38%4
100%151
-9.04%