diff --git a/packages/zoe/src/contractFacet/contractFacet.js b/packages/zoe/src/contractFacet/contractFacet.js index 8885edf898b..f0bed9b9699 100644 --- a/packages/zoe/src/contractFacet/contractFacet.js +++ b/packages/zoe/src/contractFacet/contractFacet.js @@ -192,13 +192,21 @@ export function buildRootObject(powers, _params, testJigSetter = undefined) { }; /** @type {MakeZCFMint} */ - const makeZCFMint = async (keyword, amountMathKind = MathKind.NAT) => { + const makeZCFMint = async ( + keyword, + amountMathKind = MathKind.NAT, + displayInfo, + ) => { assert( !(keyword in instanceRecord.terms.issuers), details`Keyword ${keyword} already registered`, ); - const zoeMintP = E(zoeInstanceAdmin).makeZoeMint(keyword, amountMathKind); + const zoeMintP = E(zoeInstanceAdmin).makeZoeMint( + keyword, + amountMathKind, + displayInfo, + ); const { brand: mintyBrand, issuer: mintyIssuer } = await E( zoeMintP, ).getIssuerRecord(); diff --git a/packages/zoe/src/contractFacet/types.js b/packages/zoe/src/contractFacet/types.js index c0a9bb3cebc..93ce0470168 100644 --- a/packages/zoe/src/contractFacet/types.js +++ b/packages/zoe/src/contractFacet/types.js @@ -108,6 +108,7 @@ * @callback MakeZCFMint * @param {Keyword} keyword * @param {AmountMathKind=} amountMathKind + * @param {DisplayInfo=} displayInfo * @returns {Promise} */ diff --git a/packages/zoe/src/internal-types.js b/packages/zoe/src/internal-types.js index dee89ac5887..ada256c9138 100644 --- a/packages/zoe/src/internal-types.js +++ b/packages/zoe/src/internal-types.js @@ -126,6 +126,7 @@ * @callback MakeZoeMint * @param {Keyword} keyword * @param {AmountMathKind=} amountMathKind + * @param {DisplayInfo=} displayInfo * @returns {ZoeMint} */ diff --git a/packages/zoe/src/zoeService/zoe.js b/packages/zoe/src/zoeService/zoe.js index a4c6386b2e9..206652897e0 100644 --- a/packages/zoe/src/zoeService/zoe.js +++ b/packages/zoe/src/zoeService/zoe.js @@ -177,7 +177,11 @@ function makeZoe(vatAdminSvc, zcfBundleName = undefined) { }; /** @type {MakeZoeMint} */ - const makeZoeMint = (keyword, amountMathKind = MathKind.NAT) => { + const makeZoeMint = ( + keyword, + amountMathKind = MathKind.NAT, + displayInfo, + ) => { // Local indicates one that zoe itself makes from vetted code, // and so can be assumed correct and fresh by zoe. const { @@ -185,7 +189,7 @@ function makeZoe(vatAdminSvc, zcfBundleName = undefined) { issuer: localIssuer, amountMath: localAmountMath, brand: localBrand, - } = makeIssuerKit(keyword, amountMathKind); + } = makeIssuerKit(keyword, amountMathKind, displayInfo); const localIssuerRecord = harden({ brand: localBrand, issuer: localIssuer, diff --git a/packages/zoe/test/unitTests/zcf/test-zcf.js b/packages/zoe/test/unitTests/zcf/test-zcf.js index c75036b2f0a..7d7e9f0bfbd 100644 --- a/packages/zoe/test/unitTests/zcf/test-zcf.js +++ b/packages/zoe/test/unitTests/zcf/test-zcf.js @@ -393,6 +393,7 @@ test(`zcf.makeZCFMint - NAT`, async t => { }; await testTerms(t, zcf, expected); t.is(issuerRecord.amountMath.getAmountMathKind(), MathKind.NAT); + t.is(issuerRecord.brand.getDisplayInfo(), undefined); }); test(`zcf.makeZCFMint - STRING_SET`, async t => { @@ -544,6 +545,25 @@ test(`zcf.makeZCFMint - burnLosses - seat exited`, async t => { }); }); +test(`zcf.makeZCFMint - displayInfo`, async t => { + const { zcf } = await setupZCFTest(); + const zcfMint = await zcf.makeZCFMint( + 'A', + MathKind.NAT, + harden({ + decimalPlaces: 3, + }), + ); + const issuerRecord = zcfMint.getIssuerRecord(); + const expected = { + issuers: { A: issuerRecord.issuer }, + brands: { A: issuerRecord.brand }, + maths: { A: issuerRecord.amountMath }, + }; + await testTerms(t, zcf, expected); + t.is(issuerRecord.brand.getDisplayInfo().decimalPlaces, 3); +}); + /** * @param {ZoeService} zoe * @param {ContractFacet} zcf