From 41327d2f7d774fa6cb20357418c5cf895ba710f8 Mon Sep 17 00:00:00 2001 From: dangershony Date: Thu, 16 Nov 2023 11:19:52 +0000 Subject: [PATCH] Act on review --- src/Angor.Test/{Protocol => DataBuilders}/AngorScripts.cs | 2 +- .../{Protocol => DataBuilders}/InvestmentOperations.cs | 2 +- .../{Protocol => DataBuilders}/ProjectOperations.cs | 2 +- src/Angor.Test/{Protocol => DataBuilders}/ScriptBuilder.cs | 2 +- src/Angor.Test/InvestmentOperationsTest.cs | 2 +- src/Angor.Test/ProtocolNew/FounderTransactionActionTest.cs | 2 +- src/Angor.Test/ProtocolNew/InvestmentIntegrationsTests.cs | 2 +- src/Angor.Test/ScriptTest.cs | 2 +- src/Angor.Test/ScriptThresholdTest.cs | 2 +- src/Angor/Client/Pages/Create.razor | 4 ++-- src/Angor/Client/Pages/Penalties.razor | 2 -- src/Angor/Shared/ProtocolNew/InvestorTransactionActions.cs | 2 -- .../Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs | 4 ---- 13 files changed, 11 insertions(+), 19 deletions(-) rename src/Angor.Test/{Protocol => DataBuilders}/AngorScripts.cs (99%) rename src/Angor.Test/{Protocol => DataBuilders}/InvestmentOperations.cs (99%) rename src/Angor.Test/{Protocol => DataBuilders}/ProjectOperations.cs (96%) rename src/Angor.Test/{Protocol => DataBuilders}/ScriptBuilder.cs (99%) diff --git a/src/Angor.Test/Protocol/AngorScripts.cs b/src/Angor.Test/DataBuilders/AngorScripts.cs similarity index 99% rename from src/Angor.Test/Protocol/AngorScripts.cs rename to src/Angor.Test/DataBuilders/AngorScripts.cs index 72331d71..98c9b6fa 100644 --- a/src/Angor.Test/Protocol/AngorScripts.cs +++ b/src/Angor.Test/DataBuilders/AngorScripts.cs @@ -8,7 +8,7 @@ using Script = Blockcore.Consensus.ScriptInfo.Script; -namespace Angor.Test.Protocol +namespace Angor.Test.DataBuilders { public class AngorScripts { diff --git a/src/Angor.Test/Protocol/InvestmentOperations.cs b/src/Angor.Test/DataBuilders/InvestmentOperations.cs similarity index 99% rename from src/Angor.Test/Protocol/InvestmentOperations.cs rename to src/Angor.Test/DataBuilders/InvestmentOperations.cs index fc8a562d..c94f2b1c 100644 --- a/src/Angor.Test/Protocol/InvestmentOperations.cs +++ b/src/Angor.Test/DataBuilders/InvestmentOperations.cs @@ -20,7 +20,7 @@ using Utils = NBitcoin.Utils; using WitScript = NBitcoin.WitScript; -namespace Angor.Test.Protocol; +namespace Angor.Test.DataBuilders; public class InvestmentOperations { diff --git a/src/Angor.Test/Protocol/ProjectOperations.cs b/src/Angor.Test/DataBuilders/ProjectOperations.cs similarity index 96% rename from src/Angor.Test/Protocol/ProjectOperations.cs rename to src/Angor.Test/DataBuilders/ProjectOperations.cs index 227b9745..a2d4dae8 100644 --- a/src/Angor.Test/Protocol/ProjectOperations.cs +++ b/src/Angor.Test/DataBuilders/ProjectOperations.cs @@ -3,7 +3,7 @@ using Blockcore.NBitcoin; using Blockcore.Networks; -namespace Angor.Test.Protocol; +namespace Angor.Test.DataBuilders; public class ProjectOperations { diff --git a/src/Angor.Test/Protocol/ScriptBuilder.cs b/src/Angor.Test/DataBuilders/ScriptBuilder.cs similarity index 99% rename from src/Angor.Test/Protocol/ScriptBuilder.cs rename to src/Angor.Test/DataBuilders/ScriptBuilder.cs index 98565fa0..8bf2b801 100644 --- a/src/Angor.Test/Protocol/ScriptBuilder.cs +++ b/src/Angor.Test/DataBuilders/ScriptBuilder.cs @@ -3,7 +3,7 @@ using Blockcore.Consensus.ScriptInfo; using Blockcore.NBitcoin; -namespace Angor.Test.Protocol; +namespace Angor.Test.DataBuilders; public class ScriptBuilder { diff --git a/src/Angor.Test/InvestmentOperationsTest.cs b/src/Angor.Test/InvestmentOperationsTest.cs index 24cf98ee..4bb8cb6d 100644 --- a/src/Angor.Test/InvestmentOperationsTest.cs +++ b/src/Angor.Test/InvestmentOperationsTest.cs @@ -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; diff --git a/src/Angor.Test/ProtocolNew/FounderTransactionActionTest.cs b/src/Angor.Test/ProtocolNew/FounderTransactionActionTest.cs index a13e0046..c4976ba9 100644 --- a/src/Angor.Test/ProtocolNew/FounderTransactionActionTest.cs +++ b/src/Angor.Test/ProtocolNew/FounderTransactionActionTest.cs @@ -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; diff --git a/src/Angor.Test/ProtocolNew/InvestmentIntegrationsTests.cs b/src/Angor.Test/ProtocolNew/InvestmentIntegrationsTests.cs index c35c4f37..1cf37653 100644 --- a/src/Angor.Test/ProtocolNew/InvestmentIntegrationsTests.cs +++ b/src/Angor.Test/ProtocolNew/InvestmentIntegrationsTests.cs @@ -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; diff --git a/src/Angor.Test/ScriptTest.cs b/src/Angor.Test/ScriptTest.cs index 2f7f2935..534aa413 100644 --- a/src/Angor.Test/ScriptTest.cs +++ b/src/Angor.Test/ScriptTest.cs @@ -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; diff --git a/src/Angor.Test/ScriptThresholdTest.cs b/src/Angor.Test/ScriptThresholdTest.cs index 87063fa9..254d2f8f 100644 --- a/src/Angor.Test/ScriptThresholdTest.cs +++ b/src/Angor.Test/ScriptThresholdTest.cs @@ -1,5 +1,5 @@ using Angor.Shared; -using Angor.Test.Protocol; +using Angor.Test.DataBuilders; namespace Angor.Test { diff --git a/src/Angor/Client/Pages/Create.razor b/src/Angor/Client/Pages/Create.razor index 772e025f..23d31044 100644 --- a/src/Angor/Client/Pages/Create.razor +++ b/src/Angor/Client/Pages/Create.razor @@ -55,8 +55,8 @@
- - + +
diff --git a/src/Angor/Client/Pages/Penalties.razor b/src/Angor/Client/Pages/Penalties.razor index 1a8010f3..52c961cd 100644 --- a/src/Angor/Client/Pages/Penalties.razor +++ b/src/Angor/Client/Pages/Penalties.razor @@ -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), }); } diff --git a/src/Angor/Shared/ProtocolNew/InvestorTransactionActions.cs b/src/Angor/Shared/ProtocolNew/InvestorTransactionActions.cs index 2b3b02e0..ad5c1240 100644 --- a/src/Angor/Shared/ProtocolNew/InvestorTransactionActions.cs +++ b/src/Angor/Shared/ProtocolNew/InvestorTransactionActions.cs @@ -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 diff --git a/src/Angor/Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs b/src/Angor/Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs index b83412a1..a24f11c5 100644 --- a/src/Angor/Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs +++ b/src/Angor/Shared/ProtocolNew/Scripts/InvestmentScriptBuilder.cs @@ -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.GetPushOp(new NBitcoin.PubKey(investorKey).ToBytes()),