diff --git a/lib/ain-evm/src/log.rs b/lib/ain-evm/src/log.rs index 9b5fe4d074..d890369b32 100644 --- a/lib/ain-evm/src/log.rs +++ b/lib/ain-evm/src/log.rs @@ -13,32 +13,30 @@ use crate::{ /// Log represents a contract log event. These events are generated by the LOG opcode /// and stored/indexed by the node. +/// Consensus fields: address, topics, data. +/// Derived fields (filled in by node, not secured by consensus): block number, block hash, +/// tx index, tx hash, log index, removed flag. #[derive(Serialize, Deserialize, Clone, Debug)] pub struct LogIndex { - // Consensus fields: - // Address of the contract that generated the event - pub address: H160, + // Hash of the block in which the transaction was included + pub block_hash: H256, + // Block in which the transaction was included + pub block_number: U256, // List of topics provided by the contract pub topics: Vec, // Supplied by the contract, usually ABI-encoded pub data: Vec, - - // Derived fields. These fields are filled in by the node - // but not secured by consensus. - // Block in which the transaction was included - pub block_number: U256, - // Hash of the transaction - pub transaction_hash: H256, - // Index of the transaction in the block - pub transaction_index: U256, - // Hash of the block in which the transaction was included - pub block_hash: H256, // Index of the log in the block pub log_index: U256, - + // Address of the contract that generated the event + pub address: H160, // The removed field is true if this log was reverted due to a chain reorganization. // You must pay attention to this field if you receive logs through a filter query. pub removed: bool, + // Hash of the transaction + pub transaction_hash: H256, + // Index of the transaction in the block + pub transaction_index: U256, } pub enum Notification {