Error : 'no ordinal for "[Alleged: Dummy brand]"' #7228
-
Greetings, Thank you in advance :) Error being solved:While trying to make an offer, the following error is returned:
ContextContract: import { Far } from '@endo/marshal';
import { M } from '@agoric/vat-data';
import { AmountShape } from '@agoric/ertp';
const start = async (zcf) => {
const { zcfSeat } = zcf.makeEmptySeatKit();
const dummyHook = (userSeat) => {
const { give: {In: givenAmount }} = userSeat.getProposal();
zcfSeat.incrementBy(userSeat.decrementBy(harden({ In: givenAmount })));
zcf.reallocate(zcfSeat, userSeat);
userSeat.exit();
return 'Sucess';
};
const makeDummyInvitation = () => {
return zcf.makeInvitation(
dummyHook,
'dummy',
undefined,
M.splitRecord({
give: { In: AmountShape },
}),
);
};
const creatorFacet = Far('creatorFacet', {
makeDummyInvitation,
});
return { creatorFacet };
};
harden(start);
export { start }; Test Setup: export const setUpDummy = async (zoe) => {
const sourceRoot = '../src/dummyContract.js';
const contractUrl = await importMetaResolve(sourceRoot, import.meta.url);
const contractPath = new URL(contractUrl).pathname;
const contractBundle = await bundleSource(contractPath);
const installation = await E(zoe).install(contractBundle);
const { creatorFacet } = await E(zoe).startInstance(
installation,
);
return {
creatorFacet,
};
};
harden(setUpDummy); Test being executed: test.only('Test dummy contract', async (t) => {
const { zoe } = await setUpZoeForTest(() => {});
const { creatorFacet } = await setUpDummy(zoe);
const dummyKit = makeIssuerKit('Dummy');
const { brand } = dummyKit;
const dummyAmount = AmountMath.make(brand, 100n);
const invitation = await E(creatorFacet).makeDummyInvitation();
const proposal = harden({ give: { In: dummyAmount } });
const payment = harden({ In: dummyKit.mint.mintPayment(dummyAmount) });
const userSeat = await E(zoe).offer(invitation, proposal, payment);
const result = await E(userSeat).getOfferResult();
t.deepEqual(result, 'Sucess');
}); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The error message is pretty generic, and gives almost no hint as to where the problem is. What it means was that a key (Alleged: Dummy Brand) wasn't found in a store. At the time the lookup was attempted, the callee has no connection to the call stack of the caller. Still, it would help if the error message at least reported what store the lookup was being done in. Our stores do have names, even though they're not guaranteed unique. When it's a brand like this, I often suspect that an issuer hasn't been registered with Zoe for a particular contract. In this case, I think |
Beta Was this translation helpful? Give feedback.
The error message is pretty generic, and gives almost no hint as to where the problem is. What it means was that a key (Alleged: Dummy Brand) wasn't found in a store. At the time the lookup was attempted, the callee has no connection to the call stack of the caller. Still, it would help if the error message at least reported what store the lookup was being done in. Our stores do have names, even though they're not guaranteed unique.
When it's a brand like this, I often suspect that an issuer hasn't been registered with Zoe for a particular contract. In this case, I think
startInstance
wants an issuerKeywordRecord{ In: dummyKit.issuer }
.