@@ -7,6 +7,7 @@ fn request() {
7
7
Params :: Publish ( Publish {
8
8
topic : "topic" . into ( ) ,
9
9
message : "payload" . into ( ) ,
10
+ attestation : Some ( Arc :: from ( "attestation_payload" ) ) ,
10
11
ttl_secs : 12 ,
11
12
tag : 0 ,
12
13
prompt : false ,
@@ -17,7 +18,7 @@ fn request() {
17
18
18
19
assert_eq ! (
19
20
& 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}}"#
21
22
) ;
22
23
23
24
let deserialized: Payload = serde_json:: from_str ( & serialized) . unwrap ( ) ;
@@ -91,6 +92,7 @@ fn subscription() {
91
92
let data = SubscriptionData {
92
93
topic : "test_topic" . into ( ) ,
93
94
message : "test_message" . into ( ) ,
95
+ attestation : Some ( Arc :: from ( "test_attestation" ) ) ,
94
96
published_at : 123 ,
95
97
tag : 1000 ,
96
98
} ;
@@ -104,7 +106,7 @@ fn subscription() {
104
106
105
107
assert_eq ! (
106
108
& 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}}}"#
108
110
) ;
109
111
110
112
let deserialized: Payload = serde_json:: from_str ( & serialized) . unwrap ( ) ;
@@ -127,7 +129,6 @@ fn batch_receive() {
127
129
) ) ;
128
130
129
131
let serialized = serde_json:: to_string ( & payload) . unwrap ( ) ;
130
- eprintln ! ( "{serialized}" ) ;
131
132
132
133
assert_eq ! (
133
134
& serialized,
@@ -289,6 +290,7 @@ fn validation() {
289
290
params : Params :: Publish ( Publish {
290
291
topic : topic. clone ( ) ,
291
292
message : message. clone ( ) ,
293
+ attestation : None ,
292
294
ttl_secs : 0 ,
293
295
tag : 0 ,
294
296
prompt : false ,
@@ -303,6 +305,7 @@ fn validation() {
303
305
params : Params :: Publish ( Publish {
304
306
topic : topic. clone ( ) ,
305
307
message : message. clone ( ) ,
308
+ attestation : None ,
306
309
ttl_secs : 0 ,
307
310
tag : 0 ,
308
311
prompt : false ,
@@ -317,6 +320,7 @@ fn validation() {
317
320
params : Params :: Publish ( Publish {
318
321
topic : topic. clone ( ) ,
319
322
message : message. clone ( ) ,
323
+ attestation : None ,
320
324
ttl_secs : 0 ,
321
325
tag : 0 ,
322
326
prompt : false ,
@@ -331,6 +335,7 @@ fn validation() {
331
335
params : Params :: Publish ( Publish {
332
336
topic : Topic :: from ( "invalid" ) ,
333
337
message : message. clone ( ) ,
338
+ attestation : None ,
334
339
ttl_secs : 0 ,
335
340
tag : 0 ,
336
341
prompt : false ,
@@ -407,6 +412,7 @@ fn validation() {
407
412
data : SubscriptionData {
408
413
topic : topic. clone ( ) ,
409
414
message : message. clone ( ) ,
415
+ attestation : None ,
410
416
published_at : 123 ,
411
417
tag : 1000 ,
412
418
} ,
@@ -423,6 +429,7 @@ fn validation() {
423
429
data : SubscriptionData {
424
430
topic : topic. clone ( ) ,
425
431
message : message. clone ( ) ,
432
+ attestation : None ,
426
433
published_at : 123 ,
427
434
tag : 1000 ,
428
435
} ,
@@ -439,6 +446,7 @@ fn validation() {
439
446
data : SubscriptionData {
440
447
topic : Topic :: from ( "invalid" ) ,
441
448
message,
449
+ attestation : None ,
442
450
published_at : 123 ,
443
451
tag : 1000 ,
444
452
} ,
0 commit comments