Skip to content

Commit 501833f

Browse files
authored
Merge pull request #352 from AdExNetwork/issue-335-update-targeting-event
Issue 335 update targeting event
2 parents 63ac206 + fa2256c commit 501833f

File tree

7 files changed

+553
-42
lines changed

7 files changed

+553
-42
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ target
55
.idea
66
.old
77
Migrant.toml
8-
node_modules/
8+
node_modules/

Cargo.lock

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

primitives/src/sentry.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::targeting::Rules;
12
use crate::validator::MessageTypes;
23
use crate::{BigNum, Channel, ChannelId, ValidatorId};
34
use chrono::{DateTime, Utc};
@@ -52,19 +53,8 @@ pub enum Event {
5253
ad_slot: Option<String>,
5354
referrer: Option<String>,
5455
},
55-
ImpressionWithCommission {
56-
earners: Vec<Earner>,
57-
},
58-
/// only the creator can send this event
59-
UpdateImpressionPrice {
60-
price: BigNum,
61-
},
62-
/// only the creator can send this event
63-
Pay {
64-
outputs: HashMap<String, BigNum>,
65-
},
6656
/// only the creator can send this event
67-
PauseChannel,
57+
UpdateTargeting { targeting_rules: Rules },
6858
/// only the creator can send this event
6959
Close,
7060
}
@@ -84,10 +74,7 @@ impl fmt::Display for Event {
8474
match *self {
8575
Event::Impression { .. } => write!(f, "IMPRESSION"),
8676
Event::Click { .. } => write!(f, "CLICK"),
87-
Event::ImpressionWithCommission { .. } => write!(f, "IMPRESSION_WITH_COMMMISION"),
88-
Event::UpdateImpressionPrice { .. } => write!(f, "UPDATE_IMPRESSION_PRICE"),
89-
Event::Pay { .. } => write!(f, "PAY"),
90-
Event::PauseChannel => write!(f, "PAUSE_CHANNEL"),
77+
Event::UpdateTargeting { .. } => write!(f, "UPDATE_TARGETING"),
9178
Event::Close => write!(f, "CLOSE"),
9279
}
9380
}

sentry/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ serde_json = "^1.0"
3535
serde_urlencoded = "0.6.1"
3636
# Other
3737
lazy_static = "1.4.0"
38+
thiserror = "^1.0"

0 commit comments

Comments
 (0)