Skip to content

Commit

Permalink
fix: separate service provider address logic from other accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
jahabeebs committed Nov 28, 2024
1 parent b732ced commit 83f31af
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 75 deletions.
1 change: 0 additions & 1 deletion apps/agent/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ blockNumberService:
processor:
msBetweenChecks: 1000 # Interval between periodic checks (ms)
accountingModules:
requestModule: "0x1234567890123456789012345678901234567890" # Address of the Request module
responseModule: "0x1234567890123456789012345678901234567890" # Address of the Response module
escalationModule: "0x1234567890123456789012345678901234567890" # Address of the Escalation module

Expand Down
4 changes: 2 additions & 2 deletions apps/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
ProtocolProvider,
} from "@ebo-agent/automated-dispute";
import { BlockNumberService } from "@ebo-agent/blocknumber";
import { Logger, NotificationService, stringify } from "@ebo-agent/shared";
import { NotificationService, stringify } from "@ebo-agent/shared";

import { config } from "./config/index.js";

const logger = Logger.getInstance();
const logger = console;

const main = async (): Promise<void> => {
logger.debug("Initializing agent...");
Expand Down
22 changes: 17 additions & 5 deletions apps/agent/test/e2e/scenarios/01_happy_path/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ describe.sequential("single agent", () => {
}),
];

const serviceProvider = accounts[0].account;
const otherAccounts = accounts.slice(1).map((acc) => acc.account);

await setUpProphet({
accounts: accounts.map((account) => account.account),
serviceProvider: serviceProvider,
otherAccounts: otherAccounts,
arbitratorAddress: ARBITRATOR_ADDRESS,
grtAddress: GRT_CONTRACT_ADDRESS,
horizonStakingAddress: HORIZON_STAKING_ADDRESS,
Expand All @@ -166,10 +170,14 @@ describe.sequential("single agent", () => {
afterEach(async () => {
await l2ProtocolAnvil.stop();

await killAgent({
process: agent,
configPath: tmpConfigFile,
});
if (fs.existsSync(tmpConfigFile)) {
await killAgent({
process: agent,
configPath: tmpConfigFile,
});
} else {
console.warn(`Warning: ${tmpConfigFile} does not exist. Skipping agent kill.`);
}
});

test("basic flow", { timeout: E2E_TEST_TIMEOUT }, async () => {
Expand Down Expand Up @@ -227,6 +235,9 @@ describe.sequential("single agent", () => {
retryInterval: 500,
},
},
accessControl: {
serviceProviderAddress: undefined,
},
},
blockNumberService: {
blockmetaConfig: {
Expand Down Expand Up @@ -941,6 +952,7 @@ describe.sequential("single agent", () => {
retryInterval: 500,
},
},
privateKey: accounts[0].privateKey,
},
blockNumberService: {
blockmetaConfig: {
Expand Down
Loading

0 comments on commit 83f31af

Please sign in to comment.