-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Aptos Framework] Add batch versions of aptos_coin::transfer and transfer_coins #5895
Conversation
@@ -40,6 +40,18 @@ module aptos_framework::aptos_account { | |||
coin::register<AptosCoin>(&signer); | |||
} | |||
|
|||
/// Batch version of APT transfer. | |||
public entry fun batch_transfer(source: &signer, recipients: vector<address>, amounts: vector<u64>) { | |||
let i = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to assert the vector lengths are the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. It is better to fail explicitly rather than discarding the extra amounts.
313306e
to
24bd754
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty straightforward but do we want to add some simple unit test just to make sure that this works as expected?
24bd754
to
bc77b05
Compare
bc77b05
to
a72388c
Compare
Added |
); | ||
|
||
let i = 0; | ||
let len = vector::length(&recipients); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can save one length()
if move this line up before line 75.
No description provided.