| | 1 | | namespace NLightning.Domain.Protocol.Payloads; |
| | 2 | |
|
| | 3 | | using Interfaces; |
| | 4 | | using Messages; |
| | 5 | | using ValueObjects; |
| | 6 | |
|
| | 7 | | /// <summary> |
| | 8 | | /// Represents a tx_signatures payload. |
| | 9 | | /// </summary> |
| | 10 | | /// <remarks> |
| | 11 | | /// The tx_signatures payload signals the provision of transaction signatures. |
| | 12 | | /// </remarks> |
| | 13 | | /// <seealso cref="TxSignaturesMessage"/> |
| | 14 | | /// <seealso cref="ValueObjects.ChannelId"/> |
| | 15 | | /// <seealso cref="Witness"/> |
| | 16 | | public class TxSignaturesPayload : IMessagePayload |
| | 17 | | { |
| | 18 | | /// <summary> |
| | 19 | | /// The channel id. |
| | 20 | | /// </summary> |
| 8 | 21 | | public ChannelId ChannelId { get; } |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// The transaction id. |
| | 25 | | /// </summary> |
| 8 | 26 | | public byte[] TxId { get; } |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// The witnesses. |
| | 30 | | /// </summary> |
| 16 | 31 | | public List<Witness> Witnesses { get; } |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// Initializes a new instance of the <see cref="TxSignaturesPayload"/> class. |
| | 35 | | /// </summary> |
| | 36 | | /// <param name="channelId">The channel id.</param> |
| | 37 | | /// <param name="txId">The transaction id.</param> |
| | 38 | | /// <param name="witnesses">The witnesses.</param> |
| | 39 | | /// <exception cref="ArgumentException">TxId must be 32 bytes</exception> |
| 12 | 40 | | public TxSignaturesPayload(ChannelId channelId, byte[] txId, List<Witness> witnesses) |
| | 41 | | { |
| 12 | 42 | | if (txId.Length != 32) |
| 4 | 43 | | throw new ArgumentException("TxId must be 32 bytes", nameof(txId)); |
| | 44 | |
|
| 8 | 45 | | ChannelId = channelId; |
| 8 | 46 | | TxId = txId; |
| 8 | 47 | | Witnesses = witnesses; |
| 8 | 48 | | } |
| | 49 | | } |