@@ -12,7 +12,7 @@ import {
1212 UtxoPsbt ,
1313 UtxoTransaction ,
1414} from '../../../src/bitgo' ;
15- import { constructTxnBuilder , Input as TestUtilInput , TxnInput } from '../../../src/testutil' ;
15+ import { Input as TestUtilInput } from '../../../src/testutil' ;
1616import { AcidTest , InputScriptType , SignStage } from '../../../src/testutil/psbt' ;
1717import { getNetworkList , getNetworkName , isMainnet , networks } from '../../../src' ;
1818import {
@@ -186,48 +186,11 @@ function runPsbt(acidTest: AcidTest) {
186186 } ) ;
187187}
188188
189- function runTx ( acidTest : AcidTest ) {
190- const coin = getNetworkName ( acidTest . network ) ;
191- const signatureCount = signCount ( acidTest . signStage ) ;
192- describe ( `tx build, sign and verify for ${ coin } ${ acidTest . signStage } ` , function ( ) {
193- const inputs = acidTest . inputs . filter (
194- ( input ) : input is TxnInput < bigint > =>
195- input . scriptType !== 'taprootKeyPathSpend' && input . scriptType !== 'p2trMusig2'
196- ) ;
197- const outputs = acidTest . outputs . filter (
198- ( output ) =>
199- ( 'scriptType' in output && output . scriptType !== undefined ) ||
200- ( 'address' in output && output . address !== undefined )
201- ) ;
202- it ( `tx signature counts ${ coin } ${ acidTest . signStage } ` , function ( ) {
203- const txb = constructTxnBuilder ( inputs , outputs , acidTest . network , acidTest . rootWalletKeys , acidTest . signStage ) ;
204- const tx = acidTest . signStage === 'fullsigned' ? txb . build ( ) : txb . buildIncomplete ( ) ;
205-
206- const counts = getStrictSignatureCounts ( tx ) ;
207- const countsFromIns = getStrictSignatureCounts ( tx . ins ) ;
208-
209- assert . strictEqual ( counts . length , tx . ins . length ) ;
210- assert . strictEqual ( countsFromIns . length , tx . ins . length ) ;
211- tx . ins . forEach ( ( input , inputIndex ) => {
212- const expectedCount = inputs [ inputIndex ] . scriptType === 'p2shP2pk' && signatureCount > 0 ? 1 : signatureCount ;
213- assert . strictEqual (
214- getStrictSignatureCount ( input ) ,
215- expectedCount ,
216- `input ${ inputIndex } has ${ getStrictSignatureCount ( input ) } signatures, expected ${ expectedCount } `
217- ) ;
218- assert . strictEqual ( counts [ inputIndex ] , expectedCount ) ;
219- assert . strictEqual ( countsFromIns [ inputIndex ] , expectedCount ) ;
220- } ) ;
221- } ) ;
222- } ) ;
223- }
224-
225189signs . forEach ( ( sign ) => {
226190 getNetworkList ( )
227191 . filter ( ( v ) => isMainnet ( v ) && v !== networks . bitcoinsv )
228192 . forEach ( ( network ) => {
229193 runPsbt ( AcidTest . withDefaults ( network , sign , 'psbt' ) ) ;
230194 runPsbt ( AcidTest . withDefaults ( network , sign , 'psbt-lite' ) ) ;
231- runTx ( AcidTest . withDefaults ( network , sign , 'psbt' ) ) ;
232195 } ) ;
233196} ) ;
0 commit comments