|
@ -45,15 +45,14 @@ class State; |
|
|
class LogFilter |
|
|
class LogFilter |
|
|
{ |
|
|
{ |
|
|
public: |
|
|
public: |
|
|
LogFilter(unsigned _earliest = 0, unsigned _latest = PendingBlock): m_earliest(_earliest), m_latest(_latest) {} |
|
|
LogFilter(h256 _earliest = EarliestBlockHash, h256 _latest = PendingBlockHash): m_earliest(_earliest), m_latest(_latest) {} |
|
|
|
|
|
|
|
|
void streamRLP(RLPStream& _s) const; |
|
|
void streamRLP(RLPStream& _s) const; |
|
|
h256 sha3() const; |
|
|
h256 sha3() const; |
|
|
|
|
|
|
|
|
unsigned earliest() const { return m_earliest; } |
|
|
h256 earliest() const { return m_earliest; } |
|
|
unsigned latest() const { return m_latest; } |
|
|
h256 latest() const { return m_latest; } |
|
|
|
|
|
|
|
|
bool envelops(RelativeBlock _logBlockRelation, u256 _logBlockNumber) const; |
|
|
|
|
|
std::vector<LogBloom> bloomPossibilities() const; |
|
|
std::vector<LogBloom> bloomPossibilities() const; |
|
|
bool matches(LogBloom _bloom) const; |
|
|
bool matches(LogBloom _bloom) const; |
|
|
bool matches(State const& _s, unsigned _i) const; |
|
|
bool matches(State const& _s, unsigned _i) const; |
|
@ -61,16 +60,16 @@ public: |
|
|
|
|
|
|
|
|
LogFilter address(Address _a) { m_addresses.insert(_a); return *this; } |
|
|
LogFilter address(Address _a) { m_addresses.insert(_a); return *this; } |
|
|
LogFilter topic(unsigned _index, h256 const& _t) { if (_index < 4) m_topics[_index].insert(_t); return *this; } |
|
|
LogFilter topic(unsigned _index, h256 const& _t) { if (_index < 4) m_topics[_index].insert(_t); return *this; } |
|
|
LogFilter withEarliest(int _e) { m_earliest = _e; return *this; } |
|
|
LogFilter withEarliest(h256 _e) { m_earliest = _e; return *this; } |
|
|
LogFilter withLatest(int _e) { m_latest = _e; return *this; } |
|
|
LogFilter withLatest(h256 _e) { m_latest = _e; return *this; } |
|
|
|
|
|
|
|
|
friend std::ostream& dev::eth::operator<<(std::ostream& _out, dev::eth::LogFilter const& _s); |
|
|
friend std::ostream& dev::eth::operator<<(std::ostream& _out, dev::eth::LogFilter const& _s); |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
AddressHash m_addresses; |
|
|
AddressHash m_addresses; |
|
|
std::array<h256Hash, 4> m_topics; |
|
|
std::array<h256Hash, 4> m_topics; |
|
|
unsigned m_earliest = 0; |
|
|
h256 m_earliest = EarliestBlockHash; |
|
|
unsigned m_latest = LatestBlock; |
|
|
h256 m_latest = PendingBlockHash; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|