Skip to content

Commit

Permalink
fix: use i64 for correlation ID (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
heilhead authored Feb 3, 2025
1 parent 450006a commit a8ce9d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion relay_rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ impl ServiceRequest for BatchReceiveMessages {
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AnalyticsData {
pub correlation_id: Option<Arc<str>>,
pub correlation_id: Option<i64>,
pub chain_id: Option<Arc<str>>,
pub rpc_methods: Option<Vec<Arc<str>>>,
pub tx_hashes: Option<Vec<Arc<str>>>,
Expand Down
4 changes: 2 additions & 2 deletions relay_rpc/src/rpc/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn request() {
tag: 0,
prompt: false,
analytics: Some(AnalyticsData {
correlation_id: Some("correlation_id".into()),
correlation_id: Some(123456789),
chain_id: Some("chain_id".into()),
rpc_methods: Some(vec!["rpc_method".into()]),
tx_hashes: Some(vec!["tx_hash".into()]),
Expand All @@ -25,7 +25,7 @@ fn request() {

assert_eq!(
&serialized,
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"]}}"#
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"]}}"#
);

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

0 comments on commit a8ce9d5

Please sign in to comment.