From d848a23a39a3193d3f163838ae5d98670aa58dbc Mon Sep 17 00:00:00 2001 From: James Sangalli Date: Wed, 16 May 2018 18:09:20 +0800 Subject: [PATCH] now reads xml from submodule --- .gitmodules | 6 + Trust.xcodeproj/project.pbxproj | 4 + Trust/Foundation/AssetDefinitionXML.swift | 750 +--------------------- Trust/Foundation/XMLHandler.swift | 5 +- Trust/contracts | 1 + 5 files changed, 20 insertions(+), 746 deletions(-) create mode 100644 .gitmodules create mode 160000 Trust/contracts diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..25f66ac23 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "contracts"] + path = contracts + url = https://github.com/alpha-wallet/contracts.git +[submodule "Trust/contracts"] + path = Trust/contracts + url = https://github.com/alpha-wallet/contracts.git diff --git a/Trust.xcodeproj/project.pbxproj b/Trust.xcodeproj/project.pbxproj index ae76ce570..bc895b85b 100644 --- a/Trust.xcodeproj/project.pbxproj +++ b/Trust.xcodeproj/project.pbxproj @@ -475,6 +475,7 @@ AAEB8DA2204BC7B700CB0B2C /* RedeemTicketsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAEB8DA1204BC7B700CB0B2C /* RedeemTicketsViewController.swift */; }; AAEF2CAB2050A68A0038BE0D /* SignatureHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAEF2CAA2050A68A0038BE0D /* SignatureHelper.swift */; }; B138ABD0208C2C93000FC28A /* MonkeyTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B138ABCF208C2C93000FC28A /* MonkeyTest.swift */; }; + B13E57D720AC324B001719BF /* contracts in Resources */ = {isa = PBXBuildFile; fileRef = B13E57D620AC324B001719BF /* contracts */; }; B1DB1A95207DBF6D00CA2B77 /* XMLHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1DB1A94207DBF6D00CA2B77 /* XMLHandler.swift */; }; B1DB1A97207DCECF00CA2B77 /* AssetDefinitionXML.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1DB1A96207DCECF00CA2B77 /* AssetDefinitionXML.swift */; }; B1DB1A99207DDF9600CA2B77 /* XMLHandlerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1DB1A98207DDF9600CA2B77 /* XMLHandlerTest.swift */; }; @@ -1009,6 +1010,7 @@ AAEF2CAA2050A68A0038BE0D /* SignatureHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignatureHelper.swift; sourceTree = ""; }; B138ABCF208C2C93000FC28A /* MonkeyTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonkeyTest.swift; sourceTree = ""; }; B13A87D3BA5167741E5D0801 /* Pods-Trust.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Trust.release.xcconfig"; path = "Pods/Target Support Files/Pods-Trust/Pods-Trust.release.xcconfig"; sourceTree = ""; }; + B13E57D620AC324B001719BF /* contracts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = contracts; sourceTree = ""; }; B1DB1A94207DBF6D00CA2B77 /* XMLHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XMLHandler.swift; sourceTree = ""; }; B1DB1A96207DCECF00CA2B77 /* AssetDefinitionXML.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetDefinitionXML.swift; sourceTree = ""; }; B1DB1A98207DDF9600CA2B77 /* XMLHandlerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XMLHandlerTest.swift; sourceTree = ""; }; @@ -1155,6 +1157,7 @@ 29A13E311F6B1B6C00E432A2 /* Style */, 2996F14B1F6CA725005C33AE /* Extensions */, 2912CCF81F6A830700C6CBE3 /* AppDelegate.swift */, + B13E57D620AC324B001719BF /* contracts */, 29D72A291F6A8D1500CE9209 /* AppCoordinator.swift */, 293E626E1FA2ED1400CB0A66 /* InCoordinator.swift */, 29850D241F6B27A800791A49 /* R.generated.swift */, @@ -3010,6 +3013,7 @@ 613D04891FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer in Resources */, C887C53A2057B703005ACF81 /* termsOfService.html in Resources */, C876FF7D204A79D300B7D0EA /* SourceSansPro-Bold.otf in Resources */, + B13E57D720AC324B001719BF /* contracts in Resources */, C880330D2054371500D73D6F /* non_asset_catalog_redemption_location@2x.png in Resources */, 29FA00D2201CA79F002F7DC5 /* web3.min.js in Resources */, 771AA966200D5F1900D25403 /* WordCollectionViewCell.xib in Resources */, diff --git a/Trust/Foundation/AssetDefinitionXML.swift b/Trust/Foundation/AssetDefinitionXML.swift index 4337aa470..c4b718b61 100644 --- a/Trust/Foundation/AssetDefinitionXML.swift +++ b/Trust/Foundation/AssetDefinitionXML.swift @@ -7,747 +7,11 @@ import Foundation -// swiftlint:disable:next type_body_length -class AssetDefinitionXML { - private static let xmlInputStream = InputStream(fileAtPath: "./contracts/AssetDefinition.xml") - // swiftlint:disable:this - public static let assetDefinition = "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "yi3sBrV9UTzaB7aDhl/0xPbnPe+YGePWX3aE1pTl0tY=\n" + - "\n" + - "\n" + - "\n" + - "mlwDNqSphXenfoGeJwfum3XTj8NcMxpovL3FZk0JD4q9CzKsOr5cM+buB+aVZKv4gpX/FHnEVqer\n" + - "mnikWTVS7hKohBfRwGadozeJglfx9DGc/x2IQIMQEt67e52HFXEICDLe5tlGMOgi5hzlI6vFKEpK\n" + - "hjPhLxr2T0h2xf+NDc7RdQ==\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "MIIFBzCCBK2gAwIBAgIQKCMFmlBLtxz6L27XkUOsHjAKBggqhkjOPQQDAjCBkDELMAkGA1UEBhMC\n" + - "R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE\n" + - "ChMRQ09NT0RPIENBIExp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gBnOqUP3CYQbNzUTcp6PYB\n" + - "erknuCRR2RFo1KaFpzanpZa6gPim/a5thCCuNXZzQg+HCezF3OeTAyIal+6ailFhp5cmHunudVEI\n" + - "kAWvL54TnJM/ev/m6+loeYyv4Lb67psSE/5FjNJ80zXrIRKT/mZ1JioVhCb3ZsnLjbsJQdQYr7Gz\n" + - "EPUQyp2aDrV1aug=\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\t\n" + - "\t\t
0xDBc5934463Effb93a770C62EfeE4FeaeaF462ede
\n" + - "\t\t
0xD8e5F58DE3933E1E35f9c65eb72cb188674624F3
\n" + - "\t\tБилеты\n" + - "\t\tTickets\n" + - "\t\t\n" + - "\t\tEntradas\n" + - "\t
\n" + - " \n" + - " \n" + - " \n" + - " https://482kdh4npg.execute-api.ap-southeast-1.amazonaws.com/dev/\n" + - " https://app.awallet.io/\n" + - " https://app.awallet.io:80/api/claimToken\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " город\n" + - " City\n" + - " 城市\n" + - " Ciudad\n" + - " \n" + - " \n" + - " Москва́\n" + - " Moscow\n" + - " 莫斯科\n" + - " Moscú\n" + - " \n" + - " \n" + - " Санкт-Петербу́рг\n" + - " Saint Petersburg\n" + - " 圣彼得堡\n" + - " San Petersburgo\n" + - " \n" + - " \n" + - " сочи\n" + - " Sochi\n" + - " 索契\n" + - " Sochi\n" + - " \n" + - " \n" + - " екатеринбург\n" + - " Ekaterinburg\n" + - " 叶卡捷琳堡\n" + - " Ekaterinburg\n" + - " \n" + - " \n" + - " Саранск\n" + - " Saransk\n" + - " 萨兰斯克\n" + - " Saransk\n" + - " \n" + - " \n" + - " казань\n" + - " Kazan\n" + - " 喀山\n" + - " Kazan\n" + - " \n" + - " \n" + - " Нижний Новгород\n" + - " Nizhny Novgorod\n" + - " 下诺夫哥罗德\n" + - " Nizhny Novgorod\n" + - " \n" + - " \n" + - " Ростов-на-Дону\n" + - " Rostov-on-Don\n" + - " 顿河畔罗斯托夫\n" + - " Rostov-on-Don\n" + - " \n" + - " \n" + - " Самара\n" + - " Samara\n" + - " 萨马拉\n" + - " Samara\n" + - " \n" + - " \n" + - " Волгоград\n" + - " Volgograd\n" + - " 伏尔加格勒\n" + - " Volgogrado\n" + - " \n" + - " \n" + - " Калининград\n" + - " Kaliningrad\n" + - " 加里宁格勒\n" + - " Kaliningrad\n" + - " \n" + - " \n" + - " Сидней\n" + - " Sydney\n" + - " 悉尼\n" + - " Sídney\n" + - " \n" + - " \n" + - " Сингапур\n" + - " Singapore\n" + - " 新加坡\n" + - " Singapur\n" + - " \n" + - " \n" + - " Shenzhen\n" + - " 深圳\n" + - " \n" + - "\t\n" + - " Beijing\n" + - " 北京\n" + - " \n" + - "\t\n" + - " Shanghai\n" + - " 上海\n" + - " \n" + - "\t\n" + - " Tokyo\n" + - " 东京\n" + - " \n" + - "\t\n" + - " Seoul\n" + - " 首尔\n" + - " \n" + - "\t\n" + - " Chongqing\n" + - " 重庆\n" + - " \t \n" + - "\t\n" + - " New York\n" + - " 纽约\n" + - " \t \n" + - "\t\n" + - " Melbourne\n" + - " 墨尔本\n" + - " \n" + - "\t\n" + - " Hong Kong\n" + - " 香港\n" + - " \n" + - "\t\n" + - " Chengdu\n" + - " 成都\n" + - " \t \n" + - "\t\n" + - " Kuala Lumpur\n" + - " 吉隆坡\n" + - " \t \n" + - "\t\n" + - " Bangkok\n" + - " 曼谷\n" + - " \t \n" + - "\t\n" + - " San Francisco\n" + - " 三藩市\n" + - " \t \n" + - "\t\n" + - " Las Vegas\n" + - " 拉斯维加斯\n" + - " \t \n" + - "\t\n" + - " London\n" + - " 伦敦\n" + - " \t \n" + - "\t\n" + - " Barcelona\n" + - " 巴塞罗那\n" + - " \t \n" + - "\t\n" + - " Madrid\n" + - " 马德里\n" + - " \n" + - "\t\n" + - " Zug\n" + - " 楚格\n" + - " \t \n" + - "\t\n" + - " Paris\n" + - " 巴黎\n" + - " \t \n" + - "\t\n" + - " Dubai\n" + - " 迪拜\n" + - " \n" + - "\t\n" + - " TBC\n" + - " 待定\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " место встречи\n" + - " Venue\n" + - " 场馆\n" + - " Lugar\n" + - " \n" + - " \n" + - " Стадион Калининград\n" + - " Kaliningrad Stadium\n" + - " 加里宁格勒体育场\n" + - " Estadio de Kaliningrado\n" + - " \n" + - " \n" + - " Екатеринбург Арена\n" + - " Volgograd Arena\n" + - " 伏尔加格勒体育场\n" + - " Volgogrado Arena\n" + - " \n" + - " \n" + - " Казань Арена\n" + - " Ekaterinburg Arena\n" + - " 加里宁格勒体育场\n" + - " Ekaterimburgo Arena\n" + - " \n" + - " \n" + - " Мордовия Арена\n" + - " Fisht Stadium\n" + - " 费什体育场\n" + - " Estadio Fisht\n" + - " \n" + - " \n" + - " Ростов Арена\n" + - " Kazan Arena\n" + - " 喀山体育场\n" + - " Kazan Arena\n" + - " \n" + - " \n" + - " Самара Арена\n" + - " Nizhny Novgorod Stadium\n" + - " 下诺夫哥罗德体育场\n" + - " Estadio de Nizhni Novgorod\n" + - " \n" + - " \n" + - " Стадион Калининград\n" + - " Luzhniki Stadium\n" + - " 卢日尼基体育场\n" + - " Estadio Luzhniki\n" + - " \n" + - " \n" + - " Стадион Лужники\n" + - " Samara Arena\n" + - " 萨马拉体育场\n" + - " Samara Arena\n" + - " \n" + - " \n" + - " Стадион Нижний Новгород\n" + - " Rostov Arena\n" + - " 罗斯托夫体育场\n" + - " Rostov Arena\n" + - " \n" + - " \n" + - " Стадион Спартак\n" + - " Spartak Stadium\n" + - " 斯巴达克体育场\n" + - " Estadio del Spartak\n" + - " \n" + - " \n" + - " Стадион Санкт-Петербург\n" + - " Saint Petersburg Stadium\n" + - " 圣彼得堡体育场\n" + - " Estadio de San Petersburgo\n" + - " \n" + - " \n" + - " Стадион Фишт\n" + - " Mordovia Arena\n" + - " 莫多维亚体育场\n" + - " Mordovia Arena\n" + - " \n" + - " \n" + - "\t UNSW Michael Crouch Innovation Center\t\n" + - " UNSW Michael Crouch Innovation Center\n" + - " 新南威尔大学Michael Crouch创新中心\n" + - " Centro de Innovación de Michael Crouch UNSW\n" + - " \n" + - "\t \n" + - "\t FOUR SEASONS HOTEL SHENZHEN\t \n" + - " FOUR SEASONS HOTEL SHENZHEN\n" + - " 深圳四季酒店\n" + - " FOUR SEASONS HOTEL SHENZHEN\n" + - " \n" + - "\t \n" + - "\t Paypal Innovation Lab\t\t \n" + - " Paypal Innovation Lab\n" + - " Paypal Innovation Lab\n" + - " Paypal Innovation Lab\n" + - " \n" + - "\t \n" + - "\t The Centrepoint\t \n" + - " The Centrepoint\n" + - " The Centrepoint\n" + - " The Centrepoint\n" + - " \n" + - "\t \n" + - "\t The Centrepoint\t \n" + - " TBC\n" + - " 待定\n" + - " Por determinar\n" + - " \n" + - "\t \n" + - "\t thebridge\t \n" + - " thebridge\n" + - " thebridge\n" + - " thebridge\n" + - " \n" + - "\t \n" + - "\t BASH\t \n" + - " BASH\n" + - " BASH\n" + - " BASH\n" + - " \n" + - "\t \n" + - "\t Spacemob\t \n" + - " Spacemob\n" + - " Spacemob\n" + - " Spacemob\n" + - " \n" + - "\t \n" + - "\t 32 Carpenter Street\n" + - " 32 Carpenter Street\n" + - " 32 Carpenter Street\n" + - " 32 Carpenter Street\n" + - " \n" + - "\t \n" + - "\t Block 71\t \n" + - " Block 71\n" + - " Block 71\n" + - " Block 71\n" + - " \n" + - "\t \n" + - "\t Microsoft Singapore\n" + - " Microsoft Singapore\n" + - " Microsoft Singapore\n" + - " Microsoft Singapore\n" + - " \n" + - "\t \n" + - "\t Google Singapore\t \n" + - " Google Singapore\n" + - " Google Singapore\n" + - " Google Singapore\n" + - " \t \n" + - "\t \n" + - "\t The Blockchain Hub\t \n" + - " The Blockchain Hub\n" + - " The Blockchain Hub\n" + - " The Blockchain Hub\n" + - " \t \n" + - "\t \n" + - "\t BitTemple\t \n" + - " BitTemple\n" + - " BitTemple\n" + - " BitTemple\n" + - " \n" + - "\t \n" + - "\t ADD BLOCKCHAIN STUDIO\t \n" + - " ADD BLOCKCHAIN STUDIO\n" + - " ADD BLOCKCHAIN STUDIO\n" + - " ADD BLOCKCHAIN STUDIO\n" + - " \n" + - "\t \n" + - "\t Rosewood Beijing\t \n" + - " Rosewood Beijing\n" + - " 北京瑰丽酒店\n" + - " Rosewood Beijing\n" + - " \n" + - "\t \n" + - "\t Stratum\n" + - " Stratum\n" + - " Stratum\n" + - " Stratum\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " время\n" + - " Time\n" + - " 时间\n" + - " Tiempo\n" + - " \n" + - " \n" + - " \n" + - " Team A\n" + - " 甲队\n" + - " Equipo A\n" + - " \n" + - " \n" + - " Team B\n" + - " 乙队\n" + - " Equipo B\n" + - " \n" + - " \n" + - " Match\n" + - " 场次\n" + - " Evento\n" + - " \n" + - " \n" + - " Cat\n" + - " 等级\n" + - " Cat\n" + - " \n" + - " \n" + - "\t Category 1\n" + - " Category 1\n" + - " 一类票\n" + - "\t Category 1\n" + - " \n" + - " \n" + - "\t Category 2\n" + - " Category 2\n" + - " 二类票\n" + - "\t Category 2\n" + - " \n" + - "\t \n" + - "\t Category 3\n" + - " Category 3\n" + - " 三类票\n" + - "\t Category 3 \t \n" + - " \n" + - "\t \n" + - "\t Category 4\t \n" + - " Category 4\n" + - " 四类票\n" + - "\t Category 4\t \n" + - " \n" + - " \n" + - "\t Match Club\t\n" + - " Match Club\n" + - " 俱乐部坐席\n" + - "\t Match Club\t\n" + - " \n" + - "\t\n" + - "\t\tMatch House Premier\n" + - "\t\tMatch House Premier\n" + - "\t\t比赛之家坐席\n" + - "\t\tMatch House Premier\n" + - "\t\n" + - "\t \n" + - " MATCH PAVILION\n" + - " MATCH PAVILION\n" + - " 款待大厅坐席\n" + - " \t MATCH PAVILION\n" + - " \n" + - "\t \n" + - "\t MATCH BUSINESS SEAT\t \n" + - " MATCH BUSINESS SEAT\n" + - " 商务坐席\n" + - "\t MATCH BUSINESS SEAT\t \n" + - " \n" + - "\t \n" + - "\t MATCH SHARED SUITE\n" + - " MATCH SHARED SUITE\n" + - " 公共包厢\n" + - "\t MATCH SHARED SUITE\t \n" + - " \n" + - "\t \n" + - " TSARSKY LOUNGE\n" + - " TSARSKY LOUNGE\n" + - " 特拉斯基豪华包厢\n" + - "\t TSARSKY LOUNGE\t \n" + - " \n" + - "\t \n" + - "\t MATCH PRIVATE SUITE\t\t \n" + - " MATCH PRIVATE SUITE\n" + - " 私人包厢\n" + - "\t MATCH PRIVATE SUITE\n" + - " \n" + - " \n" + - " \n" + - "\t Singapore Blockchain Event\n" + - " Singapore Blockchain Event\n" + - " 新加坡区块链活动\n" + - "\t Singapore Blockchain Event\n" + - " \n" + - "\t\n" + - "\t Singapore Blockchain Event\t\n" + - " TECHNOLOGY RADAR SUMMIT 2018\n" + - " 技术雷达峰会2018\n" + - "\t Singapore Blockchain Event\t\n" + - " \n" + - "\t \n" + - " Sydney Blockchain Event\n" + - " Sydney Blockchain Event\n" + - " 悉尼区块链活动\n" + - "\t Sydney Blockchain Event\t \n" + - " \n" + - "\t \n" + - " Beijing Blockchain Event\n" + - " Beijing Blockchain Event\n" + - " 北京区块链活动\n" + - " Beijing Blockchain Event\n" + - " \n" + - "\t \n" + - " Shanghai Blockchain Event\n" + - " Shanghai Blockchain Event\n" + - " 上海区块链活动\n" + - " Shanghai Blockchain Event\n" + - " \n" + - "\t \n" + - " Tokyo Blockchain Event\n" + - " Tokyo Blockchain Event\n" + - " 东京区块链活动\n" + - " Tokyo Blockchain Event\n" + - " \n" + - "\t \n" + - "\t Blockchain Event\n" + - " Blockchain Event\n" + - " 区块链活动\n" + - "\t Blockchain Event\n" + - " \n" + - "\t \n" + - " Other Events\n" + - " Other Events\n" + - " 其他活动\n" + - "\t Other Events\t \n" + - " \n" + - "\t \n" + - " Seoul Blockchain Event\n" + - " Seoul Blockchain Event\n" + - " 首尔区块链活动\n" + - " Seoul Blockchain Event\n" + - " \n" + - "\t \n" + - " Bangkok Blockchain Event\n" + - " Bangkok Blockchain Event\n" + - " 曼谷区块链活动\n" + - " Bangkok Blockchain Event\n" + - " \n" + - "\t \n" + - " AlphaWallet Event\n" + - " AlphaWallet Event\n" + - " AlphaWallet活动\n" + - " AlphaWallet Event\n" + - " \n" + - "\t \n" + - "\t Stormbird Event\t \n" + - " Stormbird Event\n" + - " Stormbird活动\n" + - "\t Stormbird Event\t \n" + - " \n" + - "\t \n" + - " UNITY VENTURES Event\n" + - " UNITY VENTURES Event\n" + - " 九合创投活动\n" + - " UNITY VENTURES Event\n" + - " \n" + - "\t \n" + - "\t Max's Event\t \n" + - " Max's Event\n" + - " Max的活动\n" + - " Max's Event\n" + - " \n" + - "\t \n" + - " Chongqing Blockchain Event\n" + - " Chongqing Blockchain Event\n" + - " 重庆区块链活动\n" + - " Chongqing Blockchain Event\n" + - " \n" + - "\t \n" + - " Dubai Blockchain Event\n" + - " Dubai Blockchain Event\n" + - " 迪拜区块链活动\n" + - "\t Dubai Blockchain Event\t \n" + - " \n" + - "\t \n" + - " Silicon Valley Blockchain Event\n" + - " Silicon Valley Blockchain Event\n" + - " 硅谷区块链活动\n" + - " Silicon Valley Blockchain Event\n" + - " \n" + - "\t \n" + - " Melbourne Blockchain Event\n" + - " Melbourne Blockchain Event\n" + - " 墨尔本区块链活动\n" + - "\t Melbourne Blockchain Event\n" + - " \n" + - "\t \n" + - " General Event\n" + - " General Event\n" + - " 通用活动\n" + - "\t General Event\t \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
\n" +public class AssetDefinitionXML { + public var assetDefinitionString = "" + init() { + if let path = Bundle.main.path(forResource: "TicketingContract", ofType: "xml", inDirectory: "contracts") { + assetDefinitionString = try! String(contentsOf: URL(string: "file://" + path)!) + } + } } diff --git a/Trust/Foundation/XMLHandler.swift b/Trust/Foundation/XMLHandler.swift index ad3ad6cef..72c48e8b2 100644 --- a/Trust/Foundation/XMLHandler.swift +++ b/Trust/Foundation/XMLHandler.swift @@ -12,10 +12,9 @@ import TrustKeystore public class XMLHandler { - private let xml = try! XML.parse(AssetDefinitionXML.assetDefinition) + private let xml = try! XML.parse(AssetDefinitionXML().assetDefinitionString) - private func formatDateToMoscow(_ timestamp: Int) -> Date - { + private func formatDateToMoscow(_ timestamp: Int) -> Date { let formatter = DateFormatter() formatter.timeZone = TimeZone(secondsFromGMT: 10800) formatter.dateFormat = "dd/MM/yyyy hh:mm:ss a" diff --git a/Trust/contracts b/Trust/contracts new file mode 160000 index 000000000..8d94e2598 --- /dev/null +++ b/Trust/contracts @@ -0,0 +1 @@ +Subproject commit 8d94e25982de7fcd91d5a34acc7b26168ac5390b