Commit 7e870a4 1 parent 957b22b commit 7e870a4 Copy full SHA for 7e870a4
File tree 1 file changed +8
-11
lines changed
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -203,34 +203,31 @@ var DashTx = ("object" === typeof module && exports) || {};
203
203
} ;
204
204
205
205
Tx . create = function ( myUtils ) {
206
- myUtils = Object . assign ( { } , Tx . utils , myUtils ) ;
206
+ let txInst = { } ;
207
+
208
+ txInst . _utils = Object . assign ( { } , Tx . utils , myUtils ) ;
207
209
208
210
/** @type {TxHashAndSignAll } */
209
- async function hashAndSignAll ( txInfo , keys ) {
210
- let _myUtils = myUtils ;
211
+ txInst . hashAndSignAll = async function ( txInfo , keys ) {
211
212
if ( keys ) {
212
213
//@ts -ignore
213
214
if ( keys . getPrivateKey ) {
214
215
//@ts -ignore
215
- _myUtils . getPrivateKey = keys . getPrivateKey ;
216
+ txInst . _utils . getPrivateKey = keys . getPrivateKey ;
216
217
}
217
218
//@ts -ignore
218
219
else if ( keys . length !== txInfo . inputs . length ) {
219
220
throw new Error (
220
221
`the number and order of 'keys' must match number of 'inputs' - each 'utxo' of the provided private key must be matched to that private key` ,
221
222
) ;
222
223
} else {
223
- _myUtils = Tx . _createKeyUtils ( myUtils , keys ) ;
224
+ txInst . _utils = Tx . _createKeyUtils ( txInst . _utils , keys ) ;
224
225
}
225
226
}
226
227
227
- return await Tx . _hashAndSignAll ( txInfo , _myUtils ) ;
228
- }
229
-
230
- let txInst = {
231
- _utils : myUtils ,
232
- hashAndSignAll : hashAndSignAll ,
228
+ return await Tx . _hashAndSignAll ( txInfo , txInst . _utils ) ;
233
229
} ;
230
+
234
231
return txInst ;
235
232
} ;
236
233
You can’t perform that action at this time.
0 commit comments