neo3/neo_protocol/responses/
notification.rs1use std::hash::{Hash, Hasher};
2
3use primitive_types::H160;
4use serde::{Deserialize, Serialize};
5
6use neo3::prelude::{deserialize_script_hash, serialize_script_hash, ScriptHash, StackItem};
7
8#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Hash, Clone)]
9pub struct LogNotification {
10 #[serde(deserialize_with = "deserialize_script_hash")]
11 #[serde(serialize_with = "serialize_script_hash")]
12 pub contract: ScriptHash,
13 #[serde(rename = "eventname")]
14 pub event_name: String,
15 pub state: StackItem,
16}
17
18impl LogNotification {
19 pub fn new(contract: H160, event_name: String, state: StackItem) -> Self {
20 Self { contract, event_name, state }
21 }
22}