public void Setup()
        {
            ClientBuilder builder = new ClientBuilder(Chain.Mainnet);
            IN3           in3     = builder.ConstructClient(new string[][] { });

            _wallet = (SimpleWallet)in3.Signer;
        }
Exemple #2
0
        public async Task GetBlockHeader()
        {
            string[][] mockedResponses =
            {
                new[] { "getblockheader", "btc_GetBlockHeader_1.json" }
            };
            IN3 in3 = _builder.ConstructClient(mockedResponses);

            BlockHeader result = await in3.Btc.GetBlockHeader("0000000000000000000cd3c5d7638014e78a5fba33be5fa5cb10ef9f03d99e60");

            Assert.That(result.Hash, Is.EqualTo("0000000000000000000cd3c5d7638014e78a5fba33be5fa5cb10ef9f03d99e60"));
            Assert.That(result.Confirmations, Is.EqualTo(13));
            Assert.That(result.Height, Is.EqualTo(634026));
            Assert.That(result.Version, Is.EqualTo(1073676288));
            Assert.That(result.VersionHex, Is.EqualTo("3fff0000"));
            Assert.That(result.Merkleroot, Is.EqualTo("0b27b05fb5c9c53f595cf12696daa3ea4fb03ea67e0ffd909a1f2bb6544b63c1"));
            Assert.That(result.Time, Is.EqualTo(1591782412));
            Assert.That(result.Mediantime, Is.EqualTo(1591778995));
            Assert.That(result.Nonce, Is.EqualTo(783981944));
            Assert.That(result.Bits, Is.EqualTo("17147f35"));
            Assert.That(result.Difficulty, Is.EqualTo(13732352106018.34f));
            Assert.That(result.Chainwork, Is.EqualTo("00000000000000000000000000000000000000001038fd1e673c4ff045dbd6c1"));
            Assert.That(result.NTx, Is.EqualTo(1659));
            Assert.That(result.Previousblockhash, Is.EqualTo("00000000000000000013a6ca3921ce63af646ac191c733d9728103d7a9e3236e"));
            Assert.That(result.Nextblockhash, Is.EqualTo("0000000000000000000d1e4cf9f6f0a6fa88aa162e08a966bf3043f7f77e21bb"));
        }
Exemple #3
0
        public void Setup()
        {
            string[][] mockedResponses =
            {
                new[] { "ipfs_get", "ipfs_get.json" },
                new[] { "ipfs_put", "ipfs_put.json" }
            };

            ClientBuilder builder = new ClientBuilder(Chain.Ipfs);;

            _in3 = builder.ConstructClient(mockedResponses);
        }
Exemple #4
0
        public void Setup()
        {
            ClientBuilder _builder = new ClientBuilder(Chain.Mainnet);

            in3 = _builder.ConstructClient(new string[][] { });
        }
Exemple #5
0
        public async Task BlockNumber()
        {
            string[][] mockedResponses =
            {
                new[] { "eth_blockNumber", "eth_blockNumber.json" }
            };
            IN3 in3 = _builder.ConstructClient(mockedResponses);

            BigInteger result = await in3.Eth1.BlockNumber();

            Assert.That(result, Is.EqualTo(new BigInteger(3220)));
        }