Skip to content

Commit

Permalink
fix: handle-csm-operator-events
Browse files Browse the repository at this point in the history
  • Loading branch information
eddort committed Jul 1, 2024
1 parent 20b9b75 commit 8d6ffc3
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/common/registry-csm/fetch/operator.fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export class RegistryOperatorFetchService {
return true;
}

const nodeOperatorRewardAddressChangedFilter =
this.getContract(moduleAddress).filters['NodeOperatorRewardAddressChanged']();
const nodeOperatorRewardAddressChangedEvents = await this.getContract(moduleAddress).queryFilter(
nodeOperatorRewardAddressChangedFilter,
fromBlockNumber,
toBlockNumber,
);

if (nodeOperatorRewardAddressChangedEvents.length) {
return true;
}

return false;
}

Expand Down
3 changes: 2 additions & 1 deletion src/scripts/extract-csm-abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ const PARTS = [
'NodeOperatorAdded',
'RESUME_ROLE',
'resume',
'NodeOperatorRewardAddressChanged',
];
export const getCSMAbi = () => {
const { abi } = getCSMArtifact();
const abi = getCSMArtifact();

return abi.filter((node) => PARTS.includes(node.name) || node.type === 'error');
};
Expand Down
107 changes: 105 additions & 2 deletions src/staking-router-modules/contracts/abi/csm.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
},
{
"type": "error",
"name": "AlreadySet",
"name": "AlreadyActivated",
"inputs": []
},
{
Expand Down Expand Up @@ -387,6 +387,11 @@
"name": "InvalidInitialization",
"inputs": []
},
{
"type": "error",
"name": "InvalidInput",
"inputs": []
},
{
"type": "error",
"name": "InvalidKeysCount",
Expand Down Expand Up @@ -474,7 +479,7 @@
},
{
"type": "error",
"name": "StuckKeysHigherThanExited",
"name": "StuckKeysHigherThanNonExited",
"inputs": []
},
{
Expand All @@ -496,5 +501,103 @@
"type": "error",
"name": "ZeroPauseDuration",
"inputs": []
},
{
"type": "error",
"name": "QueueLookupNoLimit",
"inputs": []
},
{
"type": "event",
"name": "NodeOperatorRewardAddressChanged",
"inputs": [
{
"name": "nodeOperatorId",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "oldAddress",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newAddress",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "error",
"name": "AlreadyProposed",
"inputs": []
},
{
"type": "error",
"name": "SameAddress",
"inputs": []
},
{
"type": "error",
"name": "SenderIsNotManagerAddress",
"inputs": []
},
{
"type": "error",
"name": "SenderIsNotProposedAddress",
"inputs": []
},
{
"type": "error",
"name": "SenderIsNotRewardAddress",
"inputs": []
},
{
"type": "error",
"name": "AddressEmptyCode",
"inputs": [
{
"name": "target",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "AddressInsufficientBalance",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "FailedInnerCall",
"inputs": []
},
{
"type": "error",
"name": "FailedToSendEther",
"inputs": []
},
{
"type": "error",
"name": "SafeERC20FailedOperation",
"inputs": [
{
"name": "token",
"type": "address",
"internalType": "address"
}
]
}
]

0 comments on commit 8d6ffc3

Please sign in to comment.