Skip to content

Commit

Permalink
[trello.com/c/GCrmAWok] Removed unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
just-software-dev committed Jun 14, 2023
1 parent b185d90 commit 265c6c5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 252 deletions.
126 changes: 0 additions & 126 deletions BitcoinKit/Sources/BitcoinKit/Mock/MockHelper.swift

This file was deleted.

70 changes: 0 additions & 70 deletions BitcoinKit/Sources/BitcoinKit/Mock/MockKey.swift

This file was deleted.

33 changes: 0 additions & 33 deletions BitcoinKit/Sources/BitcoinKit/Mock/MockUnlockScriptBuilder.swift

This file was deleted.

23 changes: 0 additions & 23 deletions BitcoinKit/Sources/BitcoinKit/Scripts/Script.swift
Original file line number Diff line number Diff line change
Expand Up @@ -401,29 +401,6 @@ public class Script {
}

extension Script {
// Standard Transaction to Bitcoin address (pay-to-pubkey-hash)
// scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
public static func buildPublicKeyHashOut(pubKeyHash: Data) -> Data {
var tmp = Data()
tmp += OpCode.OP_DUP
tmp += OpCode.OP_HASH160
tmp += UInt8(pubKeyHash.count)
tmp += pubKeyHash
tmp += OpCode.OP_EQUALVERIFY
tmp += OpCode.OP_CHECKSIG
return tmp
}

// Transaction to Bitcoin address (pay-to-script-hash)
public static func buildScriptHashOut(scriptHash: Data) -> Data {
var tmp = Data()
tmp += OpCode.OP_HASH160
tmp += UInt8(scriptHash.count)
tmp += scriptHash
tmp += OpCode.OP_EQUAL
return tmp
}

public static func buildPublicKeyUnlockingScript(signature: Data, pubkey: PublicKey, hashType: SighashType) -> Data {
var data: Data = Data([UInt8(signature.count + 1)]) + signature + UInt8(hashType)
data += VarInt(pubkey.data.count).serialized()
Expand Down

0 comments on commit 265c6c5

Please sign in to comment.