File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
aggregation_mode/batcher/src Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -94,18 +94,7 @@ impl Db {
9494 . fetch_all ( & self . pool )
9595 . await
9696 }
97- ( None , Some ( n) ) => {
98- sqlx:: query_as :: < _ , Receipt > (
99- "SELECT status,merkle_path,nonce,address FROM tasks
100- WHERE nonce = $1
101- LIMIT $2" ,
102- )
103- . bind ( n)
104- . bind ( limit)
105- . fetch_all ( & self . pool )
106- . await
107- }
108- ( None , None ) => {
97+ _ => {
10998 sqlx:: query_as :: < _ , Receipt > (
11099 "SELECT status,merkle_path,nonce,address FROM tasks
111100 LIMIT $1" ,
Original file line number Diff line number Diff line change @@ -186,6 +186,13 @@ impl BatcherServer {
186186
187187 let state = state. get_ref ( ) ;
188188
189+ if params. address . is_none ( ) && params. nonce . is_some ( ) {
190+ return HttpResponse :: BadRequest ( ) . json ( AppResponse :: new_unsucessfull (
191+ "Bad request: Cannot specify nonce without address" ,
192+ 400 ,
193+ ) ) ;
194+ }
195+
189196 // TODO: maybe also accept proof commitment in query param
190197 let db_result = state
191198 . db
You can’t perform that action at this time.
0 commit comments