@@ -18,14 +18,6 @@ export async function dropTransaction(
1818 sealAfter = false
1919) {
2020 const pendingBefore = await api . rpc . author . pendingExtrinsics ( ) ;
21- console . log (
22- "Pending extrinsics:" ,
23- pendingBefore . map ( ( ext ) => ( {
24- hash : ext . hash . toHex ( ) ,
25- method : `${ ext . method . section } .${ ext . method . method } ` ,
26- signer : ext . signer ?. toString ( )
27- } ) )
28- ) ;
2921
3022 if ( ! extrinsic ) {
3123 // Remove all extrinsics from the txPool
@@ -38,7 +30,6 @@ export async function dropTransaction(
3830 assert ( pendingAfter . length === 0 , "Not all extrinsics removed from txPool" ) ;
3931 } else if ( typeof extrinsic === "object" && "module" in extrinsic && "method" in extrinsic ) {
4032 // Remove extrinsics matching the specified module and method
41-
4233 const matches = pendingBefore
4334 . filter (
4435 ( { method } ) => method . section === extrinsic . module && method . method === extrinsic . method
@@ -49,30 +40,13 @@ export async function dropTransaction(
4940 matches . length > 0 ,
5041 `No extrinsics found in txPool matching ${ extrinsic . module } :${ extrinsic . method } `
5142 ) ;
52- console . log ( "Removing extrinsics:" , matches ) ;
5343 const result = await api . rpc . author . removeExtrinsic ( matches . map ( ( hash ) => ( { Hash : hash } ) ) ) ;
54- console . log (
55- "Removed extrinsics:" ,
56- result . map ( ( hash ) => hash . toHex ( ) )
57- ) ;
5844 const pendingAfter = await api . rpc . author . pendingExtrinsics ( ) ;
59- console . log (
60- "Pending extrinsics after removal:" ,
61- pendingAfter . map ( ( ext ) => ( {
62- hash : ext . hash . toHex ( ) ,
63- method : `${ ext . method . section } .${ ext . method . method } ` ,
64- signer : ext . signer ?. toString ( )
65- } ) )
66- ) ;
6745 assert ( result . length > 0 , "No removal confirmation returned by RPC" ) ;
6846 assert ( pendingBefore . length > pendingAfter . length , "Extrinsic not removed from txPool" ) ;
6947 } else {
7048 // Remove the extrinsic with the specified hash
7149 const result = await api . rpc . author . removeExtrinsic ( [ { Hash : extrinsic } ] ) ;
72- console . log (
73- "Removed extrinsic:" ,
74- result . map ( ( hash ) => hash . toHex ( ) )
75- ) ;
7650 const pendingAfter = await api . rpc . author . pendingExtrinsics ( ) ;
7751 assert ( result . length > 0 , "No removal confirmation returned by RPC" ) ;
7852 assert ( pendingBefore > pendingAfter , "Extrinsic not removed from txPool" ) ;
0 commit comments