Skip to content

Commit 7ad777e

Browse files
committed
add natspec, update equality check, update error message
1 parent c71eede commit 7ad777e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

contracts/discovery/GNS.sol

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ contract GNS is GNSV2Storage, GraphUpgradeable, IGNS, Multicall {
383383
SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID);
384384

385385
// Check new version exists
386-
require(subgraphData.versions[VersionType.New].vSignal != 0, "New version does not exist");
386+
require(
387+
subgraphData.versions[VersionType.New].vSignal != 0,
388+
"GNS: New version does not exist"
389+
);
387390

388391
ICuration curation = curation();
389392

@@ -1017,10 +1020,19 @@ contract GNS is GNSV2Storage, GraphUpgradeable, IGNS, Multicall {
10171020
return subgraphData;
10181021
}
10191022

1023+
/**
1024+
* @dev Check to see if verrsion exists
1025+
* @param _version Version data
1026+
* @return Bool Whether the version exists or not
1027+
*/
10201028
function _versionExists(Version storage _version) internal view returns (bool) {
1021-
return _version.subgraphDeploymentID != "";
1029+
return _version.subgraphDeploymentID != 0;
10221030
}
10231031

1032+
/**
1033+
* @dev Initialize current version
1034+
* @param _subgraphData Subgraph data
1035+
*/
10241036
function _initOldVersion(SubgraphData storage _subgraphData) internal {
10251037
if (!_versionExists(_subgraphData.versions[VersionType.Current])) {
10261038
_subgraphData.versions[VersionType.Current].subgraphDeploymentID = _subgraphData

0 commit comments

Comments
 (0)