@@ -7,6 +7,7 @@ fn request() {
77 Params :: Publish ( Publish {
88 topic : "topic" . into ( ) ,
99 message : "payload" . into ( ) ,
10+ attestation : Some ( Arc :: from ( "attestation_payload" ) ) ,
1011 ttl_secs : 12 ,
1112 tag : 0 ,
1213 prompt : false ,
@@ -17,7 +18,7 @@ fn request() {
1718
1819 assert_eq ! (
1920 & serialized,
20- r#"{"id":1,"jsonrpc":"2.0","method":"irn_publish","params":{"topic":"topic","message":"payload","ttl":12,"tag":0}}"#
21+ r#"{"id":1,"jsonrpc":"2.0","method":"irn_publish","params":{"topic":"topic","message":"payload","attestation":"attestation_payload"," ttl":12,"tag":0}}"#
2122 ) ;
2223
2324 let deserialized: Payload = serde_json:: from_str ( & serialized) . unwrap ( ) ;
@@ -91,6 +92,7 @@ fn subscription() {
9192 let data = SubscriptionData {
9293 topic : "test_topic" . into ( ) ,
9394 message : "test_message" . into ( ) ,
95+ attestation : Some ( Arc :: from ( "test_attestation" ) ) ,
9496 published_at : 123 ,
9597 tag : 1000 ,
9698 } ;
@@ -104,7 +106,7 @@ fn subscription() {
104106
105107 assert_eq ! (
106108 & serialized,
107- r#"{"id":1,"jsonrpc":"2.0","method":"irn_subscription","params":{"id":"test_id","data":{"topic":"test_topic","message":"test_message","publishedAt":123,"tag":1000}}}"#
109+ r#"{"id":1,"jsonrpc":"2.0","method":"irn_subscription","params":{"id":"test_id","data":{"topic":"test_topic","message":"test_message","attestation":"test_attestation"," publishedAt":123,"tag":1000}}}"#
108110 ) ;
109111
110112 let deserialized: Payload = serde_json:: from_str ( & serialized) . unwrap ( ) ;
@@ -127,7 +129,6 @@ fn batch_receive() {
127129 ) ) ;
128130
129131 let serialized = serde_json:: to_string ( & payload) . unwrap ( ) ;
130- eprintln ! ( "{serialized}" ) ;
131132
132133 assert_eq ! (
133134 & serialized,
@@ -289,6 +290,7 @@ fn validation() {
289290 params : Params :: Publish ( Publish {
290291 topic : topic. clone ( ) ,
291292 message : message. clone ( ) ,
293+ attestation : None ,
292294 ttl_secs : 0 ,
293295 tag : 0 ,
294296 prompt : false ,
@@ -303,6 +305,7 @@ fn validation() {
303305 params : Params :: Publish ( Publish {
304306 topic : topic. clone ( ) ,
305307 message : message. clone ( ) ,
308+ attestation : None ,
306309 ttl_secs : 0 ,
307310 tag : 0 ,
308311 prompt : false ,
@@ -317,6 +320,7 @@ fn validation() {
317320 params : Params :: Publish ( Publish {
318321 topic : topic. clone ( ) ,
319322 message : message. clone ( ) ,
323+ attestation : None ,
320324 ttl_secs : 0 ,
321325 tag : 0 ,
322326 prompt : false ,
@@ -331,6 +335,7 @@ fn validation() {
331335 params : Params :: Publish ( Publish {
332336 topic : Topic :: from ( "invalid" ) ,
333337 message : message. clone ( ) ,
338+ attestation : None ,
334339 ttl_secs : 0 ,
335340 tag : 0 ,
336341 prompt : false ,
@@ -407,6 +412,7 @@ fn validation() {
407412 data : SubscriptionData {
408413 topic : topic. clone ( ) ,
409414 message : message. clone ( ) ,
415+ attestation : None ,
410416 published_at : 123 ,
411417 tag : 1000 ,
412418 } ,
@@ -423,6 +429,7 @@ fn validation() {
423429 data : SubscriptionData {
424430 topic : topic. clone ( ) ,
425431 message : message. clone ( ) ,
432+ attestation : None ,
426433 published_at : 123 ,
427434 tag : 1000 ,
428435 } ,
@@ -439,6 +446,7 @@ fn validation() {
439446 data : SubscriptionData {
440447 topic : Topic :: from ( "invalid" ) ,
441448 message,
449+ attestation : None ,
442450 published_at : 123 ,
443451 tag : 1000 ,
444452 } ,
0 commit comments