private IBeaconPivot PreparePivot(long blockNumber, ISyncConfig syncConfig, IBlockTree blockTree, BlockHeader?pivotHeader = null) { IBeaconPivot pivot = new BeaconPivot(syncConfig, new MemDb(), blockTree, LimboLogs.Instance); pivot.EnsurePivot(pivotHeader ?? Build.A.BlockHeader.WithNumber(blockNumber).TestObject); return(pivot); }
public void Beacon_pivot_defaults_to_sync_config_values_when_there_is_no_pivot() { IPeerRefresher peerRefresher = Substitute.For <IPeerRefresher>(); IBeaconPivot pivot = new BeaconPivot(_syncConfig, new MemDb(), Substitute.For <IBlockTree>(), LimboLogs.Instance); pivot.PivotHash.Should().Be(_syncConfig.PivotHashParsed); pivot.PivotNumber.Should().Be(_syncConfig.PivotNumberParsed); pivot.PivotDestinationNumber.Should().Be(0); }