Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Fixed address starts with 0x in keystore v3 #279
Browse files Browse the repository at this point in the history
  • Loading branch information
v57 committed Feb 12, 2019
1 parent 7a89338 commit 4784042
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/web3swift/KeystoreManager/EthereumKeystoreV3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public struct KeystoreParamsV3: Decodable, Encodable {

/// Init with all params
public init(address ad: String?, crypto cr: CryptoParamsV3, id i: String, version ver: Int) {
address = ad
address = ad?.withoutHex
crypto = cr
id = i
version = ver
Expand Down
2 changes: 1 addition & 1 deletion Tests/web3swiftTests/KeystoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class KeystoresTests: XCTestCase {

func testImportAndExport() throws {
let json = """
{"version":3,"id":"8b60fda9-5f27-4478-9cc9-72059571aa6e","crypto":{"ciphertext":"d34e78640359a599970a58b3b4b7c987945e56c69411028ea62394e8d1ea7e4b","cipherparams":{"iv":"6e4a429a30807ab9202a9aefad152398"},"kdf":"scrypt","kdfparams":{"r":6,"p":1,"n":4096,"dklen":32,"salt":"0000000000000000000000000000000000000000000000000000000000000000"},"mac":"79888d6ce3a2a24d6b70d07ca9067b57e4a57bd9416a3abb336900cacf82e29a","cipher":"aes-128-cbc"},"address":"0x0b0f7a95485060973726d03e7c326a6542bcb55b"}
{"version":3,"id":"8b60fda9-5f27-4478-9cc9-72059571aa6e","crypto":{"ciphertext":"d34e78640359a599970a58b3b4b7c987945e56c69411028ea62394e8d1ea7e4b","cipherparams":{"iv":"6e4a429a30807ab9202a9aefad152398"},"kdf":"scrypt","kdfparams":{"r":6,"p":1,"n":4096,"dklen":32,"salt":"0000000000000000000000000000000000000000000000000000000000000000"},"mac":"79888d6ce3a2a24d6b70d07ca9067b57e4a57bd9416a3abb336900cacf82e29a","cipher":"aes-128-cbc"},"address":"0b0f7a95485060973726d03e7c326a6542bcb55b"}
"""
let keystore = EthereumKeystoreV3(json)!
let data = try keystore.serialize()!
Expand Down
2 changes: 1 addition & 1 deletion web3swift.pod.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'web3swift.pod'
spec.version = '2.1.8'
spec.version = '2.1.9'
spec.ios.deployment_target = "8.0"
spec.osx.deployment_target = "10.10"
spec.tvos.deployment_target = "9.0"
Expand Down
2 changes: 1 addition & 1 deletion web3swift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'web3swift'
spec.version = '2.1.8'
spec.version = '2.1.9'
spec.ios.deployment_target = "8.0"
spec.osx.deployment_target = "10.10"
spec.tvos.deployment_target = "9.0"
Expand Down

0 comments on commit 4784042

Please sign in to comment.