Пример #1
0
        public async Task ShouldMatchCode()
        {
            var web3 = new Web3(publicNode);
            var contractRegistryService = new ByteCodeMatcher(web3, new WorkContractDefinition());

            Assert.True(await contractRegistryService.IsMatchAsync(workContractAddress));
        }
Пример #2
0
        public static BlockchainRegistryProcessor InitialiseBlockchainRegistryProcessor(TextWriter log,
                                                                                        ICollector <RegistrationMessage> workRegisteredUnregisteredQueue, Web3 web3, AzureTable workRegistryTable)
        {
            var service = new RegistryService(web3, ConfigurationSettings.GetWorkRegistryContractAddress());

            var workByteCodeMatcher = new ByteCodeMatcher(web3, new WorkContractDefinition());
            var logger             = new TextWriterLogger(log);
            var storageService     = new WorkRegistryRepository(workRegistryTable);
            var registryQueue      = new QueueRegistryProcessorService(new QueueRegistry(workRegisteredUnregisteredQueue));
            var processingServices = new IRegistryProcessingService[] { storageService, registryQueue };

            var blockchainRegistryProcessor = new BlockchainRegistryProcessor(web3, service, logger, processingServices,
                                                                              workByteCodeMatcher);

            return(blockchainRegistryProcessor);
        }