Closed fortmarek closed 6 years ago
Hey @fortmarek can you give me more info on the contract function you're trying to call? IE, what does it expect the Data parameter type to be? Its likely because of how we decide how to encode Data into bytes based on length.
I might have fixed the problem with my most recent commit to master, but if not you may have to specify the expected byte length for the parameter much like:
let helloTwoFunctionCall = Function(name: "helloData", parameters: [ABIType.bytes(count: .constrained(8), value: Data("extra".utf8))])
Or if its expecting an unconstrained "bytes" type:
let helloTwoFunctionCall = Function(name: "helloData", parameters: [ABIType.bytes(count: .unlimited, value: Data("extra".utf8))])
Lemme know if either of these work.
Yeah, I have to specify the byte length, but it works, so I think it's OK to close this now.
I have a problem sending
Data
. Other types work, butData
throws this error: "gas required exceeds allowance or always failing transaction"