Пример #1
0
        public async void ShouldCreateContentIPFSHash()
        {
            var multihash         = Multihash.FromB58String("QmRZiL8WbAVQMF1715fhG3b4x9tfGS6hgBLPQ6KYfKzcYL");
            var cid               = new IPLD.ContentIdentifier.Cid(MulticodecCode.MerkleDAGProtobuf, multihash);
            var ipfsStoragePrefix = new byte[] { 0xe3, 0x01 };
            var fullContentHash   = ipfsStoragePrefix.Concat(cid.ToBytes()).ToArray();
            var web3              = new Web3.Web3("https://mainnet.infura.io/v3/7238211010344719ad14a89db874158c");
            var ensService        = new ENSService(web3);
            var content           = await ensService.GetContentHashAsync("3-7-0-0.web3.nethereum.dotnet.netdapps.eth");

            //e301017012202febb4a7c84c8079f78844e50150d97ad33e2a3a0d680d54e7211e30ef13f08d
            Assert.Equal(content.ToHex(), fullContentHash.ToHex());
        }
Пример #2
0
        public async void ShouldCreateContentIPFSHash()
        {
            var multihash         = Multihash.FromB58String("QmRZiL8WbAVQMF1715fhG3b4x9tfGS6hgBLPQ6KYfKzcYL");
            var cid               = new IPLD.ContentIdentifier.Cid(MulticodecCode.MerkleDAGProtobuf, multihash);
            var ipfsStoragePrefix = new byte[] { 0xe3, 0x01 };
            var fullContentHash   = ipfsStoragePrefix.Concat(cid.ToBytes()).ToArray();
            var web3              = _ethereumClientIntegrationFixture.GetInfuraWeb3(InfuraNetwork.Mainnet);
            var ensService        = web3.Eth.GetEnsService();
            var content           = await ensService.GetContentHashAsync("3-7-0-0.web3.nethereum.dotnet.netdapps.eth");

            //e301017012202febb4a7c84c8079f78844e50150d97ad33e2a3a0d680d54e7211e30ef13f08d
            Assert.Equal(content.ToHex(), fullContentHash.ToHex());
        }