@@ -67,7 +67,7 @@ func randomURL() string {
6767 return fmt .Sprintf ("localhost:%d" , 10000 + 2000 + id .Int64 ())
6868}
6969
70- func setupCoordinator (t * testing.T , proversPerSession uint8 , coordinatorURL string , forks [] string ) (* cron.Collector , * http.Server ) {
70+ func setupCoordinator (t * testing.T , proversPerSession uint8 , coordinatorURL string ) (* cron.Collector , * http.Server ) {
7171 var err error
7272 db , err = testApps .GetGormDBClient ()
7373
@@ -85,9 +85,8 @@ func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL stri
8585 ProversPerSession : proversPerSession ,
8686 Verifier : & config.VerifierConfig {
8787 HighVersionCircuit : & config.CircuitConfig {
88- ParamsPath : "" ,
8988 AssetsPath : "" ,
90- ForkName : "bernoulli " ,
89+ ForkName : "euclidV2 " ,
9190 MinProverVersion : "v4.4.89" ,
9291 },
9392 },
@@ -102,20 +101,20 @@ func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL stri
102101 },
103102 }
104103
105- var chainConf params.ChainConfig
106- for _ , forkName := range forks {
107- switch forkName {
108- case "bernoulli" :
109- chainConf . BernoulliBlock = big . NewInt ( 100 )
110- case "homestead" :
111- chainConf . HomesteadBlock = big . NewInt ( 0 )
112- }
104+ chainConf := & params.ChainConfig {
105+ LondonBlock : big . NewInt ( 0 ),
106+ BernoulliBlock : big . NewInt ( 0 ),
107+ CurieBlock : big . NewInt ( 0 ),
108+ DarwinTime : new ( uint64 ),
109+ DarwinV2Time : new ( uint64 ),
110+ EuclidTime : new ( uint64 ),
111+ EuclidV2Time : new ( uint64 ),
113112 }
114113
115114 proofCollector := cron .NewCollector (context .Background (), db , conf , nil )
116115
117116 router := gin .New ()
118- api .InitController (conf , & chainConf , db , nil )
117+ api .InitController (conf , chainConf , db , nil )
119118 route .Route (router , conf , nil )
120119 srv := & http.Server {
121120 Addr : coordinatorURL ,
@@ -191,7 +190,7 @@ func TestApis(t *testing.T) {
191190func testHandshake (t * testing.T ) {
192191 // Setup coordinator and http server.
193192 coordinatorURL := randomURL ()
194- proofCollector , httpHandler := setupCoordinator (t , 1 , coordinatorURL , [] string { "homestead" } )
193+ proofCollector , httpHandler := setupCoordinator (t , 1 , coordinatorURL )
195194 defer func () {
196195 proofCollector .Stop ()
197196 assert .NoError (t , httpHandler .Shutdown (context .Background ()))
@@ -204,7 +203,7 @@ func testHandshake(t *testing.T) {
204203func testFailedHandshake (t * testing.T ) {
205204 // Setup coordinator and http server.
206205 coordinatorURL := randomURL ()
207- proofCollector , httpHandler := setupCoordinator (t , 1 , coordinatorURL , [] string { "homestead" } )
206+ proofCollector , httpHandler := setupCoordinator (t , 1 , coordinatorURL )
208207 defer func () {
209208 proofCollector .Stop ()
210209 }()
@@ -222,7 +221,7 @@ func testFailedHandshake(t *testing.T) {
222221
223222func testGetTaskBlocked (t * testing.T ) {
224223 coordinatorURL := randomURL ()
225- collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL , [] string { "homestead" } )
224+ collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL )
226225 defer func () {
227226 collector .Stop ()
228227 assert .NoError (t , httpHandler .Shutdown (context .Background ()))
@@ -266,7 +265,7 @@ func testGetTaskBlocked(t *testing.T) {
266265
267266func testOutdatedProverVersion (t * testing.T ) {
268267 coordinatorURL := randomURL ()
269- collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL , [] string { "homestead" } )
268+ collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL )
270269 defer func () {
271270 collector .Stop ()
272271 assert .NoError (t , httpHandler .Shutdown (context .Background ()))
@@ -291,7 +290,7 @@ func testOutdatedProverVersion(t *testing.T) {
291290
292291func testValidProof (t * testing.T ) {
293292 coordinatorURL := randomURL ()
294- collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL , [] string { "homestead" } )
293+ collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL )
295294 defer func () {
296295 collector .Stop ()
297296 assert .NoError (t , httpHandler .Shutdown (context .Background ()))
@@ -374,7 +373,7 @@ func testValidProof(t *testing.T) {
374373func testInvalidProof (t * testing.T ) {
375374 // Setup coordinator and ws server.
376375 coordinatorURL := randomURL ()
377- collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL , [] string { "euclidV2" } )
376+ collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL )
378377 defer func () {
379378 collector .Stop ()
380379 assert .NoError (t , httpHandler .Shutdown (context .Background ()))
@@ -462,7 +461,7 @@ func testInvalidProof(t *testing.T) {
462461func testProofGeneratedFailed (t * testing.T ) {
463462 // Setup coordinator and ws server.
464463 coordinatorURL := randomURL ()
465- collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL , [] string { "euclidV2" } )
464+ collector , httpHandler := setupCoordinator (t , 3 , coordinatorURL )
466465 defer func () {
467466 collector .Stop ()
468467 assert .NoError (t , httpHandler .Shutdown (context .Background ()))
@@ -563,7 +562,7 @@ func testProofGeneratedFailed(t *testing.T) {
563562func testTimeoutProof (t * testing.T ) {
564563 // Setup coordinator and ws server.
565564 coordinatorURL := randomURL ()
566- collector , httpHandler := setupCoordinator (t , 1 , coordinatorURL , [] string { "euclidV2" } )
565+ collector , httpHandler := setupCoordinator (t , 1 , coordinatorURL )
567566 defer func () {
568567 collector .Stop ()
569568 assert .NoError (t , httpHandler .Shutdown (context .Background ()))
@@ -586,7 +585,9 @@ func testTimeoutProof(t *testing.T) {
586585 assert .NoError (t , err )
587586 err = chunkOrm .UpdateBatchHashInRange (context .Background (), 0 , 100 , batch .Hash )
588587 assert .NoError (t , err )
589- encodeData , err := json .Marshal (message.OpenVMChunkProof {})
588+ encodeData , err := json .Marshal (message.OpenVMChunkProof {VmProof : & message.OpenVMProof {}, MetaData : struct {
589+ ChunkInfo * message.ChunkInfo `json:"chunk_info"`
590+ }{ChunkInfo : & message.ChunkInfo {}}})
590591 assert .NoError (t , err )
591592 assert .NotEmpty (t , encodeData )
592593 err = chunkOrm .UpdateProofAndProvingStatusByHash (context .Background (), dbChunk .Hash , encodeData , types .ProvingTaskUnassigned , 1 )
0 commit comments