Skip to content

Commit

Permalink
added todo items.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hüseyin Uslu committed Sep 23, 2014
1 parent 179c967 commit 37f9ef0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CoiniumServ/Daemon/Responses/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public TransactionDetail GetPoolOutput(string poolAddress, string poolAccount)
// case 1) some of bitcoin variants can include the "address" in the transaction detail and we can basically find the output comparing against it.
// case 2) some other bitcoin variants can include "address account" name in transaction detail and we again find the output comparing against it.
// case 3) peercoin variants is where things get complicated, even if you set an account name to an address, they peercoin variants will refuse use the name in details.
// TODO: case 3 should be only allowed by configuration

if (Details.Any(x => x.Address == poolAddress)) // check for case 1.
return Details.First(x => x.Address == poolAddress); // return the output that matches pool address.
Expand Down
4 changes: 4 additions & 0 deletions src/Tests/Blocks/BlockProcessorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ private void QueryBlockTest_WithIncorrectPoolOutputAddress_ShouldBeOrphaned()
[Fact]
private void QueryBlockTest_WithIncorrectPoolOutputAccount_ShouldBeOrphaned()
{
// todo: latest change in Transaction.cs:GetPoolOutput() makes this test fail, case 3 should be only allowed by configuration

// test case: generation transaction output doesn't match pool output account.
var block = new PersistedBlock(1, false, false, false, "BLOCK_HASH", "TX_HASH", 0, 0, DateTime.Now);

Expand All @@ -194,6 +196,8 @@ private void QueryBlockTest_WithIncorrectPoolOutputAccount_ShouldBeOrphaned()
[Fact]
private void QueryBlockTest_ShouldSetReward()
{
// todo: latest change in Transaction.cs:GetPoolOutput() makes this test fail, case 3 should be only a configuration option.

// test case: set block reward based on pool output value.
var block = new PersistedBlock(1, false, false, false, "BLOCK_HASH", "TX_HASH", 0, 0, DateTime.Now);
_poolConfig.Wallet.Adress.Returns("POOL_ADDRESS");
Expand Down

0 comments on commit 37f9ef0

Please sign in to comment.