Skip to content

Commit

Permalink
fixup! aha, stuck at burn
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Nov 18, 2024
1 parent 67094d9 commit 3f66cbd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/orchestration/src/mock-orch-ertp/mock-ertp/mock-ertp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Fail } from '@endo/errors';
import { mustMatch } from '@endo/patterns';

import { AmountMath, BrandI, PaymentShape } from '@agoric/ertp';
import { AnyNatAmountShape } from '../../typeGuards.js';
Expand Down Expand Up @@ -250,16 +251,24 @@ export const prepareMockIssuerKit = zone => {
getAmountOf(payment) {
return this.state.paymentLedger.get(payment);
},
burn(_payment, _optAmountShape = undefined) {
// TODO
burn(payment, optAmountShape = undefined) {
const { paymentLedger, paymentRecoverySets } = this.state;

const amount = paymentLedger.get(payment);
if (optAmountShape !== undefined) {
mustMatch(amount, optAmountShape);
}
deletePayment(paymentLedger, paymentRecoverySets, payment);
// TODO Aha! Must update the encumberedBalance of the source purse,
// if any! Must decrement it by amount.
},
},
mint: {
getIssuer() {
return this.facets.issuer;
},
mintPayment(newAmount) {
// The mock implementation has no mintRecoveryPurse, or any reccovery
// The mock implementation has no mintRecoveryPurse, or any recovery
// set associated with minted payments.
const { paymentLedger, paymentRecoverySets } = this.state;
return makeInitPayment(
Expand Down

0 comments on commit 3f66cbd

Please sign in to comment.