@@ -5,7 +5,6 @@ import { OutputStatus } from '../../src/services/tx/params'
55import { ScriptHashType , Script } from '../../src/types/cell-types'
66import CellsService from '../../src/services/cells'
77import { CapacityNotEnough , CapacityNotEnoughForChange } from '../../src/exceptions/wallet'
8- import SkipDataAndType from '../../src/services/settings/skip-data-and-type'
98
109const randomHex = ( length : number = 64 ) : string => {
1110 const str : string = Array . from ( { length } )
@@ -136,44 +135,30 @@ describe('CellsService', () => {
136135 it ( 'getBalance, Live, skip' , async ( ) => {
137136 await createCells ( )
138137
139- const balance : string = await CellsService . getBalance ( lockHashes , OutputStatus . Live , true )
138+ const balance : string = await CellsService . getBalance ( lockHashes , OutputStatus . Live )
140139 expect ( balance ) . toEqual ( '100' )
141140 } )
142141
143142 it ( 'getBalance, Sent, skip' , async ( ) => {
144143 await createCells ( )
145144
146- const balance : string = await CellsService . getBalance ( lockHashes , OutputStatus . Sent , true )
145+ const balance : string = await CellsService . getBalance ( lockHashes , OutputStatus . Sent )
147146 expect ( balance ) . toEqual ( '200' )
148147 } )
149148
150- it ( 'getBalance, Live, not skip' , async ( ) => {
151- await createCells ( )
152-
153- const balance : string = await CellsService . getBalance ( lockHashes , OutputStatus . Live , false )
154- expect ( balance ) . toEqual ( '11100' )
155- } )
156-
157- it ( 'getBalance, Pending, not skip' , async ( ) => {
158- await createCells ( )
159-
160- const balance : string = await CellsService . getBalance ( lockHashes , OutputStatus . Pending , false )
161- expect ( balance ) . toEqual ( '33300' )
162- } )
163-
164149 it ( 'getBalance with alice' , async ( ) => {
165150 await createCells ( )
166151 await createCell ( '2222' , OutputStatus . Live , false , null , alice )
167152
168- const balance : string = await CellsService . getBalance ( [ alice . lockHash , bob . lockHash ] , OutputStatus . Live , true )
153+ const balance : string = await CellsService . getBalance ( [ alice . lockHash , bob . lockHash ] , OutputStatus . Live )
169154 expect ( balance ) . toEqual ( ( 100 + 2222 ) . toString ( ) )
170155 } )
171156
172157 it ( `get alice's balance` , async ( ) => {
173158 await createCells ( )
174159 await createCell ( '2222' , OutputStatus . Live , false , null , alice )
175160
176- const balance : string = await CellsService . getBalance ( [ alice . lockHash ] , OutputStatus . Live , true )
161+ const balance : string = await CellsService . getBalance ( [ alice . lockHash ] , OutputStatus . Live )
177162 expect ( balance ) . toEqual ( '2222' )
178163 } )
179164 } )
@@ -191,7 +176,6 @@ describe('CellsService', () => {
191176 }
192177
193178 it ( '1000, skip' , async ( ) => {
194- SkipDataAndType . getInstance ( ) . update ( true )
195179 await createCells ( )
196180
197181 const result = await CellsService . gatherInputs ( toShannon ( '1000' ) , lockHashes )
@@ -200,7 +184,6 @@ describe('CellsService', () => {
200184 } )
201185
202186 it ( '1001, skip' , async ( ) => {
203- SkipDataAndType . getInstance ( ) . update ( true )
204187 await createCells ( )
205188
206189 let error
@@ -212,31 +195,7 @@ describe('CellsService', () => {
212195 expect ( error ) . toBeInstanceOf ( CapacityNotEnough )
213196 } )
214197
215- it ( '6000, not skip' , async ( ) => {
216- SkipDataAndType . getInstance ( ) . update ( false )
217- await createCells ( )
218-
219- const ckb = toShannon ( '6000' )
220- const result = await CellsService . gatherInputs ( ckb , lockHashes )
221-
222- expect ( result . capacities ) . toEqual ( ckb )
223- } )
224-
225- it ( '6001, not skip' , async ( ) => {
226- SkipDataAndType . getInstance ( ) . update ( false )
227- await createCells ( )
228-
229- let error
230- try {
231- await CellsService . gatherInputs ( toShannon ( '6001' ) , lockHashes )
232- } catch ( e ) {
233- error = e
234- }
235- expect ( error ) . toBeInstanceOf ( CapacityNotEnough )
236- } )
237-
238198 it ( `bob's and alice's cells` , async ( ) => {
239- SkipDataAndType . getInstance ( ) . update ( true )
240199 await createCells ( )
241200 await createCell ( toShannon ( '5000' ) , OutputStatus . Live , false , null , alice )
242201
@@ -246,7 +205,6 @@ describe('CellsService', () => {
246205 } )
247206
248207 it ( `only bob's cells` , async ( ) => {
249- SkipDataAndType . getInstance ( ) . update ( true )
250208 await createCells ( )
251209 await createCell ( toShannon ( '5000' ) , OutputStatus . Live , false , null , alice )
252210
@@ -274,7 +232,6 @@ describe('CellsService', () => {
274232
275233 describe ( 'skip, by feeRate 1000' , ( ) => {
276234 beforeEach ( async done => {
277- SkipDataAndType . getInstance ( ) . update ( true )
278235 const cells : OutputEntity [ ] = [
279236 generateCell ( toShannon ( '1000' ) , OutputStatus . Live , false , null ) ,
280237 generateCell ( toShannon ( '2000' ) , OutputStatus . Live , false , null ) ,
0 commit comments