1
1
'use strict' ;
2
2
const assert = require ( 'chai' ) . assert ;
3
3
const init = require ( '../.' ) . init ;
4
- describe ( 'api' , function ( ) {
4
+ describe ( 'api' , function ( ) {
5
5
6
- describe ( 'account' , function ( ) {
7
- it ( 'getminedblocks' , function ( done ) {
6
+ describe ( 'account' , function ( ) {
7
+ it ( 'getminedblocks' , function ( done ) {
8
8
var api = init ( ) ;
9
9
var txlist = api . account . getminedblocks ( '0x9dd134d14d1e65f84b706d6f205cd5b1cd03a46b' ) ;
10
- txlist . then ( function ( res ) {
10
+ txlist . then ( function ( res ) {
11
11
assert . ok ( res ) ;
12
12
done ( ) ;
13
13
} ) ;
@@ -28,233 +28,233 @@ describe('api', function () {
28
28
// done();
29
29
// });
30
30
// });
31
- it ( 'tokenbalance by address' , function ( done ) {
31
+ it ( 'tokenbalance by address' , function ( done ) {
32
32
var api = init ( ) ;
33
33
var supply = api . account . tokenbalance ( '0xe04f27eb70e025b78871a2ad7eabe85e61212761' , false , '0x57d90b64a1a57749b0f932f1a3395792e12e7055' ) ;
34
- supply . then ( function ( res ) {
34
+ supply . then ( function ( res ) {
35
35
assert . ok ( res ) ;
36
36
done ( ) ;
37
37
} ) ;
38
38
} ) ;
39
- it ( 'txlist' , function ( done ) {
39
+ it ( 'txlist' , function ( done ) {
40
40
var api = init ( ) ;
41
41
var txlist = api . account . txlist ( '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' ) ;
42
- txlist . then ( function ( res ) {
42
+ txlist . then ( function ( res ) {
43
43
assert . ok ( res ) ;
44
44
done ( ) ;
45
45
} ) ;
46
46
} ) ;
47
- it ( 'txlistinternal by hash' , function ( done ) {
47
+ it ( 'txlistinternal by hash' , function ( done ) {
48
48
var api = init ( ) ;
49
49
var txlist = api . account . txlistinternal ( '0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170' ) ;
50
50
txlist
51
- . then ( function ( res ) {
51
+ . then ( function ( res ) {
52
52
assert . ok ( res ) ;
53
53
done ( ) ;
54
54
} )
55
55
. catch ( done ) ;
56
56
} ) ;
57
- it ( 'txlistinternal by address' , function ( done ) {
57
+ it ( 'txlistinternal by address' , function ( done ) {
58
58
var api = init ( ) ;
59
59
var txlist = api . account . txlistinternal ( null , '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' ) ;
60
- txlist . then ( function ( res ) {
60
+ txlist . then ( function ( res ) {
61
61
assert . ok ( res ) ;
62
62
done ( ) ;
63
63
} ) ;
64
64
} ) ;
65
- it ( 'balance' , function ( done ) {
65
+ it ( 'balance' , function ( done ) {
66
66
var api = init ( ) ;
67
67
var balance = api . account . balance ( '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' ) ;
68
- balance . then ( function ( res ) {
68
+ balance . then ( function ( res ) {
69
69
assert . ok ( res ) ;
70
70
done ( ) ;
71
71
} ) ;
72
72
} ) ;
73
- it ( 'balance multi' , function ( done ) {
73
+ it ( 'balance multi' , function ( done ) {
74
74
var api = init ( ) ;
75
75
var balance = api . account . balance ( [ '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' ] ) ;
76
- balance . then ( function ( res ) {
76
+ balance . then ( function ( res ) {
77
77
assert . ok ( res ) ;
78
78
done ( ) ;
79
79
} ) ;
80
80
} ) ;
81
81
} ) ;
82
- describe ( 'stats' , function ( ) {
83
- it ( 'ethsupply' , function ( done ) {
82
+ describe ( 'stats' , function ( ) {
83
+ it ( 'ethsupply' , function ( done ) {
84
84
var api = init ( ) ;
85
85
var supply = api . stats . ethsupply ( ) ;
86
- supply . then ( function ( res ) {
86
+ supply . then ( function ( res ) {
87
87
assert . ok ( res ) ;
88
88
done ( ) ;
89
89
} ) ;
90
90
} ) ;
91
- it ( 'tokensupply by tokenname' , function ( done ) {
91
+ it ( 'tokensupply by tokenname' , function ( done ) {
92
92
var api = init ( ) ;
93
93
var supply = api . stats . tokensupply ( 'MKR' ) ;
94
- supply . then ( function ( res ) {
94
+ supply . then ( function ( res ) {
95
95
assert . ok ( res ) ;
96
96
done ( ) ;
97
97
} ) ;
98
98
} ) ;
99
- it ( 'tokensupply by address' , function ( done ) {
99
+ it ( 'tokensupply by address' , function ( done ) {
100
100
var api = init ( ) ;
101
101
var supply = api . stats . tokensupply ( null , '0x57d90b64a1a57749b0f932f1a3395792e12e7055' ) ;
102
- supply . then ( function ( res ) {
102
+ supply . then ( function ( res ) {
103
103
assert . ok ( res ) ;
104
104
done ( ) ;
105
105
} ) . catch ( done ) ;
106
106
} ) ;
107
- it ( 'ethprice' , function ( done ) {
107
+ it ( 'ethprice' , function ( done ) {
108
108
var api = init ( ) ;
109
109
var price = api . stats . ethprice ( ) ;
110
- price . then ( function ( res ) {
110
+ price . then ( function ( res ) {
111
111
assert . ok ( res ) ;
112
112
done ( ) ;
113
113
} ) . catch ( done ) ;
114
114
} ) ;
115
115
} ) ;
116
- it ( 'block.getblockreward' , function ( done ) {
116
+ it ( 'block.getblockreward' , function ( done ) {
117
117
var api = init ( ) ;
118
118
var blockreward = api . block . getblockreward ( ) ;
119
- blockreward . then ( function ( res ) {
119
+ blockreward . then ( function ( res ) {
120
120
assert . ok ( res ) ;
121
121
done ( ) ;
122
122
} ) ;
123
123
} ) ;
124
- it ( 'transaction.getstatus' , function ( done ) {
124
+ it ( 'transaction.getstatus' , function ( done ) {
125
125
var api = init ( ) ;
126
126
var status = api . transaction . getstatus ( '0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a' ) ;
127
- status . then ( function ( res ) {
127
+ status . then ( function ( res ) {
128
128
assert . ok ( res ) ;
129
129
done ( ) ;
130
130
} ) ;
131
131
} ) ;
132
- xit ( 'contract.getabi' , function ( done ) {
132
+ xit ( 'contract.getabi' , function ( done ) {
133
133
var api = init ( ) ;
134
134
var abi = api . contract . getabi ( '0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413' ) ;
135
- abi . then ( function ( res ) {
135
+ abi . then ( function ( res ) {
136
136
assert . ok ( res ) ;
137
137
done ( ) ;
138
138
} ) ;
139
139
} ) ;
140
- describe ( 'proxy' , function ( ) {
141
- it ( 'proxy.eth_blockNumber' , function ( done ) {
140
+ describe ( 'proxy' , function ( ) {
141
+ it ( 'proxy.eth_blockNumber' , function ( done ) {
142
142
var api = init ( ) ;
143
143
var res = api . proxy . eth_blockNumber ( ) ;
144
- res . then ( function ( res ) {
144
+ res . then ( function ( res ) {
145
145
assert . ok ( res ) ;
146
146
done ( ) ;
147
147
} ) ;
148
148
} ) ;
149
- it ( 'proxy.eth_getBlockByNumber' , function ( done ) {
149
+ it ( 'proxy.eth_getBlockByNumber' , function ( done ) {
150
150
var api = init ( ) ;
151
151
var res = api . proxy . eth_getBlockByNumber ( '0x10d4f' ) ;
152
- res . then ( function ( res ) {
152
+ res . then ( function ( res ) {
153
153
assert . ok ( res ) ;
154
154
done ( ) ;
155
155
} ) ;
156
156
} ) ;
157
- it ( 'proxy.eth_getUncleByBlockNumberAndIndex' , function ( done ) {
157
+ it ( 'proxy.eth_getUncleByBlockNumberAndIndex' , function ( done ) {
158
158
var api = init ( ) ;
159
159
var res = api . proxy . eth_getUncleByBlockNumberAndIndex ( '0x210A9B' , '0x0' ) ;
160
- res . then ( function ( res ) {
160
+ res . then ( function ( res ) {
161
161
assert . ok ( res ) ;
162
162
done ( ) ;
163
163
} ) ;
164
164
} ) ;
165
- it ( 'proxy.eth_getBlockTransactionCountByNumber' , function ( done ) {
165
+ it ( 'proxy.eth_getBlockTransactionCountByNumber' , function ( done ) {
166
166
var api = init ( ) ;
167
167
var res = api . proxy . eth_getBlockTransactionCountByNumber ( '0x10FB78' ) ;
168
- res . then ( function ( res ) {
168
+ res . then ( function ( res ) {
169
169
assert . ok ( res ) ;
170
170
done ( ) ;
171
171
} ) ;
172
172
} ) ;
173
- it ( 'proxy.eth_getTransactionByHash' , function ( done ) {
173
+ it ( 'proxy.eth_getTransactionByHash' , function ( done ) {
174
174
var api = init ( ) ;
175
175
var res = api . proxy . eth_getTransactionByHash ( '0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1' ) ;
176
- res . then ( function ( res ) {
176
+ res . then ( function ( res ) {
177
177
assert . ok ( res ) ;
178
178
done ( ) ;
179
179
} ) ;
180
180
} ) ;
181
- it ( 'proxy.eth_getTransactionByBlockNumberAndIndex' , function ( done ) {
181
+ it ( 'proxy.eth_getTransactionByBlockNumberAndIndex' , function ( done ) {
182
182
var api = init ( ) ;
183
183
var res = api . proxy . eth_getTransactionByBlockNumberAndIndex ( '0x10d4f' , '0x0' ) ;
184
- res . then ( function ( res ) {
184
+ res . then ( function ( res ) {
185
185
assert . ok ( res ) ;
186
186
done ( ) ;
187
187
} ) ;
188
188
} ) ;
189
- it ( 'proxy.eth_getTransactionCount' , function ( done ) {
189
+ it ( 'proxy.eth_getTransactionCount' , function ( done ) {
190
190
var api = init ( ) ;
191
191
var res = api . proxy . eth_getTransactionCount ( '0x2910543af39aba0cd09dbb2d50200b3e800a63d2' ) ;
192
- res . then ( function ( res ) {
192
+ res . then ( function ( res ) {
193
193
assert . ok ( res ) ;
194
194
done ( ) ;
195
195
} ) ;
196
196
} ) ;
197
- xit ( 'proxy.eth_sendRawTransaction' , function ( done ) {
197
+ xit ( 'proxy.eth_sendRawTransaction' , function ( done ) {
198
198
var api = init ( ) ;
199
199
var res = api . proxy . eth_sendRawTransaction ( '0xf904808000831cfde080' ) ;
200
- res . then ( function ( res ) {
200
+ res . then ( function ( res ) {
201
201
assert . ok ( res ) ;
202
202
done ( ) ;
203
203
} ) ;
204
204
} ) ;
205
- it ( 'proxy.eth_getTransactionReceipt' , function ( done ) {
205
+ it ( 'proxy.eth_getTransactionReceipt' , function ( done ) {
206
206
var api = init ( ) ;
207
207
var res = api . proxy . eth_getTransactionReceipt ( '0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1' ) ;
208
- res . then ( function ( res ) {
208
+ res . then ( function ( res ) {
209
209
assert . ok ( res ) ;
210
210
done ( ) ;
211
211
} ) ;
212
212
} ) ;
213
- it ( 'proxy.eth_call' , function ( done ) {
213
+ it ( 'proxy.eth_call' , function ( done ) {
214
214
var api = init ( ) ;
215
215
var res = api . proxy . eth_call (
216
216
'0xAEEF46DB4855E25702F8237E8f403FddcaF931C0' ,
217
217
'0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724' ,
218
218
'latest'
219
219
) ;
220
- res . then ( function ( res ) {
220
+ res . then ( function ( res ) {
221
221
assert . ok ( res ) ;
222
222
done ( ) ;
223
223
} ) ;
224
224
} ) ;
225
- it ( 'proxy.eth_getCode' , function ( done ) {
225
+ it ( 'proxy.eth_getCode' , function ( done ) {
226
226
var api = init ( ) ;
227
227
var res = api . proxy . eth_getCode ( '0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c' , 'latest' ) ;
228
- res . then ( function ( res ) {
228
+ res . then ( function ( res ) {
229
229
assert . ok ( res ) ;
230
230
done ( ) ;
231
231
} ) ;
232
232
} ) ;
233
- it ( 'proxy.eth_getStorageAt' , function ( done ) {
233
+ it ( 'proxy.eth_getStorageAt' , function ( done ) {
234
234
var api = init ( ) ;
235
235
var res = api . proxy . eth_getStorageAt ( '0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd' , '0x0' , 'latest' ) ;
236
- res . then ( function ( res ) {
236
+ res . then ( function ( res ) {
237
237
assert . ok ( res ) ;
238
238
done ( ) ;
239
239
} ) ;
240
240
} ) ;
241
- it ( 'proxy.eth_gasPrice' , function ( done ) {
241
+ it ( 'proxy.eth_gasPrice' , function ( done ) {
242
242
var api = init ( ) ;
243
243
var res = api . proxy . eth_gasPrice ( ) ;
244
- res . then ( function ( res ) {
244
+ res . then ( function ( res ) {
245
245
assert . ok ( res ) ;
246
246
done ( ) ;
247
247
} ) ;
248
248
} ) ;
249
- xit ( 'proxy.eth_estimateGas' , function ( done ) {
249
+ xit ( 'proxy.eth_estimateGas' , function ( done ) {
250
250
var api = init ( ) ;
251
251
var res = api . proxy . eth_estimateGas (
252
252
'0xf0160428a8552ac9bb7e050d90eeade4ddd52843' ,
253
253
'0xff22' ,
254
254
'0x051da038cc' ,
255
255
'0xffffff'
256
256
) ;
257
- res . then ( function ( res ) {
257
+ res . then ( function ( res ) {
258
258
assert . ok ( res ) ;
259
259
done ( ) ;
260
260
} ) ;
0 commit comments