Skip to content

Commit

Permalink
chore: error messages updated
Browse files Browse the repository at this point in the history
  • Loading branch information
JeneaVranceanu committed Nov 26, 2023
1 parent 01e1f6a commit 0ba7039
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/Web3Core/Contract/ContractProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ extension DefaultContractProtocol {
throw Web3Error.inputError(desc: "Make sure ABI you use contains error that can match signature: 0x\(selector.toHexString())")
}
default:
throw Web3Error.inputError(desc: "Invalid data count")
throw Web3Error.inputError(desc: "Given data has invalid bytes count.")
}
}

Expand Down Expand Up @@ -388,7 +388,7 @@ extension DefaultContractProtocol {
@discardableResult
public func callStatic(_ method: String, parameters: [Any], provider: Web3Provider) async throws -> [String: Any] {
guard let address = address else {
throw Web3Error.inputError(desc: "address field is missing")
throw Web3Error.inputError(desc: "RPC failed: contract is missing an address.")
}
guard let data = self.method(method, parameters: parameters, extraData: nil) else {
throw Web3Error.dataError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class StringExtensionsTest: XCTestCase {
XCTAssertFalse("xyz".isHex)
XCTAssertFalse("0xCAFEQ".isHex)
XCTAssertFalse("R0123456789abcdefABCDEF ".isHex)
XCTAssertFalse(" R0123456789abcdefABCDEFT ".isHex)
XCTAssertFalse(" R0123456789abcdefABCDEF ".isHex)
}

}

0 comments on commit 0ba7039

Please sign in to comment.