Skip to content

Commit 26ccdf6

Browse files
committed
fix roundtrip serializing for eventsub
it is broken for PubSub however
1 parent 855940a commit 26ccdf6

File tree

23 files changed

+106
-19
lines changed

23 files changed

+106
-19
lines changed

Cargo.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ all = ["tmi", "helix", "surf_client", "reqwest_client", "client", "pubsub", "eve
6363
tokio = { version = "1.2.0", features = ["rt-multi-thread", "macros"] }
6464
dotenv = "0.15.0"
6565
futures = "0.3.12"
66+
serde_cbor = "0.11.1"
67+
6668

6769
[build-dependencies]
6870
version_check = "0.9.2"

src/eventsub/channel/ban.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ fn parse_payload() {
8585
}
8686
"#;
8787

88-
dbg!(crate::eventsub::Payload::parse(payload).unwrap());
88+
let val = dbg!(crate::eventsub::Payload::parse(payload).unwrap());
89+
crate::tests::roundtrip(&val)
8990
}

src/eventsub/channel/channel_points_custom_reward/add.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,6 @@ fn parse_payload() {
124124
}
125125
"##;
126126

127-
dbg!(crate::eventsub::Payload::parse(payload).unwrap());
127+
let val = dbg!(crate::eventsub::Payload::parse(payload).unwrap());
128+
crate::tests::roundtrip(&val)
128129
}

src/eventsub/channel/channel_points_custom_reward/remove.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,6 @@ fn parse_payload() {
127127
}
128128
"##;
129129

130-
dbg!(crate::eventsub::Payload::parse(payload).unwrap());
130+
let val = dbg!(crate::eventsub::Payload::parse(payload).unwrap());
131+
crate::tests::roundtrip(&val)
131132
}

src/eventsub/channel/channel_points_custom_reward/update.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,6 @@ fn parse_payload() {
126126
}
127127
"##;
128128

129-
dbg!(crate::eventsub::Payload::parse(payload).unwrap());
129+
let val = dbg!(crate::eventsub::Payload::parse(payload).unwrap());
130+
crate::tests::roundtrip(&val)
130131
}

src/eventsub/channel/channel_points_custom_reward_redemption/add.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,6 @@ fn parse_payload() {
9090
}
9191
"##;
9292

93-
dbg!(crate::eventsub::Payload::parse(payload).unwrap());
93+
let val = dbg!(crate::eventsub::Payload::parse(payload).unwrap());
94+
crate::tests::roundtrip(&val)
9495
}

src/eventsub/channel/channel_points_custom_reward_redemption/update.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,6 @@ fn parse_payload() {
8989
}
9090
"##;
9191

92-
dbg!(crate::eventsub::Payload::parse(payload).unwrap());
92+
let val = dbg!(crate::eventsub::Payload::parse(payload).unwrap());
93+
crate::tests::roundtrip(&val)
9394
}

src/eventsub/channel/cheer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ fn parse_payload() {
7676
}
7777
"#;
7878

79-
dbg!(crate::eventsub::Payload::parse(payload).unwrap());
79+
let val = dbg!(crate::eventsub::Payload::parse(payload).unwrap());
80+
crate::tests::roundtrip(&val)
8081
}

src/eventsub/channel/follow.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ fn parse_payload() {
6767
}
6868
"#;
6969

70-
dbg!(crate::eventsub::Payload::parse(payload).unwrap());
70+
let val = dbg!(crate::eventsub::Payload::parse(payload).unwrap());
71+
crate::tests::roundtrip(&val)
7172
}

0 commit comments

Comments
 (0)