diff --git a/packages/orchestration/src/mock-orch-ertp/mock-ertp/mock-ertp.js b/packages/orchestration/src/mock-orch-ertp/mock-ertp/mock-ertp.js index 551cc3fdeff3..9123470945a9 100644 --- a/packages/orchestration/src/mock-orch-ertp/mock-ertp/mock-ertp.js +++ b/packages/orchestration/src/mock-orch-ertp/mock-ertp/mock-ertp.js @@ -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'; @@ -250,8 +251,16 @@ 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: { @@ -259,7 +268,7 @@ export const prepareMockIssuerKit = zone => { 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(