diff --git a/src/bitcoin-base/transaction/BitcoinTransaction.swift b/src/bitcoin-base/transaction/BitcoinTransaction.swift index 6434882..005fc4b 100644 --- a/src/bitcoin-base/transaction/BitcoinTransaction.swift +++ b/src/bitcoin-base/transaction/BitcoinTransaction.swift @@ -30,16 +30,16 @@ public struct BitcoinTransaction: Equatable, Sendable { // MARK: - Instance Properties /// The transaction's version. - public let version: TransactionVersion + public var version: TransactionVersion /// Lock time value applied to this transaction. It represents the earliest time at which this transaction should be considered valid. - public let locktime: TransactionLocktime + public var locktime: TransactionLocktime /// All of the inputs consumed (coins spent) by this transaction. - public let inputs: [TransactionInput] + public var inputs: [TransactionInput] /// The new outputs to be created by this transaction. - public let outputs: [TransactionOutput] + public var outputs: [TransactionOutput] // MARK: - Computed Properties @@ -71,22 +71,6 @@ public struct BitcoinTransaction: Equatable, Sendable { return .init(transaction: id, output: outputIndex) } - public func withUnlockScript(_ script: BitcoinScript, input inputIndex: Int) -> Self { - precondition(inputs.indices.contains(inputIndex)) - let oldInput = inputs[inputIndex] - let newInput = TransactionInput(outpoint: oldInput.outpoint, sequence: oldInput.sequence, script: script, witness: oldInput.witness) - let newInputs = inputs[.. Self { - precondition(inputs.indices.contains(inputIndex)) - let oldInput = inputs[inputIndex] - let newInput = TransactionInput(outpoint: oldInput.outpoint, sequence: oldInput.sequence, script: oldInput.script, witness: .init(witnessElements)) - let newInputs = inputs[..