Skip to content

Commit

Permalink
Merge pull request #5712 from Agoric/safe-attestation-check
Browse files Browse the repository at this point in the history
fix(wallet-api): dont rely on attestation brand
  • Loading branch information
mergify[bot] authored Jul 1, 2022
2 parents cafa284 + 447380a commit 9ed4278
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions packages/wallet/api/src/lib-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,6 @@ export function makeWallet({
E(agoricNames)?.lookup('issuer', 'Attestation'),
);

const getAttBrand = makeMemoizedGetter(() => E(getAttIssuer()).getBrand());

/** @type import('@endo/promise-kit').PromiseKit<AttestationTool> */
const attMakerPK = makePromiseKit();

Expand Down Expand Up @@ -670,9 +668,9 @@ export function makeWallet({
keywordPaymentPs.map(async keywordPaymentP => {
// Wait for the withdrawal to complete. This protects against a race
// when updating paymentToPurse.
const [_keyword, payment] = await keywordPaymentP;
const [keyword, payment] = await keywordPaymentP;

if ((await E(payment).getAllegedBrand()) === (await getAttBrand())) {
if (keywordToAttestation.has(keyword)) {
return depositAttestation(payment);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/wallet/api/test/test-lib-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ test('lib-wallet offer methods', async (/** @type {LibWalletTestContext} */ t) =
description: 'getRefund',
handle: {
kind: 'unnamed',
petname: 'unnamed-6',
petname: 'unnamed-7',
},
installation: {
kind: 'unnamed',
Expand All @@ -1024,7 +1024,7 @@ test('lib-wallet offer methods', async (/** @type {LibWalletTestContext} */ t) =
},
inviteHandleBoardId: 'board0257',
meta: {
id: 8,
id: 9,
},
proposalTemplate: {
give: { Contribution: { pursePetname: 'Fun budget', value: 1 } },
Expand Down

0 comments on commit 9ed4278

Please sign in to comment.