Skip to content

Commit 61b0433

Browse files
samuvethChaituVR
andauthored
fix: Only check for mainnet on production (#945)
* fix: Only check for mainnet on production * Update utils.ts * Update src/utils.ts * v0.9.5 --------- Co-authored-by: Chaitanya <[email protected]>
1 parent cb11b3a commit 61b0433

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@snapshot-labs/snapshot.js",
3-
"version": "0.9.4",
3+
"version": "0.9.5",
44
"repository": "snapshot-labs/snapshot.js",
55
"license": "MIT",
66
"main": "dist/snapshot.cjs.js",

src/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,17 @@ const networksIds = Object.keys(networks);
7878
const mainnetNetworkIds = Object.keys(networks).filter(
7979
(id) => !networks[id].testnet
8080
);
81-
const testnetNetworkIds = Object.keys(networks).filter(
82-
(id) => networks[id].testnet
83-
);
8481

8582
ajv.addKeyword({
8683
keyword: 'snapshotNetwork',
8784
validate: function (schema, data) {
8885
// @ts-ignore
8986
const snapshotEnv = this.snapshotEnv || 'default';
9087
if (snapshotEnv === 'mainnet') return mainnetNetworkIds.includes(data);
91-
if (snapshotEnv === 'testnet') return testnetNetworkIds.includes(data);
9288
return networksIds.includes(data);
9389
},
9490
error: {
95-
message: 'must be a valid network used by snapshot'
91+
message: 'network not allowed'
9692
}
9793
});
9894

0 commit comments

Comments
 (0)