@@ -9,7 +9,7 @@ use ethportal_api::jsonrpsee::http_client::HttpClient;
99use ethportal_api:: types:: execution:: header_with_proof:: {
1010 BlockHeaderProof , HeaderWithProof , SszNone ,
1111} ;
12- use ethportal_api:: types:: portal:: { FindContentInfo , GetContentInfo } ;
12+ use ethportal_api:: types:: portal:: { FindContentInfo , GetContentInfo , PutContentInfo } ;
1313use ethportal_api:: types:: portal_wire:: MAX_PORTAL_CONTENT_PAYLOAD_SIZE ;
1414use ethportal_api:: utils:: bytes:: hex_encode;
1515use ethportal_api:: {
@@ -196,10 +196,10 @@ dyn_async! {
196196 // Test gossiping a collection of blocks to node B (B will gossip back to A)
197197 test. run(
198198 NClientTestSpec {
199- name: format!( "GOSSIP blocks from A:{} --> B:{}" , client_a. name, client_b. name) ,
199+ name: format!( "PUT CONTENT blocks from A:{} --> B:{}" , client_a. name, client_b. name) ,
200200 description: "" . to_string( ) ,
201201 always_run: false ,
202- run: test_gossip_two_nodes ,
202+ run: test_put_content_two_nodes ,
203203 environments: environments. clone( ) ,
204204 test_data: content. clone( ) ,
205205 clients: vec![ client_a. clone( ) , client_b. clone( ) ] ,
@@ -439,7 +439,7 @@ dyn_async! {
439439}
440440
441441dyn_async ! {
442- async fn test_gossip_two_nodes <' a> ( clients: Vec <Client >, test_data: Vec <TestData >) {
442+ async fn test_put_content_two_nodes <' a> ( clients: Vec <Client >, test_data: Vec <TestData >) {
443443 let ( client_a, client_b) = match clients. iter( ) . collect_tuple( ) {
444444 Some ( ( client_a, client_b) ) => ( client_a, client_b) ,
445445 None => panic!( "Unable to get expected amount of clients from NClientTestSpec" ) ,
@@ -461,10 +461,10 @@ dyn_async! {
461461 for TestData { header, key: content_key, offer_value: content_offer_value, .. } in test_data. clone( ) {
462462 store_header( header, & client_b. rpc) . await ;
463463
464- match client_a. rpc. gossip ( content_key. clone( ) , content_offer_value. encode( ) ) . await {
465- Ok ( nodes_gossiped_to ) => {
466- if nodes_gossiped_to != 1 {
467- panic!( "We expected to gossip to 1 node instead we gossiped to: {nodes_gossiped_to }" ) ;
464+ match client_a. rpc. put_content ( content_key. clone( ) , content_offer_value. encode( ) ) . await {
465+ Ok ( PutContentInfo { peer_count , .. } ) => {
466+ if peer_count != 1 {
467+ panic!( "We expected to gossip to 1 node instead we gossiped to: {peer_count }" ) ;
468468 }
469469 }
470470 Err ( err) => panic!( "Unable to get received content: {err:?}" ) ,
0 commit comments