diff --git a/Example/Tests/Methods/SendTransactionTests.swift b/Example/Tests/Methods/SendTransactionTests.swift index 84ec4d1..572931f 100644 --- a/Example/Tests/Methods/SendTransactionTests.swift +++ b/Example/Tests/Methods/SendTransactionTests.swift @@ -11,7 +11,8 @@ import XCTest import BigInt class SendTransactionTests: XCTestCase { - + + let platform = "sdk_ios" var mockUIApplication: MockUIApplication! override func setUp() { @@ -52,7 +53,8 @@ class SendTransactionTests: XCTestCase { URLQueryItem(name: .from, value: from), URLQueryItem(name: .to, value: to), URLQueryItem(name: .value, value: "0x7b"), - URLQueryItem(name: .data, value: "0x" + dataString) + URLQueryItem(name: .data, value: "0x" + dataString), + URLQueryItem(name: .platform, value: platform) ] // When: diff --git a/Example/Tests/URLEncode/EVMBaseMethodURLEncodeTests.swift b/Example/Tests/URLEncode/EVMBaseMethodURLEncodeTests.swift index 3976227..dc8b016 100644 --- a/Example/Tests/URLEncode/EVMBaseMethodURLEncodeTests.swift +++ b/Example/Tests/URLEncode/EVMBaseMethodURLEncodeTests.swift @@ -13,6 +13,7 @@ import BigInt // swiftlint:disable type_body_length class EVMBaseMethodURLEncodeTests: XCTestCase { + let platform = "sdk_ios" func testURLComponent() throws { // Given: let item = URLQueryItem(name: .accountProof, value: "123 456 % 1") @@ -38,7 +39,8 @@ class EVMBaseMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .appId, value: appId), URLQueryItem(name: .requestId, value: requestId.uuidString), URLQueryItem(name: .blockchain, value: Blockchain.ethereum.rawValue), - URLQueryItem(name: .method, value: MethodName.requestAccount.rawValue) + URLQueryItem(name: .method, value: MethodName.requestAccount.rawValue), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -74,7 +76,8 @@ class EVMBaseMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .method, value: EVMBaseMethodType.signMessage.rawValue), URLQueryItem(name: .signType, value: EVMBaseSignType.sign.rawValue), URLQueryItem(name: .from, value: ethereumAddress), - URLQueryItem(name: .message, value: message) + URLQueryItem(name: .message, value: message), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -110,7 +113,8 @@ class EVMBaseMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .method, value: EVMBaseMethodType.signMessage.rawValue), URLQueryItem(name: .signType, value: EVMBaseSignType.personalSign.rawValue), URLQueryItem(name: .from, value: ethereumAddress), - URLQueryItem(name: .message, value: message) + URLQueryItem(name: .message, value: message), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -211,7 +215,8 @@ class EVMBaseMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .method, value: EVMBaseMethodType.signMessage.rawValue), URLQueryItem(name: .signType, value: EVMBaseSignType.typedSignV3.rawValue), URLQueryItem(name: .from, value: ethereumAddress), - URLQueryItem(name: .message, value: message) + URLQueryItem(name: .message, value: message), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -331,7 +336,8 @@ class EVMBaseMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .method, value: EVMBaseMethodType.signMessage.rawValue), URLQueryItem(name: .signType, value: EVMBaseSignType.typedSignV4.rawValue), URLQueryItem(name: .from, value: ethereumAddress), - URLQueryItem(name: .message, value: message) + URLQueryItem(name: .message, value: message), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -370,7 +376,8 @@ class EVMBaseMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .from, value: ethereumAddress), URLQueryItem(name: .to, value: to), URLQueryItem(name: .value, value: "0x0"), - URLQueryItem(name: .data, value: "0x" + dataString) + URLQueryItem(name: .data, value: "0x" + dataString), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -409,7 +416,8 @@ class EVMBaseMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .from, value: ethereumAddress), URLQueryItem(name: .to, value: to), URLQueryItem(name: .value, value: "0x100"), - URLQueryItem(name: .data, value: "0x" + dataString) + URLQueryItem(name: .data, value: "0x" + dataString), + URLQueryItem(name: .platform, value: platform) ] // When: diff --git a/Example/Tests/URLEncode/FlowMethodURLEncodeTests.swift b/Example/Tests/URLEncode/FlowMethodURLEncodeTests.swift index 19afb87..094863d 100644 --- a/Example/Tests/URLEncode/FlowMethodURLEncodeTests.swift +++ b/Example/Tests/URLEncode/FlowMethodURLEncodeTests.swift @@ -12,7 +12,8 @@ import FlowSDK @testable import BloctoSDK final class FlowMethodURLEncodeTests: XCTestCase { - + + let platform = "sdk_ios" func testFlowRequestAccount() throws { // Given: let requestId = UUID() @@ -27,6 +28,7 @@ final class FlowMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .requestId, value: requestId.uuidString), URLQueryItem(name: .blockchain, value: Blockchain.flow.rawValue), URLQueryItem(name: .method, value: MethodName.requestAccount.rawValue), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -53,6 +55,7 @@ final class FlowMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .requestId, value: requestId.uuidString), URLQueryItem(name: .blockchain, value: Blockchain.flow.rawValue), URLQueryItem(name: .method, value: FlowMethodType.authenticate.rawValue), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -84,6 +87,7 @@ final class FlowMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .method, value: FlowMethodType.authenticate.rawValue), URLQueryItem(name: .flowAppId, value: appId), URLQueryItem(name: .flowNonce, value: nonce), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -120,6 +124,7 @@ final class FlowMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .method, value: FlowMethodType.userSignature.rawValue), URLQueryItem(name: .from, value: address), URLQueryItem(name: .message, value: message), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -173,6 +178,7 @@ final class FlowMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .method, value: FlowMethodType.sendTransaction.rawValue), URLQueryItem(name: .from, value: addressString), URLQueryItem(name: .flowTransaction, value: transactionDataHex), + URLQueryItem(name: .platform, value: platform) ] // When: diff --git a/Example/Tests/URLEncode/SolanaMethodURLEncodeTests.swift b/Example/Tests/URLEncode/SolanaMethodURLEncodeTests.swift index 16448f6..e66b30e 100644 --- a/Example/Tests/URLEncode/SolanaMethodURLEncodeTests.swift +++ b/Example/Tests/URLEncode/SolanaMethodURLEncodeTests.swift @@ -11,6 +11,7 @@ import XCTest class SolanaMethodURLEncodeTests: XCTestCase { + let platform = "sdk_ios" func testSolanaRequestAccount() throws { // Given: let requestId = UUID() @@ -23,7 +24,8 @@ class SolanaMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .appId, value: appId), URLQueryItem(name: .requestId, value: requestId.uuidString), URLQueryItem(name: .blockchain, value: Blockchain.solana.rawValue), - URLQueryItem(name: .method, value: MethodName.requestAccount.rawValue) + URLQueryItem(name: .method, value: MethodName.requestAccount.rawValue), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -61,7 +63,8 @@ class SolanaMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .method, value: SolanaMethodType.signAndSendTransaction.rawValue), URLQueryItem(name: .from, value: solanaAddress), URLQueryItem(name: .isInvokeWrapped, value: "true"), - URLQueryItem(name: .message, value: messageHex) + URLQueryItem(name: .message, value: messageHex), + URLQueryItem(name: .platform, value: platform) ] // When: @@ -117,7 +120,8 @@ class SolanaMethodURLEncodeTests: XCTestCase { URLQueryItem(name: .message, value: messageHex), URLQueryItem(name: "\(QueryName.appendTx.rawValue)[\(appendTxKey1)]", value: appendTxValue1), URLQueryItem(name: "\(QueryName.appendTx.rawValue)[\(appendTxKey2)]", value: appendTxValue2), - URLQueryItem(name: "\(QueryName.publicKeySignaturePairs.rawValue)[\(publicKey)]", value: signature) + URLQueryItem(name: "\(QueryName.publicKeySignaturePairs.rawValue)[\(publicKey)]", value: signature), + URLQueryItem(name: .platform, value: platform) ] // When: