public Task HandleAsync(Block block, TransactionResult transactionResult, LogEvent logEvent)
        {
            var eventData = new ContractDeployed();

            eventData.MergeFrom(logEvent);

            _deployedContractAddressProvider.AddDeployedContractAddress(eventData.Address);
            Logger.LogTrace($"Added deployed contract address of {eventData}");

            return(Task.CompletedTask);
        }
Ejemplo n.º 2
0
        public async Task HandleEventAsync(BestChainFoundEventData eventData)
        {
            var chain = await _blockchainService.GetChainAsync();

            var addresses = await _contractDeployDiscoveryService.GetDeployedContractAddresses(chain,
                                                                                               eventData.ExecutedBlocks);

            foreach (var address in addresses)
            {
                _deployedContractAddressProvider.AddDeployedContractAddress(address);
            }
        }
        public async Task HandleAsync(Block block, TransactionResult transactionResult, LogEvent logEvent)
        {
            var eventData = new ContractDeployed();

            eventData.MergeFrom(logEvent);

            _deployedContractAddressProvider.AddDeployedContractAddress(eventData.Address,
                                                                        new BlockIndex {
                BlockHash = block.GetHash(), BlockHeight = block.Height
            });
            Logger.LogDebug($"Added deployed contract address of {eventData}");
            await _smartContractRegistrationService.AddSmartContractRegistrationAsync(eventData.Address, eventData.CodeHash,
                                                                                      new BlockIndex
            {
                BlockHash   = block.GetHash(),
                BlockHeight = block.Height
            });
        }