Skip to content

Commit

Permalink
remove unnecessary indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
cam-schultz committed Jan 8, 2025
1 parent e78453e commit 5cb2f4a
Show file tree
Hide file tree
Showing 9 changed files with 265 additions and 589 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ interface IPoSValidatorManager is IValidatorManager {
* @param startTime The time at which the registration was completed
*/
event DelegatorRegistered(
bytes32 indexed delegationID, bytes32 indexed validationID, uint256 indexed startTime
bytes32 indexed delegationID, bytes32 indexed validationID, uint256 startTime
);

/**
Expand All @@ -116,18 +116,15 @@ interface IPoSValidatorManager is IValidatorManager {
* @param fees The portion of the delegator's rewards paid to the validator
*/
event DelegationEnded(
bytes32 indexed delegationID,
bytes32 indexed validationID,
uint256 indexed rewards,
uint256 fees
bytes32 indexed delegationID, bytes32 indexed validationID, uint256 rewards, uint256 fees
);

/**
* @notice Event emitted when the uptime of a validator is updated. Only emitted when the uptime is greater than the stored uptime.
* @param validationID The ID of the validation period
* @param uptime The updated uptime of the validator
*/
event UptimeUpdated(bytes32 indexed validationID, uint64 indexed uptime);
event UptimeUpdated(bytes32 indexed validationID, uint64 uptime);

/**
* @notice Updates the uptime of the validationID if the submitted proof is greated than the stored uptime.
Expand Down
12 changes: 5 additions & 7 deletions contracts/validator-manager/interfaces/IValidatorManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,12 @@ interface IValidatorManager {
event ValidationPeriodCreated(
bytes32 indexed validationID,
bytes32 indexed registerValidationMessageID,
uint64 indexed weight,
uint64 weight,
bytes nodeID,
uint64 registrationExpiry
);

event InitialValidatorCreated(
bytes32 indexed validationID, uint64 indexed weight, bytes nodeID
);
event InitialValidatorCreated(bytes32 indexed validationID, uint64 weight, bytes nodeID);

/**
* @notice Emitted when the staking manager learns that the validation period has been successfully registered
Expand All @@ -130,7 +128,7 @@ interface IValidatorManager {
* @param timestamp The time at which the validation period was registered with the contract.
*/
event ValidationPeriodRegistered(
bytes32 indexed validationID, uint64 indexed weight, uint256 indexed timestamp
bytes32 indexed validationID, uint64 weight, uint256 timestamp
);

/**
Expand All @@ -145,7 +143,7 @@ interface IValidatorManager {
event ValidatorRemovalInitialized(
bytes32 indexed validationID,
bytes32 indexed setWeightMessageID,
uint64 indexed weight,
uint64 weight,
uint256 endTime
);

Expand All @@ -167,7 +165,7 @@ interface IValidatorManager {
event ValidatorWeightUpdate(
bytes32 indexed validationID,
uint64 indexed nonce,
uint64 indexed weight,
uint64 weight,
bytes32 setWeightMessageID
);

Expand Down
11 changes: 3 additions & 8 deletions contracts/validator-manager/tests/PoSValidatorManagerTests.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest {
disableOwner: DEFAULT_P_CHAIN_OWNER
});

event ValidationUptimeUpdated(bytes32 indexed validationID, uint64 uptime);

event DelegatorAdded(
bytes32 indexed delegationID,
bytes32 indexed validationID,
Expand All @@ -68,19 +66,16 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest {
);

event DelegatorRegistered(
bytes32 indexed delegationID, bytes32 indexed validationID, uint256 indexed startTime
bytes32 indexed delegationID, bytes32 indexed validationID, uint256 startTime
);

event DelegatorRemovalInitialized(bytes32 indexed delegationID, bytes32 indexed validationID);

event DelegationEnded(
bytes32 indexed delegationID,
bytes32 indexed validationID,
uint256 indexed rewards,
uint256 fees
bytes32 indexed delegationID, bytes32 indexed validationID, uint256 rewards, uint256 fees
);

event UptimeUpdated(bytes32 indexed validationID, uint64 indexed uptime);
event UptimeUpdated(bytes32 indexed validationID, uint64 uptime);

function testDelegationFeeBipsTooLow() public {
vm.expectRevert(
Expand Down
12 changes: 5 additions & 7 deletions contracts/validator-manager/tests/ValidatorManagerTests.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,21 @@ abstract contract ValidatorManagerTest is Test {
event ValidationPeriodCreated(
bytes32 indexed validationID,
bytes32 indexed registerValidationMessageID,
uint64 indexed weight,
uint64 weight,
bytes nodeID,
uint64 registrationExpiry
);

event InitialValidatorCreated(
bytes32 indexed validationID, uint64 indexed weight, bytes nodeID
);
event InitialValidatorCreated(bytes32 indexed validationID, uint64 weight, bytes nodeID);

event ValidationPeriodRegistered(
bytes32 indexed validationID, uint64 indexed weight, uint256 indexed timestamp
bytes32 indexed validationID, uint64 weight, uint256 timestamp
);

event ValidatorRemovalInitialized(
bytes32 indexed validationID,
bytes32 indexed setWeightMessageID,
uint64 indexed weight,
uint64 weight,
uint256 endTime
);

Expand All @@ -90,7 +88,7 @@ abstract contract ValidatorManagerTest is Test {
event ValidatorWeightUpdate(
bytes32 indexed validationID,
uint64 indexed nonce,
uint64 indexed weight,
uint64 weight,
bytes32 setWeightMessageID
);

Expand Down

0 comments on commit 5cb2f4a

Please sign in to comment.