Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backwards Compatibility - Failed to get Transaction Result #666

Open
austinkline opened this issue May 23, 2024 · 5 comments · Fixed by #673
Open

Backwards Compatibility - Failed to get Transaction Result #666

austinkline opened this issue May 23, 2024 · 5 comments · Fixed by #673

Comments

@austinkline
Copy link

Problem

Getting a failure while trying to parse transactions results using the crescendo preview build's backwards compatibility option

failed to get transactions by block id: client: failed to construct flow.TransactionResult entity from protobuf value: ccf convert: ccf: failed to decode: unexpected CBOR type CBOR boolean type as Authorization type"

Steps to Reproduce

This gist reproduces the failure

Acceptance Criteria

This transaction should decode correctly

@peterargue
Copy link
Contributor

Hi @austinkline. the SDK uses CCF encoded events, so your update to use json backwards compatibility mode is not registered. We're looking into how to address this for CCF.

As a temporary workaround, you could use grpc directly to get the tx result, and leave the encoding version flag as its default (jsoncdc)

@austinkline
Copy link
Author

Would there maybe be a way to switch to using JSON encoding instead of ccf temporarily? I'm not in control of that I don't think and am just using standard sdk methods

@peterargue
Copy link
Contributor

it's currently not configurable. it's a simple change to switch it to jsoncdc if you wanted to try creating a custom build as a temporary workaround. just need to remove this line
https://github.com/onflow/flow-go-sdk/blob/master/access/grpc/grpc.go#L383

@peterargue
Copy link
Contributor

@austinkline I just tagged v1.0.0-preview.33 which includes a change to set the encoding.

you can add the following to your client setup

	opts = append(opts, flowGrpc.WithEventEncoding(flow.EventEncodingVersionJSONCDC))

give that a try and let me know how it goes.

@peterargue peterargue reopened this May 30, 2024
@austinkline
Copy link
Author

Amazing! I'll give it a try tomorrow and report back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants