File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ import db from '../helpers/mysql';
10
10
import { getLimits , getSpaceType } from '../helpers/options' ;
11
11
import { captureError , getQuorum , jsonParse , validateChoices } from '../helpers/utils' ;
12
12
13
+ const SNAPSHOT_ENV = process . env . NETWORK || 'testnet' ;
14
+ const TESTNET_ONLY_VOTING_TYPES = [ 'copeland' ] ;
15
+
13
16
const scoreAPIUrl = process . env . SCORE_API_URL || 'https://score.snapshot.org' ;
14
17
const broviderUrl = process . env . BROVIDER_URL || 'https://rpc.snapshot.org' ;
15
18
@@ -90,6 +93,10 @@ export async function verify(body): Promise<any> {
90
93
return Promise . reject ( 'proposal end date must be in the future' ) ;
91
94
}
92
95
96
+ if ( SNAPSHOT_ENV !== 'testnet' && TESTNET_ONLY_VOTING_TYPES . includes ( msg . payload . type ) ) {
97
+ return Promise . reject ( 'voting type allowed only on testnet' ) ;
98
+ }
99
+
93
100
const isChoicesValid = validateChoices ( {
94
101
type : msg . payload . type ,
95
102
choices : msg . payload . choices
You can’t perform that action at this time.
0 commit comments