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

[Feature] Add transfer_public_as_signer to credits.aleo #2402

Merged
merged 12 commits into from
Mar 22, 2024

Conversation

d0cd
Copy link
Contributor

@d0cd d0cd commented Mar 21, 2024

Motivation

This PR adds the transfer_public_as_signer function to credits.aleo. This function allows developers to write programs that interface with credits.aleo and transfer public credits through the written programs.

Test Plan

Additional tests were added checking that:

  • transfer_public_from_user
  • transfer_public_from_program
  • transfer_public_as_signer_from_user
  • transfer_public_as_signer_from_program

Related PRs

Closes #2139

// Update the VM.
vm.add_next_block(&block).unwrap();

// Check the balance of the caller, which should be the same as before.
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the balance of the caller did decrease, you assert it to be 182_499_997_483_583 above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good catch, it should decrease because the caller pays the fee.

@d0cd d0cd requested a review from vicsn March 22, 2024 19:07
@howardwu howardwu merged commit b924170 into mainnet-staging Mar 22, 2024
78 of 80 checks passed
@howardwu howardwu deleted the feat/transfer_public_as_signer branch March 22, 2024 20:34
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.

[Feature] Support transfer public credits from self.signer
3 participants