-
Notifications
You must be signed in to change notification settings - Fork 67
Conversation
hewigovens
commented
Sep 10, 2018
•
edited
Loading
edited
Script\Type | P2PK | P2PKH | P2WPKH | P2SH P2WPKH | P2WSH | P2SH P2WSH |
---|---|---|---|---|---|---|
redeem | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
lock | N/A | ✅ | ✅ | ✅ | ✅ | N/A |
Codecov Report
@@ Coverage Diff @@
## master #49 +/- ##
==========================================
+ Coverage 81.77% 84.18% +2.41%
==========================================
Files 77 79 +2
Lines 3117 2846 -271
==========================================
- Hits 2549 2396 -153
+ Misses 568 450 -118
Continue to review full report at Codecov.
|
let publicKey = PublicKey(data: Data(hexString: "042de45bea3dada528eee8a1e04142d3e04fad66119d971b6019b0e3c02266b79142158aa83469db1332a880a2d5f8ce0b3bba542b3e32df0740ccbfb01c275e42")!)! | ||
XCTAssertEqual(publicKey.bitcoinAddress(prefix: 0x05).description, "3LbBftXPhBmByAqgpZqx61ttiFfxjde2z7") | ||
let address = publicKey.bitcoinAddress(prefix: 0x05) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do 0x05
=> Bitcoin().payToScriptHashAddressPrefix
?
compiling on 32bit devices failed: Testing failed:
Cannot convert value of type '(UnsafeRawBufferPointer) -> Data' to expected argument type '(UnsafeRawBufferPointer) -> _'
Cannot convert value of type '(UnsafeRawBufferPointer) -> Data' to expected argument type '(UnsafeRawBufferPointer) -> _'
** TEST FAILED **
The following build commands failed:
CompileSwift normal i386 /Users/travis/build/TrustWallet/trust-core/Sources/Bitcoin/BitcoinTransactionSigner.swift
CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler
(2 failures)
The command "xcodebuild clean test -workspace TrustCore.xcworkspace -scheme "TrustCore" -destination 'platform=iOS Simulator,name=iPhone 5'" exited with 65. |
Sources/Bitcoin/BitcoinScript.swift
Outdated
@@ -223,7 +223,7 @@ public final class BitcoinScript: BinaryEncoding, CustomDebugStringConvertible { | |||
var data = Data(capacity: 5 + pubKeyHash.count) | |||
data.append(contentsOf: [OpCode.OP_DUP, OpCode.OP_HASH160]) | |||
data.append(UInt8(pubKeyHash.count)) | |||
data.append(pubKeyHash) | |||
data.append([UInt8](pubKeyHash), count: pubKeyHash.count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this fixes anything 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swift mystery.
Remember we had similar bug? Data wasn’t converted properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right