public void CheckHardened_WithoutConsensusSettings_ReturnsTrue() { var checkpoints = new Checkpoints(); var result = checkpoints.CheckHardened(11111, new uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")); Assert.True(result); }
public void CheckHardened_CheckpointsEnabledAfterLoad_RetrievesCheckpointsCorrectly() { var consensusSettings = new ConsensusSettings() { UseCheckpoints = false }; var checkpoints = new Checkpoints(Network.Main, consensusSettings); var result = checkpoints.CheckHardened(11111, new uint256("0x0000000059e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1e")); // invalid hash Assert.True(result); consensusSettings.UseCheckpoints = true; result = checkpoints.CheckHardened(11111, new uint256("0x0000000059e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1e")); // invalid hash Assert.False(result); }
public void CheckHardened_CheckpointDoesNotExistAtHeight_ReturnsTrue() { var checkpoints = new Checkpoints(Network.Main, new ConsensusSettings() { UseCheckpoints = true }); var result = checkpoints.CheckHardened(11112, new uint256("0x7d61c139a471821caa6b7635a4636e90afcfe5e195040aecbc1ad7d24924db1e")); Assert.True(result); }
public void CheckHardened_CheckpointExistsWithDifferentHashAtHeight_ReturnsTrue() { var checkpoints = new Checkpoints(Network.Main, new ConsensusSettings() { UseCheckpoints = true }); var result = checkpoints.CheckHardened(11111, new uint256("0x0000000059e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1e")); Assert.False(result); }
public void CheckHardened_CheckpointExistsWithHashAtHeight_ReturnsTrue() { var checkpoints = new Checkpoints(this.network, new ConsensusSettings(NodeSettings.Default(this.network)) { UseCheckpoints = true }); bool result = checkpoints.CheckHardened(11111, new uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")); Assert.True(result); }