Move `Parameters` to abstract `MPTxState`
MODIFY
WalletWasabi/WabiSabi/Models/MultipartyTransaction/ConstructionState.cs
WalletWasabi/WabiSabi/Models/MultipartyTransaction/ConstructionState.cs
@@ -6,8 +6,13 @@ using WalletWasabi.WabiSabi.Backend.Models;
namespace WalletWasabi.WabiSabi.Models.MultipartyTransaction
{
// This class represents actions of the BIP 370 creator and constructor roles
- public record ConstructionState(MultipartyTransactionParameters Parameters) : MultipartyTransactionState
+ public record ConstructionState : MultipartyTransactionState
{
+ public ConstructionState(MultipartyTransactionParameters Parameters)
+ : base(Parameters)
+ {
+ }
+
// TODO ownership proofs and spend status also in scope
public ConstructionState AddInput(Coin coin)
{

MODIFY
WalletWasabi/WabiSabi/Models/MultipartyTransaction/MultipartyTransactionState.cs
WalletWasabi/WabiSabi/Models/MultipartyTransaction/MultipartyTransactionState.cs
using NBitcoin;
-using System;
using System.Collections.Immutable;
using System.Linq;
namespace WalletWasabi.WabiSabi.Models.MultipartyTransaction
{
- public record MultipartyTransactionState
+ public abstract record MultipartyTransactionState
{
+ protected MultipartyTransactionState(MultipartyTransactionParameters parameters)
+ {
+ Parameters = parameters;
+ }
+
+ public MultipartyTransactionParameters Parameters { get; }
+
public ImmutableList<Coin> Inputs { get; init; } = ImmutableList<Coin>.Empty;
public ImmutableList<TxOut> Outputs { get; init; } = ImmutableList<TxOut>.Empty;

MODIFY
WalletWasabi/WabiSabi/Models/MultipartyTransaction/SigningState.cs
WalletWasabi/WabiSabi/Models/MultipartyTransaction/SigningState.cs
@@ -9,14 +9,12 @@ namespace WalletWasabi.WabiSabi.Models.MultipartyTransaction
public record SigningState : MultipartyTransactionState
{
public SigningState(ConstructionState state)
+ : base(state.Parameters)
{
- Parameters = state.Parameters;
Inputs = state.Inputs;
Outputs = state.Outputs;
}
- public MultipartyTransactionParameters Parameters { get; }
-
public ImmutableDictionary<int, WitScript> Witnesses { get; init; } = ImmutableDictionary<int, WitScript>.Empty;
public bool IsFullySigned => Witnesses.Count == Inputs.Count;

Move `Parameters` to abstract `MPTxState`