Skip to content

fix: add option to use transfer_from #14

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

Merged
merged 3 commits into from
Dec 17, 2024
Merged

fix: add option to use transfer_from #14

merged 3 commits into from
Dec 17, 2024

Conversation

Ryang-21
Copy link
Contributor

  • This PR addresses issue Allow transfer_from to be used #5
  • Implemented contract function submit_with_allowance that implements transfers from the user to pool using transfer_from
  • Replaced the transfer function call on the Backstop's donate function to transfer_from

Copy link
Contributor

@mootz12 mootz12 left a comment

Choose a reason for hiding this comment

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

Looks good, 1 missing test case.

Can we also modify 1 of the happy path submit functions to use submit_with_allowance, like Merry's first supply of STABLE?

Comment on lines 189 to 191
#[test]
#[should_panic(expected = "Error(Contract, #9)")]
fn test_submit_use_allowance() {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a happy path transfer_from test that validates tokens are successfully transferred and the allowance is spent?

Then, can we rename this test to specify why it fails - IE test_submit_use_allowance_no_allowance

@Ryang-21 Ryang-21 marked this pull request as ready for review December 17, 2024 17:39
@Ryang-21 Ryang-21 merged commit b3325d1 into main Dec 17, 2024
3 checks passed
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