Skip to content

Commit

Permalink
Merge pull request #30 from gevulotnetwork/fix/pin-ack-event-parsing
Browse files Browse the repository at this point in the history
remove creator from pin-ack event, since its not there
  • Loading branch information
trusch authored Dec 12, 2024
2 parents ceca502 + 56303c2 commit 8d94dcc
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,6 @@ impl GevulotEvent {
.ok_or(Error::MissingEventAttribute("worker-id"))?
.value_str()?
.to_string();
let creator = event
.attributes
.iter()
.find(|attr| attr.key_bytes() == b"creator")
.ok_or(Error::MissingEventAttribute("creator"))?
.value_str()?
.to_string();
let success = event
.attributes
.iter()
Expand All @@ -495,7 +488,6 @@ impl GevulotEvent {
block_height,
cid,
worker_id,
creator,
success,
id,
})))
Expand Down Expand Up @@ -529,7 +521,6 @@ pub struct PinAckEvent {
pub block_height: Height,
pub cid: String,
pub id: String,
pub creator: String,
pub worker_id: String,
pub success: bool,
}
Expand Down Expand Up @@ -780,8 +771,13 @@ mod tests {
},
EventAttribute {
index: true,
key: b"creator".to_vec(),
value: b"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh".to_vec(),
key: b"success".to_vec(),
value: b"true".to_vec(),
},
EventAttribute {
index: true,
key: b"id".to_vec(),
value: b"123".to_vec(),
},
],
);
Expand All @@ -793,10 +789,8 @@ mod tests {
assert_eq!(event.block_height, Height::from(1000u32));
assert_eq!(event.cid, "QmYwMXeEc3Z64vqcPXx8p8Y8Y5tE9Y5sYW42FZ1U87Y");
assert_eq!(event.worker_id, "worker1");
assert_eq!(
event.creator,
"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh"
);
assert_eq!(event.success, true);
assert_eq!(event.id, "123");
} else {
panic!("Unexpected event type");
}
Expand Down

0 comments on commit 8d94dcc

Please sign in to comment.