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

Fix FIO amounts in parseAction #833

Merged
merged 3 commits into from
Sep 16, 2024
Merged

Fix FIO amounts in parseAction #833

merged 3 commits into from
Sep 16, 2024

Conversation

peachbits
Copy link
Contributor

@peachbits peachbits commented Sep 12, 2024

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

@peachbits peachbits changed the title Fix FIO amounts in parseAcion Fix FIO amounts in parseAction Sep 12, 2024
networkFee = dataMaxFee
nativeAmount = `-${networkFee}` // Self-transfer should not affect balance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

} else {
networkFee = isRecipient ? `-${fioAmount}` : fioAmount
const isRecipient = data.to === actor
networkFee = isRecipient ? `0` : fioAmount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional change: since networkFee is typically dataMaxFee and these are the exceptions, do the assignment at the beginning with a let so there's less to mentally process per case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny, I purposely kept the initial assignment of networkFee to zero and reassigned it close to nativeAmount to make it easier for myself to understand.

A couple things are going on here:

Consistently set the networkFee and then include that (instead of Fio variables) in nativeAmount calculation. This revealed some amount issues across a few actions. Confirmed with multiple accounts and CSV exports

Remove an existingTx check in trnsfiopubky because those shouldn't have duplicate txids since they are just regular sends. I suspect the only existingTx block used is the unstakefio case but will leave the others
@peachbits peachbits merged commit ff9035d into master Sep 16, 2024
1 of 2 checks passed
@peachbits peachbits deleted the matthew/fioi-stuff branch September 16, 2024 21:27
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

Successfully merging this pull request may close these issues.

2 participants