Exemplo n.º 1
0
        //[TestMethod]
        public void AddressTimestampedUnknown()
        {
            //var blockchainService = ServiceProvider.GetRequiredService<IBlockchainService>();
            var config = ServiceProvider.GetRequiredService <IConfiguration>();
            var derivationStrategyFactory = ServiceProvider.GetRequiredService <IDerivationStrategyFactory>();
            var repo = new QBitNinjaRepository(config);
            var blockchainService = new BitcoinService(repo, derivationStrategyFactory);

            var key        = new Key(blockchainService.DerivationStrategy.HashOf(Guid.NewGuid().ToByteArray())); // A random key
            var fundingKey = blockchainService.DerivationStrategy.KeyFromString(key.ToString(Network.TestNet));

            var address = key.PubKey.GetAddress(Network.TestNet);

            Console.WriteLine(address.ToString());

            var result = blockchainService.GetTimestamp(fundingKey);

            Assert.IsTrue(result.Confirmations == -1, "Should have been -1 (no unconfired and no confirmations): " + address);
        }