コード例 #1
0
        public override async Task Revert()
        {
            var currBlock = await Cache.Blocks.CurrentAsync();

            await BakerCycleCommit.Revert(this);

            await DelegatorCycleCommit.Revert(this);

            await CycleCommit.Revert(this);

            await BakingRightsCommit.Revert(this);

            await VotingCommit.Revert(this, currBlock);

            await BootstrapCommit.Revert(this, currBlock);

            await BlockCommit.Revert(this, currBlock);

            await StateCommit.Revert(this, currBlock);
        }
コード例 #2
0
        public override async Task Commit(IBlock block)
        {
            var rawBlock = block as RawBlock;

            var blockCommit = await BlockCommit.Apply(this, rawBlock);

            var bootstrapCommit = await BootstrapCommit.Apply(this, blockCommit.Block, rawBlock);

            await VotingCommit.Apply(this, rawBlock);

            var brCommit = await BakingRightsCommit.Apply(this, blockCommit.Block, bootstrapCommit.BootstrapedAccounts);

            await CycleCommit.Apply(this, blockCommit.Block, bootstrapCommit.BootstrapedAccounts);

            await DelegatorCycleCommit.Apply(this, blockCommit.Block, bootstrapCommit.BootstrapedAccounts);

            await BakerCycleCommit.Apply(this,
                                         blockCommit.Block,
                                         bootstrapCommit.BootstrapedAccounts,
                                         brCommit.FutureBakingRights,
                                         brCommit.FutureEndorsingRights);

            await StateCommit.Apply(this, blockCommit.Block, rawBlock);
        }