Skip to content

Commit 0ba7039

Browse files
chore: error messages updated
1 parent 01e1f6a commit 0ba7039

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/Web3Core/Contract/ContractProtocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ extension DefaultContractProtocol {
349349
throw Web3Error.inputError(desc: "Make sure ABI you use contains error that can match signature: 0x\(selector.toHexString())")
350350
}
351351
default:
352-
throw Web3Error.inputError(desc: "Invalid data count")
352+
throw Web3Error.inputError(desc: "Given data has invalid bytes count.")
353353
}
354354
}
355355

@@ -388,7 +388,7 @@ extension DefaultContractProtocol {
388388
@discardableResult
389389
public func callStatic(_ method: String, parameters: [Any], provider: Web3Provider) async throws -> [String: Any] {
390390
guard let address = address else {
391-
throw Web3Error.inputError(desc: "address field is missing")
391+
throw Web3Error.inputError(desc: "RPC failed: contract is missing an address.")
392392
}
393393
guard let data = self.method(method, parameters: parameters, extraData: nil) else {
394394
throw Web3Error.dataError

Tests/web3swiftTests/localTests/String+ExtensionTests.swift.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class StringExtensionsTest: XCTestCase {
2525
XCTAssertFalse("xyz".isHex)
2626
XCTAssertFalse("0xCAFEQ".isHex)
2727
XCTAssertFalse("R0123456789abcdefABCDEF ".isHex)
28-
XCTAssertFalse(" R0123456789abcdefABCDEFT ".isHex)
28+
XCTAssertFalse(" R0123456789abcdefABCDEF ".isHex)
2929
}
3030

3131
}

0 commit comments

Comments
 (0)