Skip to content
This repository was archived by the owner on Apr 22, 2026. It is now read-only.

Commit a12ccd8

Browse files
author
Iztok
committed
backward compatibility fix
1 parent 3c78651 commit a12ccd8

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • packages/fasset-bots-core/src/fasset

packages/fasset-bots-core/src/fasset/Agent.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,15 @@ export class OwnerAddressPair {
4646
async acceptWorkAddressAssignment(agentOwnerRegistry: AgentOwnerRegistryInstance) {
4747
const currentWorkAddress = await agentOwnerRegistry.getWorkAddress(this.managementAddress);
4848
if (currentWorkAddress === this.workAddress) return true;
49-
const pendingWorkAddress = await agentOwnerRegistry.getPendingWorkAddress(this.managementAddress);
50-
if (pendingWorkAddress !== this.workAddress) return false;
51-
await agentOwnerRegistry.acceptWorkAddressAssignment(this.managementAddress, { from: this.workAddress });
52-
return true;
49+
try {
50+
const pendingWorkAddress = await agentOwnerRegistry.getPendingWorkAddress(this.managementAddress);
51+
if (pendingWorkAddress !== this.workAddress) return false;
52+
await agentOwnerRegistry.acceptWorkAddressAssignment(this.managementAddress, { from: this.workAddress });
53+
return true;
54+
} catch (error) {
55+
logger.error("Invalid call to getPendingWorkAddress/acceptWorkAddressAssignment, maybe contracts not updated?", error);
56+
return false;
57+
}
5358
}
5459
}
5560

0 commit comments

Comments
 (0)