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

incorrect test in TestJob_ComplicatedTransfer silently failing #451

Open
0rphon opened this issue Oct 20, 2022 · 0 comments
Open

incorrect test in TestJob_ComplicatedTransfer silently failing #451

0rphon opened this issue Oct 20, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@0rphon
Copy link

0rphon commented Oct 20, 2022

Describe the bug
I've been going through the constructor code and it seems like the following action is being populated incorrectly and then silently failing to unmarshal.
https://github.com/coinbase/rosetta-sdk-go/blob/255864dbd02229a03b9d1f209ba112bd59c26211/constructor/worker/worker_test.go#L1012-L1015

To Reproduce
if you put println(types.PrettyPrintStruct(input)) after this block you'll see that it fails to unmarshal the KeyPair but never throws an error.
https://github.com/coinbase/rosetta-sdk-go/blob/255864dbd02229a03b9d1f209ba112bd59c26211/constructor/worker/worker.go#L258-L262

Expected behavior
seeing how this is meant to be a valid test, im assuming everything inside it should unmarshal correctly. and seeing how you have tests to reject invalid json, this should probably be throwing an error too.

Additional context
the actions input after populate_input mutates it:

{"account_identifier": {"address":"test"}, "keypair": {"hex_bytes":"02418b0f5ab5f72219a84ac80704504dbb3c221c2d4f0065c7e4ca93618c472ad7","curve_type":"secp256k1"}}

and the result of its unmarshalling inside the SaveAccountWorker method:

{
 "account_identifier": {
  "address": "test"
 },
 "keypair": {
  "private_key": "",
  "public_key": null
 }
}
@0rphon 0rphon added the bug Something isn't working label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant