File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ export function parseUntilBlockQuery(
41
41
) : undefined | number | string {
42
42
if ( ! untilBlock ) return ;
43
43
if ( typeof untilBlock === 'string' ) {
44
- if ( unanchored !== undefined ) {
44
+ if ( unanchored ) {
45
45
// if mutually exclusive unachored is also specified, throw bad request error
46
46
throw new InvalidRequestError (
47
- `can't handle both 'unanchored' and 'until_block' in the same request` ,
47
+ `can't handle both 'unanchored=true ' and 'until_block' in the same request` ,
48
48
InvalidRequestErrorType . bad_request
49
49
) ;
50
50
}
Original file line number Diff line number Diff line change @@ -1570,6 +1570,12 @@ describe('address tests', () => {
1570
1570
} ;
1571
1571
expect ( JSON . parse ( fetchAddrBalance1 . text ) ) . toEqual ( expectedResp1 ) ;
1572
1572
1573
+ const fetchAddrBalance1AtBlock = await supertest ( api . server ) . get (
1574
+ `/extended/v1/address/${ testAddr2 } /balances?until_block=1`
1575
+ ) ;
1576
+ expect ( fetchAddrBalance1AtBlock . status ) . toBe ( 200 ) ;
1577
+ expect ( fetchAddrBalance1AtBlock . type ) . toBe ( 'application/json' ) ;
1578
+
1573
1579
const fetchAddrBalance2 = await supertest ( api . server ) . get (
1574
1580
`/extended/v1/address/${ testContractAddr } /balances`
1575
1581
) ;
@@ -2608,16 +2614,6 @@ describe('address tests', () => {
2608
2614
) ;
2609
2615
expect ( response . status ) . toBe ( 400 ) ;
2610
2616
}
2611
-
2612
- const addressEndpoints1 = [ '/transactions' , '/transactions_with_transfers' , '/stx_inbound' ] ;
2613
-
2614
- /// check for mutually exclusive until_block adn height params
2615
- for ( const path of addressEndpoints1 ) {
2616
- const response1 = await supertest ( api . server ) . get (
2617
- `/extended/v1/address/STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6${ path } ?until_block=5&height=0`
2618
- ) ;
2619
- expect ( response1 . status ) . toBe ( 400 ) ;
2620
- }
2621
2617
} ) ;
2622
2618
2623
2619
test ( '/transactions materialized view separates anchored and unanchored counts correctly' , async ( ) => {
You can’t perform that action at this time.
0 commit comments