public void InIBDIfChainTipIsNull() { this.chainState.ConsensusTip = null; var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.consensusSettings, this.checkpoints, this.loggerFactory.Object, DateTimeProvider.Default); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void InIBDIfBehindCheckpoint() { this.chainState.ConsensusTip = new ChainedBlock(new BlockHeader(), uint256.Zero, 1000); var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.nodeSettings, this.checkpoints); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void InIBDIfChainWorkIsLessThanMinimum() { this.chainState.ConsensusTip = new ChainedBlock(new BlockHeader(), uint256.Zero, this.checkpoints.GetLastCheckpointHeight() + 1); var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.nodeSettings, this.checkpoints); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void InIBDIfChainTipIsNull() { this.chainState.ConsensusTip = null; var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.nodeSettings, this.checkpoints); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void InIBDIfChainWorkIsLessThanMinimum() { BlockHeader blockHeader = this.network.Consensus.ConsensusFactory.CreateBlockHeader(); this.chainState.ConsensusTip = new ChainedHeader(blockHeader, blockHeader.GetHash(), this.checkpoints.GetLastCheckpointHeight() + 1); var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.consensusSettings, this.checkpoints, this.loggerFactory.Object, DateTimeProvider.Default); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void InIBDIfBehindCheckpoint() { BlockHeader blockHeader = this.network.Consensus.ConsensusFactory.CreateBlockHeader(); this.chainState.ConsensusTip = new ChainedHeader(blockHeader, blockHeader.GetHash(), 1000); var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.consensusSettings, this.checkpoints, this.loggerFactory.Object, DateTimeProvider.Default); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void InIBDIfChainWorkIsLessThanMinimum() { BlockHeader blockHeader = this.network.Consensus.ConsensusFactory.CreateBlockHeader(); this.chainState.ConsensusTip = new ChainedHeader(blockHeader, uint256.Zero, this.checkpoints.GetLastCheckpointHeight() + 1); var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.consensusSettings, this.checkpoints); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void InIBDIfBehindCheckpoint() { BlockHeader blockHeader = this.network.Consensus.ConsensusFactory.CreateBlockHeader(); this.chainState.ConsensusTip = new ChainedHeader(blockHeader, uint256.Zero, 1000); var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.consensusSettings, this.checkpoints); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void InIBDIfTipIsOlderThanMaxAge() { BlockHeader blockHeader = this.network.Consensus.ConsensusFactory.CreateBlockHeader(); // Enough work to get us past the chain work check. blockHeader.Bits = new Target(new uint256(uint.MaxValue)); // Block has a time sufficiently in the past that it can't be the tip. blockHeader.Time = ((uint)DateTimeOffset.Now.ToUnixTimeSeconds()) - (uint)this.network.MaxTipAge - 1; this.chainState.ConsensusTip = new ChainedHeader(blockHeader, blockHeader.GetHash(), this.checkpoints.GetLastCheckpointHeight() + 1); var blockDownloadState = new InitialBlockDownloadState(this.chainState, this.network, this.consensusSettings, this.checkpoints, this.loggerFactory.Object, DateTimeProvider.Default); Assert.True(blockDownloadState.IsInitialBlockDownload()); }
public void NotInIBDIfChainStateIsNull() { var blockDownloadState = new InitialBlockDownloadState(null, this.network, this.nodeSettings, this.checkpoints); Assert.False(blockDownloadState.IsInitialBlockDownload()); }
public void NotInIBDIfChainStateIsNull() { var blockDownloadState = new InitialBlockDownloadState(null, this.network, this.consensusSettings, this.checkpoints, this.loggerFactory.Object, DateTimeProvider.Default); Assert.False(blockDownloadState.IsInitialBlockDownload()); }