-
Notifications
You must be signed in to change notification settings - Fork 19
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
Sponsored Atomic Bridge #104
base: movement
Are you sure you want to change the base?
Conversation
!account::exists_at(recipient) || coin::balance<AptosCoin>(recipient) == 0 | ||
} | ||
|
||
/// Sponsors a recipient by transferring enought Aptos Coint to make the claim to them |
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.
/// Sponsors a recipient by transferring enought Aptos Coint to make the claim to them | |
/// Sponsors a recipient by transferring enought Aptos Coin to make the claim to them |
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.
LGTM; logic makes sense and tests pass locally.
|
||
#[test(aptos_framework = @aptos_framework, third_party = @0xdead)] | ||
/// Test ineligible sponsor | ||
fun test_lock_for_ineligible_sponsor(aptos_framework: &signer, third_party: &signer) acquires BridgeCounterpartyEvents { |
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.
fun test_lock_for_ineligible_sponsor(aptos_framework: &signer, third_party: &signer) acquires BridgeCounterpartyEvents { | |
fun test_lock_for_ineligible_sponsorship(aptos_framework: &signer, third_party: &signer) acquires BridgeCounterpartyEvents { |
This isn't a test of whether a specific sponsor is eligible, but whether a transfer is eligible for sponsorship.
amount | ||
} | ||
|
||
/// Sponsors a recipient by transferring enough Aptos Coin to make the claim to them if they are eligible |
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.
/// Sponsors a recipient by transferring enough Aptos Coin to make the claim to them if they are eligible | |
/// Sponsors a recipient by transferring enough Aptos Coin for them to claim if the transfer is eligible |
|
||
#[test(aptos_framework = @aptos_framework, third_party = @0xdead)] | ||
/// Test eligible sponsor | ||
fun test_lock_for_eligible_sponsor(aptos_framework: &signer, third_party: &signer) acquires BridgeCounterpartyEvents { |
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.
fun test_lock_for_eligible_sponsor(aptos_framework: &signer, third_party: &signer) acquires BridgeCounterpartyEvents { | |
fun test_lock_for_eligible_sponsorship(aptos_framework: &signer, third_party: &signer) acquires BridgeCounterpartyEvents { |
This isn't a test of whether a specific sponsor is eligible, but whether a transfer is eligible for sponsorship.
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.
Agreed
Description
Sponsors bridge transfers somewhat safely:
To test:
movement move test -f sponsor
To be safer, include the sponsorship fee from movementlabsxyz/movement#896. As long as the fee is greater than or equal to sponsored amount, this is safe.
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
Key Areas to Review
Checklist