Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
bacc5aa6
Commit
bacc5aa6
authored
Jan 15, 2015
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
methodExists and propertyExists are now separated tests
parent
472ad432
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
51 deletions
+45
-51
db.methods.js
test/db.methods.js
+4
-6
eth.methods.js
test/eth.methods.js
+24
-28
shh.methods.js
test/shh.methods.js
+5
-7
utils.js
test/utils.js
+6
-2
web3.methods.js
test/web3.methods.js
+6
-8
No files found.
test/db.methods.js
View file @
bacc5aa6
...
...
@@ -7,12 +7,10 @@ web3.setProvider(new web3.providers.WebSocketProvider('http://localhost:8080'));
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'
);
});
u
.
methodExists
(
web3
.
db
,
'put'
);
u
.
methodExists
(
web3
.
db
,
'get'
);
u
.
methodExists
(
web3
.
db
,
'putString'
);
u
.
methodExists
(
web3
.
db
,
'getString'
);
});
});
test/eth.methods.js
View file @
bacc5aa6
...
...
@@ -7,35 +7,31 @@ web3.setProvider(new web3.providers.WebSocketProvider('http://localhost:8080'));
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'
);
});
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'
);
});
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'
);
});
});
...
...
test/shh.methods.js
View file @
bacc5aa6
...
...
@@ -7,13 +7,11 @@ web3.setProvider(new web3.providers.WebSocketProvider('http://localhost:8080'));
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'
);
});
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'
);
});
});
test/utils.js
View file @
bacc5aa6
var
assert
=
require
(
'assert'
);
var
methodExists
=
function
(
object
,
method
)
{
assert
.
equal
(
'function'
,
typeof
object
[
method
],
'method '
+
method
+
' is not implemented'
);
it
(
'should have method '
+
method
+
' implemented'
,
function
()
{
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'
);
it
(
'should have property '
+
property
+
' implemented'
,
function
()
{
assert
.
equal
(
'object'
,
typeof
object
[
property
],
'property '
+
property
+
' is not implemented'
);
});
};
module
.
exports
=
{
...
...
test/web3.methods.js
View file @
bacc5aa6
...
...
@@ -6,13 +6,11 @@ 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'
);
});
u
.
methodExists
(
web3
,
'sha3'
);
u
.
methodExists
(
web3
,
'toAscii'
);
u
.
methodExists
(
web3
,
'fromAscii'
);
u
.
methodExists
(
web3
,
'toFixed'
);
u
.
methodExists
(
web3
,
'fromFixed'
);
u
.
methodExists
(
web3
,
'offset'
);
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment