File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var sinon = require ( 'sinon' ) ;
4
+ var FeeService = require ( '../../../lib/services/fee' ) ;
5
+
6
+ var expect = require ( 'chai' ) . expect ;
7
+
8
+ describe . only ( '#Fee Service' , function ( ) {
9
+ var feeService ;
10
+ var sandbox ;
11
+ beforeEach ( function ( ) {
12
+ sandbox = sinon . sandbox . create ( ) ;
13
+ feeService = new FeeService ( {
14
+ "rpc" : {
15
+ "user" : "bitcoin" ,
16
+ "pass" : "local321" ,
17
+ "host" : "localhost" ,
18
+ "protocol" : "http" ,
19
+ "port" : 8332
20
+ }
21
+ } ) ;
22
+ } ) ;
23
+
24
+ afterEach ( function ( ) {
25
+ sandbox . restore ( ) ;
26
+ } ) ;
27
+
28
+ /*
29
+ Running in regtest mode or unsync'd will return -1
30
+ */
31
+
32
+ it ( "Has an estimateFee method" , function ( ) {
33
+ var method = feeService . getAPIMethods ( ) [ 0 ] [ 0 ] ;
34
+ expect ( method ) . to . equal ( 'estimateFee' ) ;
35
+ } )
36
+
37
+ it ( "Can estimate fees" , function ( done ) {
38
+ feeService . estimateFee ( 4 , function ( err , fee ) {
39
+ expect ( err ) . to . be . a ( 'null' ) ;
40
+ expect ( fee . result ) . to . exist ;
41
+ expect ( fee . result ) . to . be . at . least ( - 1 ) ;
42
+ done ( ) ;
43
+ } ) ;
44
+ } )
45
+
46
+
47
+ } ) ;
You can’t perform that action at this time.
0 commit comments