コード例 #1
0
        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);
        }
コード例 #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);
            }
        }
コード例 #3
0
        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
            });
        }