Skip to content

Commit d14870e

Browse files
committed
test: fix package tests
Signed-off-by: Tomás Migone <[email protected]>
1 parent 28d810e commit d14870e

File tree

7 files changed

+2462
-2528
lines changed

7 files changed

+2462
-2528
lines changed

packages/contracts/test/scripts/test

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source $(pwd)/scripts/evm
77

88
# Ensure we compiled sources and dependencies
99

10-
pnpm --filter @graphprotocol/contracts --filter @graphprotocol/sdk build
10+
pnpm --filter @graphprotocol/contracts build
1111

1212
### Cleanup
1313
function cleanup() {
@@ -29,6 +29,10 @@ fi
2929
# Init address book
3030
echo {} > ../addresses-local.json
3131

32+
# TODO: fix this! For some reason the resolved package does not have a few required files
33+
echo {} > ../../../node_modules/.pnpm/@[email protected]/node_modules/@graphprotocol/contracts/addresses-local.json
34+
cp -r ../config ../../../node_modules/.pnpm/@[email protected]/node_modules/@graphprotocol/contracts/config
35+
3236
mkdir -p reports
3337

3438
# Run using the standalone evm instance

packages/hardhat-graph-protocol/test/config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { loadHardhatContext } from './helpers'
77
describe('GRE init functions', function () {
88
// No address book - should throw
99
describe('getAddressBookPath', function () {
10-
it('should throw if no address book is specified', function () {
10+
it('should return undefined if no address book is specified', function () {
1111
this.hre = loadHardhatContext('default-config', 'mainnet')
12-
expect(() => getAddressBookPath('horizon', this.hre, {})).to.throw('Must set a an addressBook path!')
12+
expect(getAddressBookPath('horizon', this.hre, {})).to.be.undefined
1313
})
1414

1515
it("should throw if address book doesn't exist", function () {

packages/horizon/test/unit/utilities/Authorizable.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ contract AuthorizableTest is Test, Bounder {
6969
}
7070

7171
function test_AuthorizeSigner_Revert_WhenInvalidProofDeadline(uint256 _proofDeadline, uint256 _now) public {
72+
_now = bound(_now, 0, type(uint64).max - 1);
7273
_proofDeadline = bound(_proofDeadline, 0, _now);
7374
vm.warp(_now);
7475

@@ -89,7 +90,7 @@ contract AuthorizableTest is Test, Bounder {
8990
uint256 _chainid,
9091
uint256 _wrong
9192
) public {
92-
_now = bound(_now, 0, type(uint256).max - 1);
93+
_now = bound(_now, 0, type(uint64).max - 1);
9394
address authorizer = boundAddr(_unboundedAuthorizer);
9495
(uint256 signerKey, address signer) = boundAddrAndKey(_unboundedKey);
9596
_proofDeadline = boundTimestampMin(_proofDeadline, _now + 1);

packages/horizon/test/unit/utilities/GraphDirectoryImplementation.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pragma solidity 0.8.27;
44

5-
import { IGraphToken } from "@graphprotocol/interfaces/contracts/contracts/token/IGraphToken.sol";
5+
import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol";
66
import { IHorizonStaking } from "@graphprotocol/interfaces/contracts/horizon/IHorizonStaking.sol";
77
import { IGraphPayments } from "@graphprotocol/interfaces/contracts/horizon/IGraphPayments.sol";
88
import { IPaymentsEscrow } from "@graphprotocol/interfaces/contracts/horizon/IPaymentsEscrow.sol";

packages/subgraph-service/test/unit/disputeManager/disputes/query/create.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ contract DisputeManagerQueryCreateDisputeTest is DisputeManagerTest {
174174
resetPrank(users.fisherman);
175175
token.approve(address(disputeManager), tokens);
176176

177-
Attestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId);
177+
IAttestation.Receipt memory receipt = _createAttestationReceipt(requestCID, responseCID, subgraphDeploymentId);
178178
bytes memory attestationData = _createAtestationData(receipt, allocationIDPrivateKey);
179179
_createQueryDispute(attestationData);
180180
}

packages/token-distribution/scripts/test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ set -eo pipefail
55
MNEMONIC="myth like bonus scare over problem client lizard pioneer submit female collect"
66
TESTRPC_PORT=8545
77

8+
if [ -z "${STUDIO_API_KEY}" ]; then
9+
echo "Warning: STUDIO_API_KEY is not set. Skipping tests."
10+
exit 0
11+
fi
12+
813
### Functions
914

1015
evm_running() {

0 commit comments

Comments
 (0)