0

When i am using

req.add("publicKey","any_public_key_here_as_string");

I have 2 steps mentioned in our job specification

decode_cbor  [type=cborparse data="$(decode_log.data)"]
fetch        [type=bridge name="adapter" requestData="{\\"id\\": $(jobSpec.externalJobID), \\"data\\": {\\"publicKey\\": $(decode_cbor.publicKey)}}"]

Result is correct. Result Link

Now, when i am using

req.addBytes("publicKey",abi.encodePacked(any_public_key_here));

Result is Result Image

How to fix the error?

1 Answer 1

0

Chainlink docs for addBytes

the last paragraph for the addbytes method says to use abi.encode(variable) for types other than bytes, such as an address or array.

If that's not the solution then I can only make a guess with so little code and no inclination of the data type you're trying to call encodePacked on or any surrounding syntax but from looking at the json result screenshots, the one that errored out had a value for the public key that was all lowercase like it's failed a checksum test. either addBytes (possibly the chainlink api in general) or encodePacked is failing a checksum test or encodePacked is packing the address into a smaller size than chainlink expects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.