Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/horizon/test/unit/staking/slash/slash.t.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;

import "forge-std/Test.sol";

Check warning on line 4 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

Import in packages/horizon/test/unit/staking/slash/slash.t.sol doesn't exist in: forge-std/Test.sol

Check warning on line 4 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

global import of path forge-std/Test.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

import { IHorizonStakingMain } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingMain.sol";

Check warning on line 6 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

Import in packages/horizon/test/unit/staking/slash/slash.t.sol doesn't exist in: @graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingMain.sol

import { HorizonStakingTest } from "../HorizonStaking.t.sol";

contract HorizonStakingSlashTest is HorizonStakingTest {

Check warning on line 10 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

Missing @notice tag in contract 'HorizonStakingSlashTest'

Check warning on line 10 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

Missing @author tag in contract 'HorizonStakingSlashTest'

Check warning on line 10 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

Missing @title tag in contract 'HorizonStakingSlashTest'
/*
* TESTS
*/

function testSlash_Tokens(

Check warning on line 15 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

Mismatch in @param names for function 'testSlash_Tokens'. Expected: [tokens, maxVerifierCut, slashTokens, verifierCutAmount], Found: []

Check warning on line 15 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

Missing @param tag in function 'testSlash_Tokens'

Check warning on line 15 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

Missing @notice tag in function 'testSlash_Tokens'
uint256 tokens,
uint32 maxVerifierCut,
uint256 slashTokens,
Expand All @@ -20,7 +20,7 @@
) public useIndexer useProvision(tokens, maxVerifierCut, 0) {
slashTokens = bound(slashTokens, 1, tokens);
uint256 maxVerifierTokens = (slashTokens * maxVerifierCut) / MAX_PPM;
vm.assume(verifierCutAmount <= maxVerifierTokens);

Check warning on line 23 in packages/horizon/test/unit/staking/slash/slash.t.sol

View workflow job for this annotation

GitHub Actions / Lint Files

GC: Non strict inequality found. Try converting to a strict one

vm.startPrank(subgraphDataServiceAddress);
_slash(users.indexer, subgraphDataServiceAddress, slashTokens, verifierCutAmount);
Expand Down Expand Up @@ -172,6 +172,10 @@
vm.assume(delegationTokensToSlash <= delegationTokens);
vm.assume(delegationTokensToUndelegate <= delegationTokens);
vm.assume(delegationTokensToUndelegate > 0);
vm.assume(
delegationTokensToUndelegate == delegationTokens ||
MIN_DELEGATION <= delegationTokens - delegationTokensToUndelegate
);

resetPrank(users.delegator);
_delegate(users.indexer, subgraphDataServiceAddress, delegationTokens, 0);
Expand Down
13 changes: 11 additions & 2 deletions packages/interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@
"types": "./dist/src/index.d.ts",
"default": "./dist/src/index.js"
},
"./types": {
"types": "./dist/types/index.d.ts",
"default": "./dist/types/index.js"
},
"./types-v5": {
"types": "./dist/types-v5/index.d.ts",
"default": "./dist/types-v5/index.js"
},
"./wagmi": {
"types": "./dist/wagmi/generated.d.ts",
"default": "./dist/wagmi/generated.js"
},
"./utils": {
"types": "./dist/src/utils.d.ts",
"default": "./dist/src/utils.js"
}
},
"files": [
Expand Down Expand Up @@ -47,20 +55,21 @@
"prepublishOnly": "pnpm run build"
},
"devDependencies": {
"@ethersproject/abi": "5.7.0",
"@ethersproject/providers": "5.7.2",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@openzeppelin/contracts": "3.4.2",
"@openzeppelin/contracts-upgradeable": "3.4.2",
"@typechain/ethers-v5": "^10.2.1",
"@wagmi/cli": "^2.3.1",
"ethers": "catalog:",
"ethers-v5": "npm:ethers@5.7.2",
"@ethersproject/abi": "5.7.0",
"@ethersproject/providers": "5.7.2",
"hardhat": "catalog:",
"markdownlint-cli": "catalog:",
"prettier": "catalog:",
"prettier-plugin-solidity": "catalog:",
"solhint": "catalog:",
"ts-node": "catalog:",
"typechain": "^8.3.2",
"viem": "^2.31.7"
}
Expand Down
9 changes: 7 additions & 2 deletions packages/interfaces/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ find_files() {
echo "📦 Compiling contracts with Hardhat..."
pnpm hardhat compile

# Step 1.5: Generate interface IDs
node scripts/generateInterfaceIds.js
# Step 1.5: Add interface IDs to generated factory files (only if needed)
missing_ids=$(grep -rL "static readonly interfaceId" types/factories --include="*__factory.ts" 2>/dev/null | wc -l)

if [[ $missing_ids -gt 0 ]]; then
# Slow operation, only run if needed
npx ts-node scripts/utils/addInterfaceIds.ts types/factories
fi

# Step 2: Generate types (only if needed)
echo "🏗️ Checking type definitions..."
Expand Down
179 changes: 0 additions & 179 deletions packages/interfaces/scripts/generateInterfaceIds.js

This file was deleted.

Loading
Loading