@@ -493,7 +493,7 @@ function defaultTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValues)
493493 const client = await Comet38Client . create ( rpcFactory ( ) ) ;
494494
495495 const result = await client . txSearch ( { query : `tx.hash='${ toHex ( broadcast1 . hash ) } '` } ) ;
496- expect ( result . totalCount ) . toEqual ( 1 ) ;
496+ expect ( result . txs . length ) . toEqual ( 1 ) ;
497497 expect ( result . txs [ 0 ] ) . toEqual ( {
498498 hash : broadcast1 . hash ,
499499 height : broadcast1 . height ,
@@ -502,6 +502,10 @@ function defaultTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValues)
502502 result : broadcast1 . deliverTx ! ,
503503 proof : undefined ,
504504 } ) ;
505+ if ( ! expected . bug5219 ) {
506+ // This is broken in CometBFT 1.x (see https://github.com/cometbft/cometbft/issues/5219)
507+ expect ( result . totalCount ) . toEqual ( 1 ) ;
508+ }
505509
506510 client . disconnect ( ) ;
507511 } ) ;
@@ -878,7 +882,7 @@ function websocketTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValue
878882 } ) ;
879883}
880884
881- describe ( "Comet38Client" , ( ) => {
885+ describe ( "Comet38Client with CometBFT 0.38 backend " , ( ) => {
882886 const { url, expected } = tendermintInstances [ 38 ] ;
883887
884888 it ( "can connect to a given url" , async ( ) => {
@@ -913,3 +917,39 @@ describe("Comet38Client", () => {
913917 websocketTestSuite ( factory , expected ) ;
914918 } ) ;
915919} ) ;
920+
921+ describe ( "Comet38Client with CometBFT 1 backend" , ( ) => {
922+ const { url, expected } = tendermintInstances [ 1 ] ;
923+
924+ it ( "can connect to a given url" , async ( ) => {
925+ pendingWithoutTendermint ( ) ;
926+
927+ // http connection
928+ {
929+ const client = await Comet38Client . connect ( "http://" + url ) ;
930+ const info = await client . abciInfo ( ) ;
931+ expect ( info ) . toBeTruthy ( ) ;
932+ client . disconnect ( ) ;
933+ }
934+
935+ // ws connection
936+ {
937+ const client = await Comet38Client . connect ( "ws://" + url ) ;
938+ const info = await client . abciInfo ( ) ;
939+ expect ( info ) . toBeTruthy ( ) ;
940+ client . disconnect ( ) ;
941+ }
942+ } ) ;
943+
944+ describe ( "With HttpClient" , ( ) => {
945+ defaultTestSuite ( ( ) => new HttpClient ( "http://" + url ) , expected ) ;
946+ } ) ;
947+
948+ describe ( "With WebsocketClient" , ( ) => {
949+ // don't print out WebSocket errors if marked pending
950+ const onError = process . env . TENDERMINT_ENABLED ? console . error : ( ) => 0 ;
951+ const factory = ( ) : WebsocketClient => new WebsocketClient ( "ws://" + url , onError ) ;
952+ defaultTestSuite ( factory , expected ) ;
953+ websocketTestSuite ( factory , expected ) ;
954+ } ) ;
955+ } ) ;
0 commit comments