From f7f6e109c82753ef2e3acfbefb6ba3d37e27e830 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 17 Dec 2024 11:18:27 -0800 Subject: [PATCH] refactor: TransactionFeed attest --- packages/fast-usdc/src/exos/operator-kit.js | 4 ++-- packages/fast-usdc/src/exos/transaction-feed.js | 6 ++++-- packages/fast-usdc/test/exos/transaction-feed.test.ts | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/fast-usdc/src/exos/operator-kit.js b/packages/fast-usdc/src/exos/operator-kit.js index 08b3ac9c368..b5e847f30d5 100644 --- a/packages/fast-usdc/src/exos/operator-kit.js +++ b/packages/fast-usdc/src/exos/operator-kit.js @@ -12,7 +12,7 @@ const trace = makeTracer('TxOperator'); /** * @typedef {object} OperatorPowers - * @property {(evidence: CctpTxEvidence, operatorKit: OperatorKit) => void} submitEvidence + * @property {(evidence: CctpTxEvidence, operatorKit: OperatorKit) => void} attest */ /** @@ -102,7 +102,7 @@ export const prepareOperatorKit = (zone, staticPowers) => async submitEvidence(evidence) { const { state } = this; !state.disabled || Fail`submitEvidence for disabled operator`; - const result = state.powers.submitEvidence(evidence, this.facets); + const result = state.powers.attest(evidence, this.facets); return result; }, /** @returns {OperatorStatus} */ diff --git a/packages/fast-usdc/src/exos/transaction-feed.js b/packages/fast-usdc/src/exos/transaction-feed.js index 782236d615f..40d456ef9ea 100644 --- a/packages/fast-usdc/src/exos/transaction-feed.js +++ b/packages/fast-usdc/src/exos/transaction-feed.js @@ -18,7 +18,7 @@ export const INVITATION_MAKERS_DESC = 'oracle operator invitation'; const TransactionFeedKitI = harden({ operatorPowers: M.interface('Transaction Feed Admin', { - submitEvidence: M.call(CctpTxEvidenceShape, M.any()).returns(), + attest: M.call(CctpTxEvidenceShape, M.any()).returns(), }), creator: M.interface('Transaction Feed Creator', { // TODO narrow the return shape to OperatorKit @@ -118,10 +118,12 @@ export const prepareTransactionFeedKit = (zone, zcf) => { /** * Add evidence from an operator. * + * NB: the operatorKit is responsible for + * * @param {CctpTxEvidence} evidence * @param {OperatorKit} operatorKit */ - submitEvidence(evidence, operatorKit) { + attest(evidence, operatorKit) { const { pending } = this.state; trace( 'submitEvidence', diff --git a/packages/fast-usdc/test/exos/transaction-feed.test.ts b/packages/fast-usdc/test/exos/transaction-feed.test.ts index ff3f2705aa6..64c6f8c34a1 100644 --- a/packages/fast-usdc/test/exos/transaction-feed.test.ts +++ b/packages/fast-usdc/test/exos/transaction-feed.test.ts @@ -102,7 +102,7 @@ test.skip('forged source', async t => { // op1 is different than the facets object the evidence must come from t.throws(() => - feedKit.operatorPowers.submitEvidence( + feedKit.operatorPowers.attest( evidence, // @ts-expect-error XXX Types of property '[GET_INTERFACE_GUARD]' are incompatible. op1,