@@ -25,13 +25,7 @@ export class TransactionFilter {
2525 case "address" : {
2626 return handleOrCriteria ( criteria . address , async ( c ) =>
2727 // @ts -ignore
28- this . handleAddressCriteria ( c , walletRepository ) ,
29- ) ;
30- }
31- case "senderId" : {
32- return handleOrCriteria ( criteria . senderId , async ( c ) =>
33- // @ts -ignore
34- this . handleSenderIdCriteria ( c , walletRepository ) ,
28+ this . handleAddressCriteria ( c ) ,
3529 ) ;
3630 }
3731 case "to" : {
@@ -118,30 +112,13 @@ export class TransactionFilter {
118112 walletRepository : WalletRepository ,
119113 ) : Promise < Expression < Transaction > > {
120114 const expressions : Expression < Transaction > [ ] = await Promise . all ( [
121- this . handleSenderIdCriteria ( criteria , walletRepository ) ,
115+ this . handleSenderAddressCritera ( criteria ) ,
122116 this . handleRecipientAddressCriteria ( criteria ) ,
123117 ] ) ;
124118
125119 return { expressions, op : "or" } ;
126120 }
127121
128- private static async handleSenderIdCriteria (
129- criteria : EqualCriteria < string > ,
130- walletRepository : WalletRepository ,
131- ) : Promise < Expression < Transaction > > {
132- const wallet = await walletRepository
133- . createQueryBuilder ( )
134- . select ( "public_key" )
135- . where ( "address = :address" , { address : criteria } )
136- . getRawOne < { public_key : string } > ( ) ;
137-
138- if ( ! wallet || ! wallet . public_key ) {
139- return { op : "false" } ;
140- }
141-
142- return this . handleSenderPublicKeyCriteria ( wallet . public_key ) ;
143- }
144-
145122 private static async handleSenderPublicKeyCriteria (
146123 criteria : EqualCriteria < string > ,
147124 ) : Promise < Expression < Transaction > > {
0 commit comments