Skip to content

Commit e37b6d4

Browse files
authored
Separate networks in to their own projects (#82)
* Separate networks to their own projects and folder * Move specific rules to their respective network projects * Move Utxostore rules to Utxoset folder
1 parent 853e73c commit e37b6d4

134 files changed

Lines changed: 415 additions & 246 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15+
<ProjectReference Include="..\Blockcore.Networks.Bitcoin\Blockcore.Networks.Bitcoin.csproj" />
1516
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
1617
<ProjectReference Include="..\Blockcore.Features.Api\Blockcore.Features.Api.csproj" />
1718
<ProjectReference Include="..\Blockcore.Features.RPC\Blockcore.Features.RPC.csproj" />
18-
<ProjectReference Include="..\Blockcore.Networks\Blockcore.Networks.csproj" />
1919
<ProjectReference Include="..\Blockcore\Blockcore.csproj" />
2020
</ItemGroup>
2121

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using Newtonsoft.Json;
1616
using Newtonsoft.Json.Linq;
1717

18-
namespace Blockcore.Cli
18+
namespace Bitcoin.Cli
1919
{
2020
public class Program
2121
{
@@ -108,14 +108,7 @@ public static void Main(string[] args)
108108
// Determine API port.
109109
NetworksSelector networksSelector = null;
110110

111-
if (networkName.Contains("stratis"))
112-
{
113-
networksSelector = Networks.Networks.Stratis;
114-
}
115-
else
116-
{
117-
networksSelector = Networks.Networks.Bitcoin;
118-
}
111+
networksSelector = Blockcore.Networks.Bitcoin.Networks.Bitcoin;
119112

120113
// API calls require both the contoller name and the method name separated by "/".
121114
// If this is not an API call then assume it is an RPC call.
File renamed without changes.

src/Bitcoin/BitcoinD.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
</PropertyGroup>
2222

2323
<ItemGroup>
24+
<ProjectReference Include="..\Blockcore.Networks.Bitcoin\Blockcore.Networks.Bitcoin.csproj" />
2425
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
2526
<ProjectReference Include="..\Blockcore.Features.Api\Blockcore.Features.Api.csproj" />
2627
<ProjectReference Include="..\Blockcore.Features.BlockStore\Blockcore.Features.BlockStore.csproj" />
2728
<ProjectReference Include="..\Blockcore.Features.Consensus\Blockcore.Features.Consensus.csproj" />
2829
<ProjectReference Include="..\Blockcore.Features.MemoryPool\Blockcore.Features.MemoryPool.csproj" />
2930
<ProjectReference Include="..\Blockcore.Features.Miner\Blockcore.Features.Miner.csproj" />
3031
<ProjectReference Include="..\Blockcore.Features.RPC\Blockcore.Features.RPC.csproj" />
31-
<ProjectReference Include="..\Blockcore.Networks\Blockcore.Networks.csproj" />
3232
<ProjectReference Include="..\Blockcore\Blockcore.csproj" />
3333
</ItemGroup>
3434
</Project>

src/Bitcoin/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Blockcore.Features.RPC;
1212
using Blockcore.Features.Wallet;
1313
using Blockcore.Networks;
14+
using Blockcore.Networks.Bitcoin;
1415
using Blockcore.Utilities;
1516

1617
namespace BitcoinD
@@ -43,4 +44,4 @@ public static async Task Main(string[] args)
4344
}
4445
}
4546
}
46-
}
47+
}

src/Blockcore.Features.BlockStore.Tests/AddressIndexerTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
using Blockcore.Controllers.Models;
1010
using Blockcore.Features.BlockStore.AddressIndexing;
1111
using Blockcore.Networks;
12+
using Blockcore.Networks.Bitcoin;
13+
using Blockcore.Networks.Stratis;
1214
using Blockcore.Primitives;
1315
using Blockcore.Tests.Common;
1416
using Blockcore.Utilities;
@@ -378,4 +380,4 @@ public void MaxReorgIsCalculatedProperly()
378380
Assert.Equal(maxReorgStratis, (int)stratis.Consensus.MaxReorgLength);
379381
}
380382
}
381-
}
383+
}

src/Blockcore.Features.BlockStore.Tests/Blockcore.Features.BlockStore.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
</ItemGroup>
3636

3737
<ItemGroup>
38+
<ProjectReference Include="..\Blockcore.Networks.Bitcoin\Blockcore.Networks.Bitcoin.csproj" />
39+
<ProjectReference Include="..\Blockcore.Networks.Stratis\Blockcore.Networks.Stratis.csproj" />
3840
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
3941
<ProjectReference Include="..\Blockcore.Features.BlockStore\Blockcore.Features.BlockStore.csproj" />
4042
<ProjectReference Include="..\Blockcore.Features.Consensus\Blockcore.Features.Consensus.csproj" />

src/Blockcore.Features.BlockStore.Tests/PruneBlockRepositoryTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Blockcore.Configuration;
33
using Blockcore.Features.BlockStore.Pruning;
44
using Blockcore.Networks;
5+
using Blockcore.Networks.Stratis;
56
using Blockcore.Tests.Common.Logging;
67
using Blockcore.Utilities;
78
using Xunit;
@@ -118,4 +119,4 @@ public void PruneRepository_PruneAndCompact_OnShutDown()
118119
Assert.Null(blockRepository.GetBlock(chainedHeaderTip.GetAncestor(29).HashBlock));
119120
}
120121
}
121-
}
122+
}

src/Blockcore.Features.BlockStore.Tests/PruneBlockStoreServiceTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Blockcore.Configuration;
44
using Blockcore.Features.BlockStore.Pruning;
55
using Blockcore.Networks;
6+
using Blockcore.Networks.Stratis;
67
using Blockcore.Tests.Common.Logging;
78
using Blockcore.Utilities;
89
using Moq;
@@ -215,4 +216,4 @@ public void PruneService_Triggered_MidChain_Respect_AmountOfBlocksToKeep()
215216
Assert.Equal(25, service.PrunedUpToHeaderTip.Height);
216217
}
217218
}
218-
}
219+
}

src/Blockcore.Features.ColdStaking.Tests/Blockcore.Features.ColdStaking.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
</ItemGroup>
3636

3737
<ItemGroup>
38+
<ProjectReference Include="..\Blockcore.Networks.Bitcoin\Blockcore.Networks.Bitcoin.csproj" />
39+
<ProjectReference Include="..\Blockcore.Networks.Stratis\Blockcore.Networks.Stratis.csproj" />
3840
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
3941
<ProjectReference Include="..\Blockcore.Features.ColdStaking\Blockcore.Features.ColdStaking.csproj" />
4042
<ProjectReference Include="..\Blockcore.Features.Wallet\Blockcore.Features.Wallet.csproj" />

0 commit comments

Comments
 (0)