Search in sources :

Example 1 with BlockInfo

use of org.adridadou.ethereum.propeller.event.BlockInfo in project eth-propeller-ethj by adridadou.

the class EthJEventListener method onBlock.

@Override
public void onBlock(Block block, List<TransactionReceipt> receipts) {
    EthHash blockHash = EthHash.of(block.getHash());
    eventHandler.onBlock(new BlockInfo(block.getNumber(), receipts.stream().map(receipt -> EthJEventListener.toReceipt(receipt, blockHash)).collect(Collectors.toList())));
    receipts.forEach(receipt -> eventHandler.onTransactionExecuted(new TransactionInfo(EthHash.of(receipt.getTransaction().getHash()), toReceipt(receipt, blockHash), TransactionStatus.Executed, EthHash.empty())));
}
Also used : LogInfo(org.ethereum.vm.LogInfo) EthValueDecoder(org.adridadou.ethereum.propeller.solidity.converters.decoders.EthValueDecoder) DataWord(org.ethereum.vm.DataWord) EthereumEventHandler(org.adridadou.ethereum.propeller.event.EthereumEventHandler) TransactionReceipt(org.ethereum.core.TransactionReceipt) EthereumListenerAdapter(org.ethereum.listener.EthereumListenerAdapter) Collectors(java.util.stream.Collectors) Block(org.ethereum.core.Block) BlockInfo(org.adridadou.ethereum.propeller.event.BlockInfo) List(java.util.List) BigInteger(java.math.BigInteger) org.adridadou.ethereum.propeller.values(org.adridadou.ethereum.propeller.values) Transaction(org.ethereum.core.Transaction) BlockInfo(org.adridadou.ethereum.propeller.event.BlockInfo)

Aggregations

BigInteger (java.math.BigInteger)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 BlockInfo (org.adridadou.ethereum.propeller.event.BlockInfo)1 EthereumEventHandler (org.adridadou.ethereum.propeller.event.EthereumEventHandler)1 EthValueDecoder (org.adridadou.ethereum.propeller.solidity.converters.decoders.EthValueDecoder)1 org.adridadou.ethereum.propeller.values (org.adridadou.ethereum.propeller.values)1 Block (org.ethereum.core.Block)1 Transaction (org.ethereum.core.Transaction)1 TransactionReceipt (org.ethereum.core.TransactionReceipt)1 EthereumListenerAdapter (org.ethereum.listener.EthereumListenerAdapter)1 DataWord (org.ethereum.vm.DataWord)1 LogInfo (org.ethereum.vm.LogInfo)1