-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
126 lines (112 loc) · 3.87 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
var blocks = require('./blockscout.js');
var assert = require('assert');
describe('Load', function() {
var bs = new blocks("https://blockscout.com/", "poa/core");
describe('blockScout()', function() {
it('should return class where versions contains the word core', function() {
if(bs.versions.toString().indexOf("core") !== -1){
assert.ok;
}
});
});
describe('balance()', function() {
it('should return float greater then 0.000000000000000001', function() {
bs.balance("0x0Fe18f369c7F34208922cAEBbd5d21E131E44692", function(r){
if(r.success){
if(r.data > 0.000000000000000001){
assert.ok
}
}else{
assert.fail
}
});
});
});
describe('balanceMulti()', function() {
it('should return success and balance1 is float greater then 0.000000000000000001', function() {
bs.balanceMulti("0x0Fe18f369c7F34208922cAEBbd5d21E131E44692,0x11c4469d974f8af5ba9ec99f3c42c07c848c861c", function(r){
if(r.success){
if(r.data[0].balance > 0.000000000000000001){
assert.ok
}
assert.ok
}else{
assert.fail
}
});
});
});
describe('txList()', function() {
it('should return success', function() {
bs.txList("0x0Fe18f369c7F34208922cAEBbd5d21E131E44692", function(r){
if(r.success){
assert.ok
}else{
assert.fail
}
});
});
});
describe('txListInternal()', function() {
it('gasUsed in last transaction hould be larger then 0', function() {
bs.txListInternal("0x759630ce113d098fccf211da4a7c1ce79ffe2c76b477eaf053351b3c356d1a00", function(r){
if(r.success){
if(r.data[0].gasUsed > 0){
assert.ok
}
}else{
assert.fail
}
});
});
});
describe('tokenTxList()', function() {
it('should return success', function() {
bs.tokenTxList("0x0Fe18f369c7F34208922cAEBbd5d21E131E44692", function(r){
if(r.success){
assert.ok
}else{
assert.fail
}
});
});
});
describe('tokenBalance()', function() {
it('should return true with balance larger then -0 for contract', function() {
bs.tokenBalance("0x11c4469d974f8af5ba9ec99f3c42c07c848c861c&address", "0x0Fe18f369c7F34208922cAEBbd5d21E131E44692", function(r){
if(r.success){
if(r.data > -0){
assert.ok
}else{
assert.fail
}
}else{
assert.fail
}
});
});
});
describe('tokenBalance()', function() {
it('should return success', function() {
bs.tokenList("0x11c4469d974f8af5ba9ec99f3c42c07c848c861c", function(r){
if(r.success){
assert.true
}else{
assert.false
}
});
});
});
describe('tokenBalance()', function() {
it('should return success', function() {
bs.getMinedBlocks("0x11c4469d974f8af5ba9ec99f3c42c07c848c861c", function(r){
if(r.success){
assert.ok
}else{
assert.fail
}
});
});
});
console.log(bs.versions);
});