Skip to content

Commit a8ce9d5

Browse files
authored
fix: use i64 for correlation ID (#89)
1 parent 450006a commit a8ce9d5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

relay_rpc/src/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ impl ServiceRequest for BatchReceiveMessages {
529529
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
530530
#[serde(rename_all = "camelCase")]
531531
pub struct AnalyticsData {
532-
pub correlation_id: Option<Arc<str>>,
532+
pub correlation_id: Option<i64>,
533533
pub chain_id: Option<Arc<str>>,
534534
pub rpc_methods: Option<Vec<Arc<str>>>,
535535
pub tx_hashes: Option<Vec<Arc<str>>>,

relay_rpc/src/rpc/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn request() {
1212
tag: 0,
1313
prompt: false,
1414
analytics: Some(AnalyticsData {
15-
correlation_id: Some("correlation_id".into()),
15+
correlation_id: Some(123456789),
1616
chain_id: Some("chain_id".into()),
1717
rpc_methods: Some(vec!["rpc_method".into()]),
1818
tx_hashes: Some(vec!["tx_hash".into()]),
@@ -25,7 +25,7 @@ fn request() {
2525

2626
assert_eq!(
2727
&serialized,
28-
r#"{"id":1,"jsonrpc":"2.0","method":"irn_publish","params":{"topic":"topic","message":"payload","attestation":"attestation_payload","ttl":12,"tag":0,"correlationId":"correlation_id","chainId":"chain_id","rpcMethods":["rpc_method"],"txHashes":["tx_hash"],"contractAddresses":["contract_address"]}}"#
28+
r#"{"id":1,"jsonrpc":"2.0","method":"irn_publish","params":{"topic":"topic","message":"payload","attestation":"attestation_payload","ttl":12,"tag":0,"correlationId":123456789,"chainId":"chain_id","rpcMethods":["rpc_method"],"txHashes":["tx_hash"],"contractAddresses":["contract_address"]}}"#
2929
);
3030

3131
let deserialized: Payload = serde_json::from_str(&serialized).unwrap();

0 commit comments

Comments
 (0)