Skip to content

Commit

Permalink
chore(subgraph-service): more boilerplate
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <[email protected]>
  • Loading branch information
tmigone committed Mar 18, 2024
1 parent bb008af commit ecd9767
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 69 deletions.
24 changes: 8 additions & 16 deletions packages/contracts/contracts/staking/IHorizonStaking.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity 0.7.6;
pragma solidity >=0.7.6 <0.9.0;
pragma abicoder v2;

interface Test {
function test() external;
}

interface IHorizonStaking {
struct Provision {
// Service provider that created the provision
Expand Down Expand Up @@ -93,12 +97,7 @@ interface IHorizonStaking {
function stake(uint256 tokens) external;

// create a provision
function provision(
uint256 tokens,
address verifier,
uint256 maxVerifierCut,
uint256 thawingPeriod
) external;
function provision(uint256 tokens, address verifier, uint256 maxVerifierCut, uint256 thawingPeriod) external;

// initiate a thawing to remove tokens from a provision
function thaw(bytes32 provisionId, uint256 tokens) external returns (bytes32 thawRequestId);
Expand All @@ -123,11 +122,7 @@ interface IHorizonStaking {
) external returns (bytes32 thawRequestId);

// slash a service provider
function slash(
bytes32 provisionId,
uint256 tokens,
uint256 verifierAmount
) external;
function slash(bytes32 provisionId, uint256 tokens, uint256 verifierAmount) external;

// set the Service Provider's preferred provisions to be force thawed
function setForceThawProvisions(bytes32[] calldata provisions) external;
Expand All @@ -148,10 +143,7 @@ interface IHorizonStaking {
// `Provision.tokens - Provision.tokensThawing`
function getTokensAvailable(bytes32 provision) external view returns (uint256 tokens);

function getServiceProvider(address serviceProvider)
external
view
returns (ServiceProvider memory);
function getServiceProvider(address serviceProvider) external view returns (ServiceProvider memory);

function getProvision(bytes32 provision) external view returns (Provision memory);
}
31 changes: 0 additions & 31 deletions packages/subgraph-service/contracts/Lock.sol

This file was deleted.

8 changes: 8 additions & 0 deletions packages/subgraph-service/contracts/SubgraphService.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.0 <0.9.0;

import { Test } from "@graphprotocol/contracts/contracts/staking/IHorizonStaking.sol";

contract SimpleTest is Test {
function test() external {}
}
2 changes: 1 addition & 1 deletion packages/subgraph-service/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const eslintGraphConfig = require('eslint-graph-config')
module.exports = [
...eslintGraphConfig,
...eslintGraphConfig.default,
{
ignores: ['typechain-types/*'],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/subgraph-service/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '@nomicfoundation/hardhat-toolbox'
import { HardhatUserConfig } from 'hardhat/config'

const config: HardhatUserConfig = {
solidity: '0.8.24',
solidity: '0.8.25',
paths: {
artifacts: './build/contracts',
},
Expand Down
1 change: 1 addition & 0 deletions packages/subgraph-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"build": "hardhat compile"
},
"devDependencies": {
"@graphprotocol/contracts": "workspace:^7.0.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-foundry": "^1.1.1",
Expand Down
21 changes: 1 addition & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2749,6 +2749,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@graphprotocol/subgraph-service@workspace:packages/subgraph-service"
dependencies:
"@graphprotocol/contracts": "workspace:^7.0.0"
"@nomicfoundation/hardhat-chai-matchers": "npm:^2.0.0"
"@nomicfoundation/hardhat-ethers": "npm:^3.0.0"
"@nomicfoundation/hardhat-foundry": "npm:^1.1.1"
Expand Down Expand Up @@ -22154,16 +22155,6 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^4.0.2":
version: 4.9.5
resolution: "typescript@npm:4.9.5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 5f6cad2e728a8a063521328e612d7876e12f0d8a8390d3b3aaa452a6a65e24e9ac8ea22beb72a924fd96ea0a49ea63bb4e251fb922b12eedfb7f7a26475e5c56
languageName: node
linkType: hard

"typescript@npm:^5.0.4, typescript@npm:^5.1.6, typescript@npm:^5.3.3":
version: 5.3.3
resolution: "typescript@npm:5.3.3"
Expand All @@ -22184,16 +22175,6 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^4.0.2#optional!builtin<compat/typescript>":
version: 4.9.5
resolution: "typescript@patch:typescript@npm%3A4.9.5#optional!builtin<compat/typescript>::version=4.9.5&hash=289587"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 583ff68cafb0c076695f72d61df6feee71689568179fb0d3a4834dac343df6b6ed7cf7b6f6c801fa52d43cd1d324e2f2d8ae4497b09f9e6cfe3d80a6d6c9ca52
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^5.0.4#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.1.6#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>":
version: 5.3.3
resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"
Expand Down

0 comments on commit ecd9767

Please sign in to comment.