feat: impl rlp encodable for log and receipt (#1153)
This commit is contained in:
parent
6ad3d292b4
commit
45cce0f4b4
|
@ -65,6 +65,15 @@ pub struct Log {
|
|||
pub removed: Option<bool>,
|
||||
}
|
||||
|
||||
impl rlp::Encodable for Log {
|
||||
fn rlp_append(&self, s: &mut rlp::RlpStream) {
|
||||
s.begin_list(3);
|
||||
s.append(&self.address);
|
||||
s.append_list(&self.topics);
|
||||
s.append(&self.data.0);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
pub enum FilterBlockOption {
|
||||
Range { from_block: Option<BlockNumber>, to_block: Option<BlockNumber> },
|
||||
|
|
|
@ -414,6 +414,16 @@ pub struct TransactionReceipt {
|
|||
pub effective_gas_price: Option<U256>,
|
||||
}
|
||||
|
||||
impl rlp::Encodable for TransactionReceipt {
|
||||
fn rlp_append(&self, s: &mut RlpStream) {
|
||||
s.begin_list(4);
|
||||
s.append(&self.status);
|
||||
s.append(&self.cumulative_gas_used);
|
||||
s.append(&self.logs_bloom);
|
||||
s.append_list(&self.logs);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(not(feature = "celo"))]
|
||||
mod tests {
|
||||
|
|
Loading…
Reference in New Issue