Skip to content

Commit 902af92

Browse files
committed
primitives - AdUnit - change owner to ValidatorId
1 parent 103c2c0 commit 902af92

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

adview-manager/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,12 @@ fn get_unit_html(
296296
#[cfg(test)]
297297
mod test {
298298
use super::*;
299+
use adex_primitives::ValidatorId;
300+
use std::convert::TryFrom;
299301

300302
fn get_ad_unit(media_mime: &str) -> AdUnit {
303+
let owner = ValidatorId::try_from("0xce07CbB7e054514D590a0262C93070D838bFBA2e")
304+
.expect("Should be valid ValidatorId string");
301305
AdUnit {
302306
ipfs: "".to_string(),
303307
ad_type: "".to_string(),
@@ -307,7 +311,7 @@ mod test {
307311
targeting: vec![],
308312
min_targeting_score: None,
309313
tags: vec![],
310-
owner: "".to_string(),
314+
owner,
311315
created: Utc::now(),
312316
title: None,
313317
description: None,

primitives/src/ad_unit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use chrono::serde::{ts_milliseconds, ts_milliseconds_option};
22
use chrono::{DateTime, Utc};
33
use serde::{Deserialize, Serialize};
44

5-
use crate::TargetingTag;
5+
use crate::{TargetingTag, ValidatorId};
66

77
#[derive(Serialize, Deserialize, Debug, Clone)]
88
#[serde(rename_all = "camelCase")]
@@ -34,7 +34,7 @@ pub struct AdUnit {
3434
#[serde(default)]
3535
pub tags: Vec<TargetingTag>,
3636
/// user address from the session
37-
pub owner: String,
37+
pub owner: ValidatorId,
3838
/// number, UTC timestamp in milliseconds, used as nonce for escaping duplicated spec ipfs hashes
3939
#[serde(with = "ts_milliseconds")]
4040
pub created: DateTime<Utc>,

0 commit comments

Comments
 (0)