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

InjectionOperation fails to parse failure result #178

Open
utdrmac opened this issue Jan 18, 2021 · 2 comments
Open

InjectionOperation fails to parse failure result #178

utdrmac opened this issue Jan 18, 2021 · 2 comments

Comments

@utdrmac
Copy link
Contributor

utdrmac commented Jan 18, 2021

Here's the actual result when attempting manually:

curl --verbose -H "content-type: application/json" -X POST --data '"03d7b1a..."' http://127.0.0.1:18732/injection/operation
...
* upload completely sent off: 320 out of 320 bytes
< HTTP/1.1 500 Internal Server Error
< content-length: 106
< content-type: application/json
<
[{"kind":"temporary","id":"failure","msg":"Unknown branch (BKjyVHcJu9yE), cannot inject the operation."}]

When attempting to use client.InjectionOperation(), json.Unmarshal assumes result is string and decode fails

var opstring string

json: cannot unmarshal array into Go value of type string

@utdrmac
Copy link
Contributor Author

utdrmac commented Jan 20, 2021

Another example:

* upload completely sent off: 320 out of 320 bytes
< HTTP/1.1 500 Internal Server Error
< content-length: 259
< content-type: application/json
<
[{"kind":"temporary","id":"failure","msg":"Error while applying operation onhFNDM8v9h6A2p4F5uB1roCBbM2fwcUwxQNcAPYc9rhyuRSnZa:\nbranch refused (Error:\n                  Previously revealed manager key for contract tz1T1ScbsER3x2gex5LDL87uvGx9hwvNg1bq.\n)"}]

@utdrmac
Copy link
Contributor Author

utdrmac commented Jan 23, 2021

client.go:17, regRPCError does not properly match RPC errors:

https://play.golang.org/p/Or8-FeGRK28

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

No branches or pull requests

1 participant