Skip to content

Commit

Permalink
Enable passing null value in topic list in subscriptions RPC (#2810)
Browse files Browse the repository at this point in the history
  • Loading branch information
sieniven authored Feb 1, 2024
1 parent cd73f84 commit 4e11ac3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions lib/ain-grpc/src/subscription/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,25 @@ impl MetachainPubSubServer for MetachainPubSubModule {
inputs,
) => Some(
inputs
.into_iter()
.map(|input| vec![input])
.iter()
.flatten()
.map(|input| vec![*input])
.collect(),
),
LogsSubscriptionParamsTopics::VecOfHashVecs(
inputs,
) => Some(inputs),
) => Some(
inputs
.iter()
.map(|hashes| {
hashes
.iter()
.flatten()
.copied()
.collect()
})
.collect(),
),
}
} else {
None
Expand Down
4 changes: 2 additions & 2 deletions lib/ain-grpc/src/subscription/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub struct LogsSubscriptionParams {
#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[serde(untagged)]
pub enum LogsSubscriptionParamsTopics {
VecOfHashes(Vec<H256>),
VecOfHashVecs(Vec<Vec<H256>>),
VecOfHashes(Vec<Option<H256>>),
VecOfHashVecs(Vec<Vec<Option<H256>>>),
}

/// Subscription kind.
Expand Down

0 comments on commit 4e11ac3

Please sign in to comment.