Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift4.2 #168

Merged
merged 11 commits into from
Sep 11, 2019
Merged

Swift4.2 #168

merged 11 commits into from
Sep 11, 2019

Conversation

usatie
Copy link
Member

@usatie usatie commented Sep 23, 2018

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.

Description of the Change

Converted from Swift 4.1.2 to 4.2

  • Most of Range() is not needed any more
  • Some name change by default

Alternate Designs

Do nothing.

Benefits

Modern language.

Possible Drawbacks

Users who are using Xcode 9.0 or older cannot use BitcoinKit.
I'm not sure about this.

Applicable Issues

closes #163

p.pointee
}
return _HDKey(privateKey: result,
publicKey: result,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are really both of privateKey and publicKey the same value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh this is kind of bad architecture of _HDKey.
I think _HDKey should be refactored, but it's not in the scope of this PR.

@@ -104,6 +104,12 @@ class MockHelperTests: XCTestCase {
}
}
}

func testP2SHRecursively() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this test is necessary. If it is, please comment for the reason.

@@ -0,0 +1,24 @@
//
// SerializationTests.swift
Copy link
Contributor

Choose a reason for hiding this comment

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

Please modify copy right.

@DevilDimon
Copy link

Is there anything else that prevents this PR from being merged?

@usatie
Copy link
Member Author

usatie commented Sep 11, 2019

@DevilDimon Sorry for long time absence. Will merge this branch.

@@ -140,11 +143,11 @@ public class _HDKey {
data.append(0) // padding
data += privateKey ?? Data()
Copy link
Member Author

Choose a reason for hiding this comment

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

If privateKey is nil, it should return nil

- Return nil if index is greater than 0x80000000
- Return nil if hardend but has no private key
Copy link
Member Author

@usatie usatie left a comment

Choose a reason for hiding this comment

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

Self reviewed. LGTM.

@usatie usatie merged commit b7391f9 into master Sep 11, 2019
@usatie usatie deleted the swift4.2 branch September 12, 2019 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swift4.2 conversion
3 participants