Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
dd82a8e6
Commit
dd82a8e6
authored
May 11, 2017
by
Dan Gershony
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the hardcoded CoinType
parent
3dc33b09
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
31 deletions
+7
-31
Breeze.Api.csproj
Breeze/src/Breeze.Api/Breeze.Api.csproj
+1
-1
Breeze.Daemon.csproj
Breeze/src/Breeze.Daemon/Breeze.Daemon.csproj
+1
-1
Breeze.Wallet.csproj
Breeze/src/Breeze.Wallet/Breeze.Wallet.csproj
+1
-1
ChainExtensions.cs
Breeze/src/Breeze.Wallet/ChainExtensions.cs
+0
-24
Tracker.cs
Breeze/src/Breeze.Wallet/Tracker.cs
+2
-2
WalletManager.cs
Breeze/src/Breeze.Wallet/WalletManager.cs
+2
-2
No files found.
Breeze/src/Breeze.Api/Breeze.Api.csproj
View file @
dd82a8e6
...
...
@@ -29,7 +29,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.1" />
<PackageReference Include="Stratis.Bitcoin" Version="1.0.1.
5
-alpha" />
<PackageReference Include="Stratis.Bitcoin" Version="1.0.1.
6
-alpha" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0-rc3" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
...
...
Breeze/src/Breeze.Daemon/Breeze.Daemon.csproj
View file @
dd82a8e6
...
...
@@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Stratis.Bitcoin" Version="1.0.1.
5
-alpha" />
<PackageReference Include="Stratis.Bitcoin" Version="1.0.1.
6
-alpha" />
</ItemGroup>
</Project>
Breeze/src/Breeze.Wallet/Breeze.Wallet.csproj
View file @
dd82a8e6
...
...
@@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="ConcurrentHashSet" Version="1.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="1.0.3" />
<PackageReference Include="Stratis.Bitcoin" Version="1.0.1.
5
-alpha" />
<PackageReference Include="Stratis.Bitcoin" Version="1.0.1.
6
-alpha" />
</ItemGroup>
</Project>
Breeze/src/Breeze.Wallet/ChainExtensions.cs
View file @
dd82a8e6
...
...
@@ -16,30 +16,6 @@ namespace Breeze.Wallet
return
chain
.
Tip
.
Header
.
BlockTime
.
ToUnixTimeSeconds
()
>
(
DateTimeOffset
.
Now
.
ToUnixTimeSeconds
()
-
TimeSpan
.
FromHours
(
1
).
TotalSeconds
);
}
/// <summary>
/// Gets the type of the coin this chain relates to.
/// Obviously this method and how we figure out what coin we're on needs to be revisited.
/// </summary>
/// <param name="chain">The chain.</param>
/// <returns></returns>
/// <exception cref="System.Exception">No support for this coin.</exception>
public
static
CoinType
GetCoinType
(
this
ConcurrentChain
chain
)
{
uint256
genesis
=
chain
.
Genesis
.
Header
.
GetHash
();
switch
(
genesis
.
ToString
())
{
case
"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
:
return
CoinType
.
Bitcoin
;
case
"b0e511e965aeb40614ca65a1b79bd6e4e7ef299fa23e575a64b079691e9d4690"
:
return
CoinType
.
Stratis
;
case
"000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"
:
return
CoinType
.
Testnet
;
default
:
throw
new
Exception
(
"No support for this coin."
);
}
}
/// <summary>
/// Gets the height of the first block created after this date.
/// </summary>
...
...
Breeze/src/Breeze.Wallet/Tracker.cs
View file @
dd82a8e6
...
...
@@ -22,13 +22,13 @@ namespace Breeze.Wallet
private
readonly
BlockNotification
blockNotification
;
private
readonly
CoinType
coinType
;
public
Tracker
(
IWalletManager
walletManager
,
ConcurrentChain
chain
,
Signals
signals
,
BlockNotification
blockNotification
)
public
Tracker
(
IWalletManager
walletManager
,
ConcurrentChain
chain
,
Signals
signals
,
BlockNotification
blockNotification
,
Network
network
)
{
this
.
walletManager
=
walletManager
as
WalletManager
;
this
.
chain
=
chain
;
this
.
signals
=
signals
;
this
.
blockNotification
=
blockNotification
;
this
.
coinType
=
chain
.
GetCoinType
()
;
this
.
coinType
=
(
CoinType
)
network
.
Consensus
.
CoinType
;
}
/// <inheritdoc />
...
...
Breeze/src/Breeze.Wallet/WalletManager.cs
View file @
dd82a8e6
...
...
@@ -35,7 +35,7 @@ namespace Breeze.Wallet
/// </summary>
public
event
EventHandler
<
TransactionFoundEventArgs
>
TransactionFound
;
public
WalletManager
(
ConcurrentChain
chain
)
public
WalletManager
(
ConcurrentChain
chain
,
Network
netwrok
)
{
this
.
Wallets
=
new
List
<
Wallet
>();
...
...
@@ -45,7 +45,7 @@ namespace Breeze.Wallet
this
.
Load
(
this
.
DeserializeWallet
(
path
));
}
this
.
coinType
=
chain
.
GetCoinType
()
;
this
.
coinType
=
(
CoinType
)
netwrok
.
Consensus
.
CoinType
;
// load data in memory for faster lookups
// TODO get the coin type from somewhere else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment