Example #1
0
        public void GenesisBlock()
        {
            var owner = KeyPair.Generate();
            var nexus = new Nexus();

            Assert.IsTrue(nexus.CreateGenesisBlock("simnet", owner, DateTime.Now));

            Assert.IsTrue(nexus.GenesisHash != Hash.Null);

            var rootChain = nexus.RootChain;

            var symbol = Nexus.FuelTokenSymbol;

            Assert.IsTrue(nexus.TokenExists(symbol));
            var token = nexus.GetTokenInfo(symbol);

            Assert.IsTrue(token.MaxSupply > 0);

            var supply = nexus.GetTokenSupply(rootChain.Storage, symbol);

            Assert.IsTrue(supply > 0);

            Assert.IsTrue(rootChain != null);
            Assert.IsTrue(rootChain.BlockHeight > 0);

            var children = nexus.GetChildChainsByName(rootChain.Name);

            Assert.IsTrue(children.Any());

            Assert.IsTrue(nexus.IsValidator(owner.Address));

            var randomKey = KeyPair.Generate();

            Assert.IsFalse(nexus.IsValidator(randomKey.Address));

            /*var txCount = nexus.GetTotalTransactionCount();
             * Assert.IsTrue(txCount > 0);*/
        }