public async Task Should_4_BeAbleToRegisterManyAddresses()
        {
            var address1 = "0xb794f5ea0ba39494ce839613fffba74279579268";
            var address2 = "0xe853c56864a2ebe4576a807d26fdc4a0ada51919";
            var address3 = "0xab7c74abc0c4d48d1bdad5dcb26153fc8780f83e";
            var address4 = "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae";

            var web3 = deployedContractFixture.GetWeb3();
            var contractRegistryService = GetRegistryService(web3);
            var registeredEvent         = contractRegistryService.GetRegisteredEvent();
            var filter = await registeredEvent.CreateFilterAsync();

            var receipts = await txHelper.SendAndMineTransactionsAsync(web3,
                                                                       DefaultSettings.AddressFrom,
                                                                       DefaultSettings.Password,
                                                                       () => contractRegistryService.RegisterAsync(DefaultSettings.AddressFrom,
                                                                                                                   address1,
                                                                                                                   defaultGas),
                                                                       () => contractRegistryService.RegisterAsync(DefaultSettings.AddressFrom,
                                                                                                                   address2,
                                                                                                                   defaultGas),
                                                                       () => contractRegistryService.RegisterAsync(DefaultSettings.AddressFrom,
                                                                                                                   address3,
                                                                                                                   defaultGas),
                                                                       () => contractRegistryService.RegisterAsync(DefaultSettings.AddressFrom,
                                                                                                                   address4,
                                                                                                                   defaultGas));

            var eventLogs = await registeredEvent.GetFilterChanges <RegisteredEvent>(filter);

            Assert.Equal(4, eventLogs.Count);
        }
Beispiel #2
0
        public async Task Should_GetWorkObjectModel()
        {
            var web3        = _deployedContractFixture.GetWeb3();
            var workService = GetWorkService(web3);

            await _txHelper.SendAndMineTransactionsAsync(web3, DefaultSettings.AddressFrom, DefaultSettings.Password,
                                                         () => workService.SetAttributeAsync(DefaultSettings.AddressFrom, WorkSchema.name, "Hello", true, _defaultGas),
                                                         () => workService.SetAttributeAsync(DefaultSettings.AddressFrom, WorkSchema.audio, "WORKHASH", true, _defaultGas)
                                                         );

            var work = await workService.GetWorkAsync();

            Assert.Equal("Hello", work.Name);
            Assert.Equal("WORKHASH", work.WorkFileIpfsHash);
            Assert.Equal(string.Empty, work.CoverImageIpfsHash);
        }