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
1,473 changes: 0 additions & 1,473 deletions packages/contracts-test/tests/unit/gns.test.ts

This file was deleted.

777 changes: 0 additions & 777 deletions packages/contracts-test/tests/unit/l2/l2GNS.test.ts

This file was deleted.

276 changes: 0 additions & 276 deletions packages/contracts-test/tests/unit/lib/gnsUtils.ts

This file was deleted.

8 changes: 6 additions & 2 deletions packages/subgraph-discovery/test/unit/Setup.t.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;

import { DiscoveryTest } from "./shared/DiscoveryTest.t.sol";
import { GNSHelpers } from "./shared/GNSHelpers.t.sol";

contract SetupTest is DiscoveryTest {
contract SetupTest is GNSHelpers {
function test_Setup_Wired() public view {
assertEq(nft.minter(), address(gns));
assertEq(curation.subgraphService(), subgraphService);
assertEq(gns.counterpartGNSAddress(), l1GNS);
}

function test_Setup_PublishNewSubgraph() public {
_publishNewSubgraph(me, DEPLOYMENT_ID_0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,8 @@ interface IL2GNSLike {
function nSignalToTokens(uint256 subgraphID, uint256 nSignalIn) external view returns (uint256, uint256);

function vSignalToNSignal(uint256 subgraphID, uint256 vSignalIn) external view returns (uint256);

function nSignalToVSignal(uint256 subgraphID, uint256 nSignalIn) external view returns (uint256);

function multicall(bytes[] calldata data) external returns (bytes[] memory results);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;

import { GNSHelpers } from "../shared/GNSHelpers.t.sol";

contract AliasedSubgraphIdTest is GNSHelpers {
uint256 internal constant OFFSET = 0x1111000000000000000000000000000000000000000000000000000000001111;

// -- getAliasedL2SubgraphID --

function test_GetAliasedL2SubgraphID_AddsOffset() public view {
uint256 l1SubgraphId = 68799548758199140224151701590582019137924969401915573086349306511960790045480;
uint256 expectedL2SubgraphId;
unchecked {
expectedL2SubgraphId = l1SubgraphId + OFFSET;
}
assertEq(gns.getAliasedL2SubgraphID(l1SubgraphId), expectedL2SubgraphId);
}

function test_GetAliasedL2SubgraphID_WrapsAroundMaxUint256() public view {
uint256 l1SubgraphId = type(uint256).max;
uint256 expectedL2SubgraphId;
unchecked {
expectedL2SubgraphId = l1SubgraphId + OFFSET;
}
assertEq(gns.getAliasedL2SubgraphID(l1SubgraphId), expectedL2SubgraphId);
assertEq(expectedL2SubgraphId, OFFSET - 1);
}
}
Loading
Loading