Class LogTopic

java.lang.Object
com.norswap.nanoeth.receipts.LogTopic

@Wrapper
public final class LogTopic
extends Object
Represents a 256-bit (32 bytes) log topic.

The purpose of log topics is to be a marker for certain type of events (in fact they map with Solidity events, see https://ethereum.stackexchange.com/a/12951 for more info).

Additionally, they are automatically entered into the bloom filter that is included in each block header. If a client wants to process all logs with a certain topic, this will help him skip the blocks that do not contain the topic, and hence lower network congestion as he will not have to request the logs over the network. (This is not useful if you're validating the network, in which case you have to derive the logs to validate the header anyway.)

  • Field Details

    • bytes

      public final byte[] bytes
      The bytes making up the hash.
  • Constructor Details

    • LogTopic

      public LogTopic​(@Retained byte[] bytes)
    • LogTopic

      public LogTopic​(String hexString)
      Creates a log topic from a hex string (e.g. 0x123).

      If the post-0x part of the hex string is not 64 characters long, the hash will be padded with zeroes at the start so that it is 32 bytes long.

  • Method Details