Skip to content

Commit

Permalink
fix: saveAllIssuers doc says it ignores the brand for known keywords
Browse files Browse the repository at this point in the history
fixes: 1785
  • Loading branch information
Chris-Hibbert committed Sep 17, 2020
1 parent 0880f1c commit 88675f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/zoe/src/contractSupport/zoeHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ export async function saveAllIssuers(zcf, issuerKeywordRecord = {}) {
([keyword, issuer]) => {
// If the keyword does not yet exist, add it and the
// associated issuer.
if (issuers.keyword === undefined) {
if (issuers[keyword] === undefined) {
return zcf.saveIssuer(issuer, keyword);
}
return undefined;
Expand Down
4 changes: 1 addition & 3 deletions packages/zoe/test/unitTests/zcf/test-zoeHelpersWZcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ test(`zcf saveAllIssuers - already known`, async t => {
t.is(zcf.getIssuerForBrand(kBrand), kIssuer, 'gelt');
});

test.failing(`zcf saveAllIssuers - duplicate keyword`, async t => {
test(`zcf saveAllIssuers - duplicate keyword`, async t => {
const { zcf } = await setupZCFTest();

const { issuer: pandaIssuer, brand: pandaBrand } = makeIssuerKit('panda');
Expand All @@ -187,8 +187,6 @@ test.failing(`zcf saveAllIssuers - duplicate keyword`, async t => {
MathKind.STRING_SET,
);

// TODO: reusing a keyword is documented to ignore it
// https://github.com/Agoric/agoric-sdk/issues/1785
await t.notThrowsAsync(
() => saveAllIssuers(zcf, { P: pIssuer }),
'second issuer with same keyword should be ignored.',
Expand Down

0 comments on commit 88675f5

Please sign in to comment.