Пример #1
0
 public void OnTestLifeTimeAction(ApexTest testClass, Type classType, TestLifeTimeAction action)
 {
     if (action == TestLifeTimeAction.PostTestCleanup)
     {
         _lastTest = testClass as TestBase;
     }
 }
 public void OnTestLifeTimeAction(ApexTest testClass, Type classType, TestLifeTimeAction action)
 {
     if (action == TestLifeTimeAction.PreTestInitialize)
     {
         Log.ResetLog($"{testClass.GetType().Name}.{testClass.TestContext.TestName}");
     }
 }
Пример #3
0
        public void correctly_identify_sidechain()
        {
            var apexRegTest = new ApexRegTest();
            var chain       = apexRegTest.ToChain();

            chain.Should().Be(Chain.Sidechain);
            chain.Should().NotBe(Chain.Mainchain);

            var apexTest = new ApexTest();

            chain = apexTest.ToChain();
            chain.Should().Be(Chain.Sidechain);
            chain.Should().NotBe(Chain.Mainchain);

            var apexMain = new ApexMain();

            chain = apexMain.ToChain();
            chain.Should().Be(Chain.Sidechain);
            chain.Should().NotBe(Chain.Mainchain);
        }
Пример #4
0
        public static async Task MainAsync(string[] args)
        {
            try
            {
                if (!args.Any(a => a.Contains("apiport")))
                {
                    // TEMP set the default port to 38225 if it isn't set.
                    args = args.Concat(new[] { "apiport=38225" }).ToArray();
                }

                var          network      = new ApexTest();
                NodeSettings nodeSettings = new NodeSettings(network, protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, args: args);

                string[] seedNodes = { "104.211.178.243", "51.144.35.218", "65.52.5.149", "51.140.231.125", "13.70.81.5" };
                network.SeedNodes.AddRange(ConvertToNetworkAddresses(seedNodes, network.DefaultPort).ToList());

                var node = new FullNodeBuilder()
                           .UseNodeSettings(nodeSettings)
                           .UseBlockStore()
                           .UsePowConsensus()
                           .UseMempool()
                           .UseWallet()
                           //.AddPowPosMining()
                           .UseApi()
                           .AddRPC()
                           .Build();

                if (node != null)
                {
                    await node.RunAsync();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message);
            }
        }