@@ -6341,6 +6341,46 @@ next
6341
6341
) ;
6342
6342
}
6343
6343
6344
+ #[ test]
6345
+ fn output_recursive_endpoint ( ) {
6346
+ let server = TestServer :: builder ( ) . chain ( Chain :: Regtest ) . build ( ) ;
6347
+
6348
+ server. mine_blocks ( 1 ) ;
6349
+
6350
+ let inscription = Inscription {
6351
+ content_type : Some ( "text/plain" . into ( ) ) ,
6352
+ body : Some ( "foo" . into ( ) ) ,
6353
+ ..default ( )
6354
+ } ;
6355
+
6356
+ let txid = server. core . broadcast_tx ( TransactionTemplate {
6357
+ inputs : & [ ( 1 , 0 , 0 , inscription. to_witness ( ) ) ] ,
6358
+ ..default ( )
6359
+ } ) ;
6360
+
6361
+ server. mine_blocks ( 1 ) ;
6362
+
6363
+ let inscription_id = InscriptionId { txid, index : 0 } ;
6364
+ let outpoint: OutPoint = OutPoint { txid, vout : 0 } ;
6365
+
6366
+ let output_response = server. get_json :: < api:: Output > (
6367
+ format ! ( "/r/output/{}" , outpoint)
6368
+ ) ;
6369
+
6370
+ assert_eq ! ( output_response. outpoint, outpoint) ;
6371
+ assert ! ( !output_response. spent) ;
6372
+ assert ! ( output_response. indexed) ;
6373
+ assert_eq ! ( output_response. inscriptions, vec![ inscription_id] ) ;
6374
+ assert ! ( output_response. address. is_some( ) ) ;
6375
+ assert ! ( !output_response. script_pubkey. is_empty( ) ) ;
6376
+ assert_eq ! ( output_response. transaction, txid) ;
6377
+ assert ! ( output_response. value > 0 ) ;
6378
+ assert ! ( output_response. runes. is_empty( ) ) ;
6379
+ if let Some ( sat_ranges) = & output_response. sat_ranges {
6380
+ assert ! ( !sat_ranges. is_empty( ) ) ;
6381
+ }
6382
+ }
6383
+
6344
6384
#[ test]
6345
6385
fn sat_recursive_endpoints ( ) {
6346
6386
let server = TestServer :: builder ( )
0 commit comments