Skip to content

fix: correct SaveAccount input in TestJob_ComplicatedTransfer#535

Open
Kubudak90 wants to merge 1 commit into
coinbase:masterfrom
Kubudak90:fix-saveaccount-test
Open

fix: correct SaveAccount input in TestJob_ComplicatedTransfer#535
Kubudak90 wants to merge 1 commit into
coinbase:masterfrom
Kubudak90:fix-saveaccount-test

Conversation

@Kubudak90

Copy link
Copy Markdown

Description

Fixes #451

The test TestJob_ComplicatedTransfer was incorrectly passing {{key.public_key}} (a *types.PublicKey) where {{key}} (a *keys.KeyPair) was expected by SaveAccountInput.

The Bug

SaveAccountInput expects:

type SaveAccountInput struct {
    AccountIdentifier *types.AccountIdentifier `json:"account_identifier"`
    KeyPair           *keys.KeyPair            `json:"keypair"`
}

But the test was providing only the public key:

Input: `{"account_identifier": {{account.account_identifier}}, "keypair": {{key.public_key}}}`,

This caused silent JSON unmarshalling failures where the KeyPair field was populated with empty values instead of the actual key data, as described in #451.

The Fix

Changed {{key.public_key}} to {{key}} to pass the full KeyPair that GenerateKey stored in the variable.

Verification

This is a one-line test fix that corrects the input data to match the expected type. The test was previously silently failing - now it will properly validate the SaveAccount functionality.

Type of Change

  • Bug fix (test correction)

Testing

  • The existing test TestJob_ComplicatedTransfer will now properly validate SaveAccount behavior instead of silently failing during JSON unmarshalling.

The test was incorrectly passing {{key.public_key}} (a *types.PublicKey)
where {{key}} (a *keys.KeyPair) was expected by SaveAccountInput.

This caused silent JSON unmarshalling failures where the KeyPair field
was populated with empty values instead of the actual key data.

Fixes coinbase#451
@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

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.

incorrect test in TestJob_ComplicatedTransfer silently failing

2 participants