fix(constructor): use KeyPair instead of PublicKey in test#541
Open
Kubudak90 wants to merge 1 commit into
Open
fix(constructor): use KeyPair instead of PublicKey in test#541Kubudak90 wants to merge 1 commit into
Kubudak90 wants to merge 1 commit into
Conversation
…atedTransfer
The test was passing {{key.public_key}} (a PublicKey) to the keypair
field, which expects a KeyPair. This caused the KeyPair to silently
unmarshal with empty private_key and nil public_key.
Fixes coinbase#451
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The test
TestJob_ComplicatedTransferwas passing{{key.public_key}}(aPublicKey) to thekeypairfield, which expects aKeyPair. This caused theKeyPairto silently unmarshal with emptyprivate_keyand nilpublic_key, because the JSON fields didn't match the expected struct.Changes
{{key.public_key}}to{{key}}in theSaveAccountaction input, sincekey(from theGenerateKeyaction) is already aKeyPair.Bug Details
After
populate_input, the action input became:{"account_identifier": {"address":"test"}, "keypair": {"hex_bytes":"...", "curve_type":"secp256k1"}}But
KeyPairexpects:{"public_key": {"hex_bytes":"...", "curve_type":"..."}, "private_key": "..."}So unmarshalling silently produced an empty
KeyPairwith no error.Fixes #451