Skip to content

Commit

Permalink
Act on review
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony committed Nov 16, 2023
1 parent 7aaf2ae commit 41327d2
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Script = Blockcore.Consensus.ScriptInfo.Script;


namespace Angor.Test.Protocol
namespace Angor.Test.DataBuilders
{
public class AngorScripts
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using Utils = NBitcoin.Utils;
using WitScript = NBitcoin.WitScript;

namespace Angor.Test.Protocol;
namespace Angor.Test.DataBuilders;

public class InvestmentOperations
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Blockcore.NBitcoin;
using Blockcore.Networks;

namespace Angor.Test.Protocol;
namespace Angor.Test.DataBuilders;

public class ProjectOperations
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Blockcore.Consensus.ScriptInfo;
using Blockcore.NBitcoin;

namespace Angor.Test.Protocol;
namespace Angor.Test.DataBuilders;

public class ScriptBuilder
{
Expand Down
2 changes: 1 addition & 1 deletion src/Angor.Test/InvestmentOperationsTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Angor.Shared;
using Angor.Shared.Models;
using Angor.Shared.Networks;
using Angor.Test.Protocol;
using Angor.Test.DataBuilders;
using Blockcore.NBitcoin;
using Blockcore.NBitcoin.Crypto;
using Blockcore.NBitcoin.DataEncoders;
Expand Down
2 changes: 1 addition & 1 deletion src/Angor.Test/ProtocolNew/FounderTransactionActionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Angor.Shared.ProtocolNew;
using Angor.Shared.ProtocolNew.Scripts;
using Angor.Shared.ProtocolNew.TransactionBuilders;
using Angor.Test.Protocol;
using Angor.Test.DataBuilders;
using Blockcore.NBitcoin;
using Blockcore.NBitcoin.DataEncoders;
using Microsoft.Extensions.Logging.Abstractions;
Expand Down
2 changes: 1 addition & 1 deletion src/Angor.Test/ProtocolNew/InvestmentIntegrationsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Angor.Shared.ProtocolNew;
using Angor.Shared.ProtocolNew.Scripts;
using Angor.Shared.ProtocolNew.TransactionBuilders;
using Angor.Test.Protocol;
using Angor.Test.DataBuilders;
using Blockcore.Consensus.ScriptInfo;
using Blockcore.Consensus.TransactionInfo;
using Blockcore.NBitcoin;
Expand Down
2 changes: 1 addition & 1 deletion src/Angor.Test/ScriptTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Angor.Shared;
using Angor.Shared.Models;
using Angor.Shared.Networks;
using Angor.Test.Protocol;
using Angor.Test.DataBuilders;
using Blockcore.NBitcoin;
using Blockcore.NBitcoin.Crypto;

Expand Down
2 changes: 1 addition & 1 deletion src/Angor.Test/ScriptThresholdTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Angor.Shared;
using Angor.Test.Protocol;
using Angor.Test.DataBuilders;

namespace Angor.Test
{
Expand Down
4 changes: 2 additions & 2 deletions src/Angor/Client/Pages/Create.razor
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

<!-- Penalty Date -->
<div class="mb-3">
<label for="penaltyDate" class="form-label">Penalty Days</label>
<InputNumber id="penaltyDate" @bind-Value="project.PenaltyDays" class="form-control" />
<label for="penaltyDays" class="form-label">Penalty Days</label>
<InputNumber id="penaltyDays" @bind-Value="project.PenaltyDays" class="form-control" />
</div>

<!-- Expiry Date -->
Expand Down
2 changes: 0 additions & 2 deletions src/Angor/Client/Pages/Penalties.razor
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@
{
ProjectIdentifier = signatureInfo.ProjectIdentifier,
RecoveryTransactionId = signatureInfo.RecoveryTransactionId,
//DaysLeftForPenalty = (project.PenaltyDays - DateTime.Now).Days,
//IsExpired = (project.PenaltyDays - DateTime.Now).Days <= 0,
IsReleased = !string.IsNullOrEmpty(signatureInfo.RecoveryReleaseTransactionId),
});
}
Expand Down
2 changes: 0 additions & 2 deletions src/Angor/Shared/ProtocolNew/InvestorTransactionActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ public Transaction BuildAndSignRecoverReleaseFundsTransaction(ProjectInfo projec
var network = _networkConfiguration.GetNetwork();
var transaction = network.CreateTransaction();

//transaction.LockTime = Utils.DateTimeToUnixTime(projectInfo.PenaltyDays.AddMinutes(1));

transaction.Version = 2; // to trigger bip68 rules

// add the output address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ public InvestmentScriptBuilder(ISeederScriptTreeBuilder seederScriptTreeBuilder)

public Script GetInvestorPenaltyTransactionScript(string investorKey, int punishmentLockDays)
{
// var unixTime = Utils.DateTimeToUnixTime(punishmentLockDays);

var sequence = new Sequence(TimeSpan.FromDays(punishmentLockDays));

//var totalSeconds = (uint)TimeSpan.FromDays(punishmentLockDays).TotalSeconds;

return new(new List<Op>
{
Op.GetPushOp(new NBitcoin.PubKey(investorKey).ToBytes()),
Expand Down

0 comments on commit 41327d2

Please sign in to comment.