Example #1
0
        public async Task T4_GetFileFunction()
        {
            _contract = _web3.Eth.GetContract(IpfsFileStorageService.Abi, ContractAddress);
            _service  = new UsersAndFilesService(_web3, ContractAddress);

            var fileContent = await _service.GetFilePart1AsyncCall(
                Stub.AdminLogin, Stub.AdminPassword, new BigInteger(1));

            Assert.Equal("jpeg", fileContent.MimeType);
        }
Example #2
0
        public async Task <IEthereumFile> GetAsyncCall(string ownerLogin, string ownerPassword, BigInteger id)
        {
            var login    = CastHelper.StringToBytes32(ownerLogin);
            var password = CastHelper.StringToBytes32(ownerPassword);

            var part1 = await _contractService.GetFilePart1AsyncCall(login, password, id);

            var part2 = await _contractService.GetFilePart2AsyncCall(login, password, id);

            return(new ReadableIpfsFileDto(id, part1, part2));
        }