Skip to content

fix(constructor): use KeyPair instead of PublicKey in test#541

Open
Kubudak90 wants to merge 1 commit into
coinbase:masterfrom
Kubudak90:fix/451-keypair-test
Open

fix(constructor): use KeyPair instead of PublicKey in test#541
Kubudak90 wants to merge 1 commit into
coinbase:masterfrom
Kubudak90:fix/451-keypair-test

Conversation

@Kubudak90

Copy link
Copy Markdown

Description

The test TestJob_ComplicatedTransfer 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, because the JSON fields didn't match the expected struct.

Changes

  • Changed {{key.public_key}} to {{key}} in the SaveAccount action input, since key (from the GenerateKey action) is already a KeyPair.

Bug Details

After populate_input, the action input became:

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

But KeyPair expects:

{"public_key": {"hex_bytes":"...", "curve_type":"..."}, "private_key": "..."}

So unmarshalling silently produced an empty KeyPair with no error.

Fixes #451

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant