Browse Source
cl-refactorab745d3
updated readmeb915c7a
updated readme6c26255
Merge branch 'tests' into develope2c4525
Merge branch 'master' into develope778e12
spec reporter instead of nyana4e6f0b
fixed travis.yml && added nmp test script048e777
Merge branch 'master' into tests15c2293
updated package json24814a4
Merge branch 'master' of https://github.com/ethereum/ethereum.js6188e64
Update README.mdc34b0c6
Update README.md29c60c0
Merge branch 'develop' into testsb3eda29
Merge branch 'master' into testsc397e35
mocha opts file && init of parser testsb6058a8
methods existance tests in progress5518022
mocha test init git-subtree-dir: libjsqrc/ethereumjs git-subtree-split:ab745d3b0e
Gav Wood
10 years ago
13 changed files with 186 additions and 7 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,37 @@ |
|||
var assert = require('assert'); |
|||
var abi = require('../lib/abi.js'); |
|||
|
|||
describe('abi', function() { |
|||
describe('inputParser', function() { |
|||
it('should parse ...', function() { |
|||
|
|||
var desc = [{ |
|||
"name": "multiply", |
|||
"inputs": [ |
|||
{ |
|||
"name": "a", |
|||
"type": "uint256" |
|||
} |
|||
], |
|||
"outputs": [ |
|||
{ |
|||
"name": "d", |
|||
"type": "uint256" |
|||
} |
|||
] |
|||
}]; |
|||
|
|||
var iParser = abi.inputParser(desc); |
|||
assert.equal(iParser.multiply(1), "0x000000000000000000000000000000000000000000000000000000000000000001"); |
|||
|
|||
}); |
|||
}); |
|||
|
|||
|
|||
describe('outputParser', function() { |
|||
it('parse ...', function() { |
|||
|
|||
}); |
|||
}); |
|||
}); |
|||
|
@ -0,0 +1,18 @@ |
|||
require('es6-promise').polyfill(); |
|||
|
|||
var assert = require('assert'); |
|||
var web3 = require('../index.js'); |
|||
var u = require('./utils.js'); |
|||
web3.setProvider(new web3.providers.WebSocketProvider('http://localhost:8080')); // TODO: create some mock provider
|
|||
|
|||
describe('web3', function() { |
|||
describe('db', function() { |
|||
it('should have all methods implemented', function() { |
|||
u.methodExists(web3.db, 'put'); |
|||
u.methodExists(web3.db, 'get'); |
|||
u.methodExists(web3.db, 'putString'); |
|||
u.methodExists(web3.db, 'getString'); |
|||
}); |
|||
}); |
|||
}); |
|||
|
@ -0,0 +1,42 @@ |
|||
require('es6-promise').polyfill(); |
|||
|
|||
var assert = require('assert'); |
|||
var web3 = require('../index.js'); |
|||
var u = require('./utils.js'); |
|||
web3.setProvider(new web3.providers.WebSocketProvider('http://localhost:8080')); // TODO: create some mock provider
|
|||
|
|||
describe('web3', function() { |
|||
describe('eth', function() { |
|||
it('should have all methods implemented', function() { |
|||
u.methodExists(web3.eth, 'balanceAt'); |
|||
u.methodExists(web3.eth, 'stateAt'); |
|||
u.methodExists(web3.eth, 'storageAt'); |
|||
u.methodExists(web3.eth, 'countAt'); |
|||
u.methodExists(web3.eth, 'codeAt'); |
|||
u.methodExists(web3.eth, 'transact'); |
|||
u.methodExists(web3.eth, 'call'); |
|||
u.methodExists(web3.eth, 'block'); |
|||
u.methodExists(web3.eth, 'transaction'); |
|||
u.methodExists(web3.eth, 'uncle'); |
|||
u.methodExists(web3.eth, 'compilers'); |
|||
u.methodExists(web3.eth, 'lll'); |
|||
u.methodExists(web3.eth, 'solidity'); |
|||
u.methodExists(web3.eth, 'serpent'); |
|||
u.methodExists(web3.eth, 'logs'); |
|||
}); |
|||
|
|||
it('should have all properties implemented', function () { |
|||
u.propertyExists(web3.eth, 'coinbase'); |
|||
u.propertyExists(web3.eth, 'listening'); |
|||
u.propertyExists(web3.eth, 'mining'); |
|||
u.propertyExists(web3.eth, 'gasPrice'); |
|||
u.propertyExists(web3.eth, 'account'); |
|||
u.propertyExists(web3.eth, 'accounts'); |
|||
u.propertyExists(web3.eth, 'peerCount'); |
|||
u.propertyExists(web3.eth, 'defaultBlock'); |
|||
u.propertyExists(web3.eth, 'number'); |
|||
}); |
|||
}); |
|||
}); |
|||
|
|||
|
@ -0,0 +1,2 @@ |
|||
--reporter Spec |
|||
|
@ -0,0 +1,19 @@ |
|||
require('es6-promise').polyfill(); |
|||
|
|||
var assert = require('assert'); |
|||
var web3 = require('../index.js'); |
|||
var u = require('./utils.js'); |
|||
web3.setProvider(new web3.providers.WebSocketProvider('http://localhost:8080')); // TODO: create some mock provider
|
|||
|
|||
describe('web3', function() { |
|||
describe('shh', function() { |
|||
it('should have all methods implemented', function() { |
|||
u.methodExists(web3.shh, 'post'); |
|||
u.methodExists(web3.shh, 'newIdentity'); |
|||
u.methodExists(web3.shh, 'haveIdentity'); |
|||
u.methodExists(web3.shh, 'newGroup'); |
|||
u.methodExists(web3.shh, 'addToGroup'); |
|||
}); |
|||
}); |
|||
}); |
|||
|
@ -0,0 +1,15 @@ |
|||
var assert = require('assert'); |
|||
|
|||
var methodExists = function (object, method) { |
|||
assert.equal('function', typeof object[method], 'method ' + method + ' is not implemented'); |
|||
}; |
|||
|
|||
var propertyExists = function (object, property) { |
|||
assert.equal('object', typeof object[property], 'property ' + property + ' is not implemented'); |
|||
}; |
|||
|
|||
module.exports = { |
|||
methodExists: methodExists, |
|||
propertyExists: propertyExists |
|||
}; |
|||
|
@ -0,0 +1,18 @@ |
|||
require('es6-promise').polyfill(); |
|||
|
|||
var assert = require('assert'); |
|||
var web3 = require('../index.js'); |
|||
var u = require('./utils.js'); |
|||
web3.setProvider(new web3.providers.WebSocketProvider('http://localhost:8080')); // TODO: create some mock provider
|
|||
|
|||
describe('web3', function() { |
|||
it('should have all methods implemented', function() { |
|||
u.methodExists(web3, 'sha3'); |
|||
u.methodExists(web3, 'toAscii'); |
|||
u.methodExists(web3, 'fromAscii'); |
|||
u.methodExists(web3, 'toFixed'); |
|||
u.methodExists(web3, 'fromFixed'); |
|||
u.methodExists(web3, 'offset'); |
|||
}); |
|||
}); |
|||
|
Loading…
Reference in new issue