Exemple #1
0
        protected override void ConfirmedPrimeElected(BlockElectionDistillate blockElectionDistillate, FinalElectionResultDistillate finalElectionResultDistillate)
        {
            base.ConfirmedPrimeElected(blockElectionDistillate, finalElectionResultDistillate);

            NeuraliumBlockElectionDistillate neuraliumBlockElectionDistillate = (NeuraliumBlockElectionDistillate)blockElectionDistillate;

            NeuraliumFinalElectionResultDistillate neuraliumFinalElectionContext = (NeuraliumFinalElectionResultDistillate)finalElectionResultDistillate;

            this.centralCoordinator.PostSystemEvent(NeuraliumSystemEventGenerator.NeuraliumMiningPrimeElected(blockElectionDistillate.currentBlockId, neuraliumFinalElectionContext.BountyShare, neuraliumFinalElectionContext.TransactionTips, AccountId.FromString(neuraliumFinalElectionContext.DelegateAccountId)));

            Log.Information($"We were officially announced as a prime elected in Block {blockElectionDistillate.currentBlockId} for the election that was announced in block {blockElectionDistillate.currentBlockId - neuraliumFinalElectionContext.BlockOffset}");
        }
Exemple #2
0
        public override BlockElectionDistillate PrepareBlockElectionContext(IBlock currentBlock, AccountId miningAccountId)
        {
            NeuraliumBlockElectionDistillate blockElectionDistillate = (NeuraliumBlockElectionDistillate)base.PrepareBlockElectionContext(currentBlock, miningAccountId);

            if (currentBlock is INeuraliumBlock neuraliumBlock)
            {
                if (neuraliumBlock is INeuraliumElectionBlock neuraliumElectionBlock)
                {
                    if (neuraliumElectionBlock.ElectionContext is INeuraliumElectionContext neuraliumElectionContext)
                    {
                    }
                }
            }

            return(blockElectionDistillate);
        }