From 54d2cbc80fc2248de531ab63b0a0980dd0f39615 Mon Sep 17 00:00:00 2001 From: keefertaylor Date: Wed, 18 Sep 2019 19:03:26 -0700 Subject: [PATCH] dev --- IntegrationTests/Dexter/TokenContractIntegrationTests.swift | 1 - Tests/TezosKit/GetContractStorageRPCTest.swift | 2 +- Tests/TezosKit/MichelsonTests.swift | 2 +- TezosKit/Michelson/StringMichelsonParameter.swift | 3 +++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/IntegrationTests/Dexter/TokenContractIntegrationTests.swift b/IntegrationTests/Dexter/TokenContractIntegrationTests.swift index 7592b6fc..d565369f 100644 --- a/IntegrationTests/Dexter/TokenContractIntegrationTests.swift +++ b/IntegrationTests/Dexter/TokenContractIntegrationTests.swift @@ -17,7 +17,6 @@ import XCTest /// Token Contract: https://alphanet.tzscan.io/KT1PARMPddZ9WD1MPmPthXYBCgErmxAHKBD8 /// Address: https://alphanet.tzscan.io/tz1XVJ8bZUXs7r5NV8dHvuiBhzECvLRLR3jW - extension Address { public static let tokenContractAddress = "KT1WiDkoaKgH6dcmHa3tLJKzfnW5QuPjppgn" public static let tokenRecipient = "tz1XarY7qEahQBipuuNZ4vPw9MN6Ldyxv8G3" diff --git a/Tests/TezosKit/GetContractStorageRPCTest.swift b/Tests/TezosKit/GetContractStorageRPCTest.swift index 8cca4e39..3e721605 100644 --- a/Tests/TezosKit/GetContractStorageRPCTest.swift +++ b/Tests/TezosKit/GetContractStorageRPCTest.swift @@ -8,7 +8,7 @@ final class GetContractStorageRPCTest: XCTestCase { let address = "abc123" let rpc = GetContractStorageRPC(address: address) - XCTAssertEqual(rpc.endpoint, "chains/main/blocks/head/context/contracts/\(address)/storage") + XCTAssertEqual(rpc.endpoint, "/chains/main/blocks/head/context/contracts/\(address)/storage") XCTAssertNil(rpc.payload) XCTAssertFalse(rpc.isPOSTRequest) } diff --git a/Tests/TezosKit/MichelsonTests.swift b/Tests/TezosKit/MichelsonTests.swift index d7c4f2f2..5936f442 100644 --- a/Tests/TezosKit/MichelsonTests.swift +++ b/Tests/TezosKit/MichelsonTests.swift @@ -50,7 +50,7 @@ final class MichelsonTests: XCTestCase { let date = Date(timeIntervalSince1970: 1_593_453_621) // Monday, June 29, 2020 6:00:21 PM, GMT let michelson = StringMichelsonParameter(date: date) let encoded = JSONUtils.jsonString(for: michelson.networkRepresentation) - XCTAssertEqual(encoded, Helpers.orderJSONString("{\"string\":\"2020-06-29T14:00:21Z\"}")) + XCTAssertEqual(encoded, Helpers.orderJSONString("{\"string\":\"2020-06-29T18:00:21Z\"}")) } func testEncodeStringToJSON() { diff --git a/TezosKit/Michelson/StringMichelsonParameter.swift b/TezosKit/Michelson/StringMichelsonParameter.swift index 9dc4b58e..ab9797e9 100644 --- a/TezosKit/Michelson/StringMichelsonParameter.swift +++ b/TezosKit/Michelson/StringMichelsonParameter.swift @@ -11,7 +11,10 @@ public class StringMichelsonParameter: AbstractMichelsonParameter { public convenience init(date: Date, annotations: [MichelsonAnnotation]? = nil) { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'" + dateFormatter.timeZone = TimeZone(abbreviation: "GMT") + let string = dateFormatter.string(from: date) + self.init(string: string, annotations: annotations) } }