Skip to content

Commit

Permalink
fixup! feat: operator majority logic
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Dec 17, 2024
1 parent 7df4df6 commit 186dd94
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions packages/fast-usdc/test/fast-usdc.contract.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import type { ExecutionContext, TestFn } from 'ava';

import {
decodeAddressHook,
encodeAddressHook,
} from '@agoric/cosmic-proto/address-hooks.js';
import { AmountMath } from '@agoric/ertp/src/amountMath.js';
import { deeplyFulfilledObject } from '@agoric/internal';
import {
eventLoopIteration,
inspectMapStore,
Expand All @@ -24,13 +27,9 @@ import {
import type { Instance } from '@agoric/zoe/src/zoeService/utils.js';
import { setUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
import { E } from '@endo/far';
import { matches, objectMap } from '@endo/patterns';
import { matches } from '@endo/patterns';
import { makePromiseKit } from '@endo/promise-kit';
import path from 'path';
import {
decodeAddressHook,
encodeAddressHook,
} from '@agoric/cosmic-proto/address-hooks.js';
import type { OperatorKit } from '../src/exos/operator-kit.js';
import type { FastUsdcSF } from '../src/fast-usdc.contract.js';
import { PoolMetricsShape } from '../src/type-guards.js';
Expand Down Expand Up @@ -59,7 +58,7 @@ const getInvitationProperties = async (
type CommonSetup = Awaited<ReturnType<typeof commonSetup>>;
const startContract = async (
common: Pick<CommonSetup, 'brands' | 'commonPrivateArgs' | 'utils'>,
operatorQty = 1,
operatorQty = 3,
) => {
const {
brands: { usdc },
Expand Down Expand Up @@ -749,7 +748,6 @@ test.todo('C18 - forward - MUST log and alert these incidents');

test.serial('Settlement for unknown transaction (operator down)', async t => {
const {
sync,
bridges: { snapshot, since },
evm: { cctp, txPub },
common: {
Expand All @@ -758,12 +756,8 @@ test.serial('Settlement for unknown transaction (operator down)', async t => {
},
mint,
} = t.context;
const operators = await sync.ocw.promise;

const opDown = makeCustomer('Otto', cctp, txPub.publisher, feeConfig);

// what removeOperator will do
await E(E.get(E(operators[1]).getKit()).admin).disable();
const bridgePos = snapshot();
const sent = await opDown.sendFast(t, 20_000_000n, 'osmo12345');
await mint(sent);
Expand All @@ -785,12 +779,10 @@ test.serial('Settlement for unknown transaction (operator down)', async t => {
],
'20 USDC arrive at the settlement account',
);
// FIXME why shouldn't there be an advance?
t.deepEqual(bridgeTraffic.local, [], 'no IBC transfers');

await transmitTransferAck();
t.deepEqual(await E(operators[1]).getFailures(), [
'submitEvidence for disabled operator',
]);
});

test.todo(
Expand Down

0 comments on commit 186dd94

Please sign in to comment.