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

[Bug]: Transfers & governance initiated transfers are presented inconsistently on the API #11336

Closed
1 task
JonRay15 opened this issue May 31, 2024 · 0 comments · Fixed by #11343
Closed
1 task
Assignees
Labels
bug fe-request A list of reasonably high value API change requests from front end

Comments

@JonRay15
Copy link

JonRay15 commented May 31, 2024

Problem encountered

On a transfer on the transfers API the "amount" is the initial amount set up by the user.

I would expect that the same behaviour would be observed on governance initiated transfers but it is not.

Observed behaviour

On the governance transfer the below calculation is done.

transfer_amount = min(
    proposal.fraction_of_balance * source.balance,
    proposal.amount,
    NETWORK_MAX_AMOUNT,
    NETWORK_MAX_FRACTION * source.balance
)
where
NETWORK_MAX_AMOUNT is a network parameter specifying the maximum absolute amount that can be transferred by governance for the source account type
NETWORK_MAX_FRACTION is a network parameter specifying the maximum fraction of the balance that can be transferred by governance for the source account type (must be <= 1)
If type is "all or nothing" then the transfer will only proceed if:
    transfer_amount == min(proposal.fraction_of_balance * source.balance,proposal.amount).

Expected behaviour

I would expect that both types of transfer are presented in exactly the same way ... however right now neither one is ideal to be honest.

  • The "amount" should be the initial amount set by the user when setting up the transfer or governance transfer so should be taken from the transfer transaction or the governance proposal directly

Steps to reproduce

1. Submit `xyz` transaction
4. With this payload
5. Query `abc` API
6. Observe the error

Software version

0.76

Failing test

No response

Jenkins run

No response

Configuration used

No response

Relevant log output

No response

@JonRay15 JonRay15 added bug fe-request A list of reasonably high value API change requests from front end labels May 31, 2024
@ze97286 ze97286 self-assigned this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fe-request A list of reasonably high value API change requests from front end
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants