mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-30 10:30:22 +00:00
fix stuff
This commit is contained in:
@@ -115,13 +115,19 @@ CredentialAccept::doApply()
|
||||
}
|
||||
|
||||
sleCred->setFieldU32(sfFlags, lsfAccepted);
|
||||
view().update(sleCred);
|
||||
|
||||
auto txSponsorSle = getTxReserveSponsor(ctx_.getApplyViewContext());
|
||||
if (!txSponsorSle)
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// Release the original creation sponsor from the credential (it covered
|
||||
// the issuer's reserve), then assign the accept tx's sponsor (if any) so
|
||||
// the credential reflects whoever is now covering the subject's reserve.
|
||||
decreaseOwnerCountForObject(view(), sleIssuer, sleCred, 1, j_);
|
||||
removeSponsorFromLedgerEntry(sleCred);
|
||||
addSponsorToLedgerEntry(sleCred, *txSponsorSle);
|
||||
increaseOwnerCount(view(), sleSubject, *txSponsorSle, 1, j_);
|
||||
view().update(sleCred);
|
||||
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
@@ -2882,15 +2882,15 @@ public:
|
||||
BEAST_EXPECT(ownerCount(env, bob) == 0);
|
||||
BEAST_EXPECT(sponsoredOwnerCount(env, bob) == 0);
|
||||
|
||||
// Bob accepts: ownership and sponsorship transfer to bob
|
||||
// Bob accepts: issuer's sponsorship ends, bob becomes unsponsored owner
|
||||
env(credentials::accept(bob, alice, credType));
|
||||
env.close();
|
||||
|
||||
BEAST_EXPECT(ownerCount(env, alice) == 0);
|
||||
BEAST_EXPECT(sponsoredOwnerCount(env, alice) == 0);
|
||||
BEAST_EXPECT(sponsoringOwnerCount(env, sponsor) == 1); // still sponsoring, but now bob
|
||||
BEAST_EXPECT(sponsoringOwnerCount(env, sponsor) == 0); // original sponsorship ended
|
||||
BEAST_EXPECT(ownerCount(env, bob) == 1);
|
||||
BEAST_EXPECT(sponsoredOwnerCount(env, bob) == 1);
|
||||
BEAST_EXPECT(sponsoredOwnerCount(env, bob) == 0); // bob owns it without a sponsor
|
||||
|
||||
// CredentialDelete by subject
|
||||
env(credentials::deleteCred(bob, bob, alice, credType));
|
||||
|
||||
Reference in New Issue
Block a user