Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Conform Bitcoin to BIP49 #53

Merged
merged 6 commits into from
Sep 12, 2018
Merged

Conform Bitcoin to BIP49 #53

merged 6 commits into from
Sep 12, 2018

Conversation

vikmeup
Copy link
Contributor

@vikmeup vikmeup commented Sep 11, 2018

No description provided.

@trust-bot
Copy link

SwiftLint found issues

Warnings

File Line Reason
PurposeTests.swift 11 Lines should not have trailing whitespace.

Generated by 🚫 Danger

@codecov-io
Copy link

codecov-io commented Sep 12, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@71b241b). Click here to learn what that means.
The diff coverage is 86.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #53   +/-   ##
=========================================
  Coverage          ?   80.97%           
=========================================
  Files             ?       73           
  Lines             ?     2906           
  Branches          ?        0           
=========================================
  Hits              ?     2353           
  Misses            ?      553           
  Partials          ?        0
Impacted Files Coverage Δ
Sources/Bitcoin/Bitcoin.swift 44.44% <100%> (ø)
Tests/PurposeTests.swift 100% <100%> (ø)
Sources/Ethereum/Ethereum.swift 11.11% <100%> (ø)
Sources/Blockchain.swift 11.76% <33.33%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71b241b...3d41e32. Read the comment docs.

@@ -9,8 +9,10 @@ import Foundation
public extension PublicKey {
/// Returns the public key address with the given prefix.
public func bitcoinAddress(prefix: UInt8) -> BitcoinAddress {
let hash = Data([prefix]) + Crypto.sha256ripemd160(data)
return BitcoinAddress(data: hash)!
let witnessVersion = Data([0x00] + [0x14])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data(bytes: [0x00, 0x14])

let hash = Data([prefix]) + Crypto.sha256ripemd160(data)
return BitcoinAddress(data: hash)!
let witnessVersion = Data([0x00] + [0x14])
let redeemScript = Crypto.sha256ripemd160(witnessVersion + bitcoinKeyHash)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is specific to p2sh-p2wpkh is should be on a separate function: bitcoinSegWitAddress?

@vikmeup vikmeup merged commit 87d446d into master Sep 12, 2018
@vikmeup vikmeup deleted the purpose branch September 12, 2018 02:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants