@@ -359,21 +359,6 @@ def agent_publish_keypair(self, agent_keystore_path, sync_accounts):
359
359
LOGGER .debug (f"Publisher { address .stdout .strip ()} balance: { balance .stdout .strip ()} " )
360
360
time .sleep (8 )
361
361
362
- @pytest .fixture
363
- def agent_keystore (self , agent_keystore_path , agent_publish_keypair ):
364
- self .run (
365
- f"../scripts/init_key_store.sh localnet { agent_keystore_path } " )
366
-
367
- if USE_ACCUMULATOR :
368
- path = os .path .join (agent_keystore_path , "accumulator_program_key.json" )
369
-
370
- with open (path , 'w' ) as f :
371
- f .write (MESSAGE_BUFFER_PROGRAM )
372
-
373
- if os .path .exists ("keystore" ):
374
- os .remove ("keystore" )
375
- os .symlink (agent_keystore_path , "keystore" )
376
-
377
362
@pytest_asyncio .fixture
378
363
async def initialize_message_buffer_program (self , funding_keypair , sync_key_path , sync_accounts ):
379
364
@@ -429,7 +414,7 @@ async def initialize_message_buffer_program(self, funding_keypair, sync_key_path
429
414
await provider .send (tx , [parsed_funding_keypair ])
430
415
431
416
@pytest .fixture
432
- def agent_config (self , agent_keystore , agent_keystore_path , tmp_path ):
417
+ def agent_config (self , agent_keystore_path , tmp_path ):
433
418
with open ("agent_conf.toml" ) as config_file :
434
419
agent_config = config_file .read ()
435
420
@@ -454,32 +439,7 @@ def agent_config(self, agent_keystore, agent_keystore_path, tmp_path):
454
439
return path
455
440
456
441
@pytest .fixture
457
- def agent_legacy_config (self , agent_keystore , agent_keystore_path , tmp_path ):
458
- """
459
- Prepares a legacy v1.x.x config for testing agent-migrate-config
460
- """
461
- with open ("agent_conf.toml" ) as config_file :
462
- agent_config = config_file .read ()
463
-
464
- agent_config += f'\n key_store.root_path = "{ agent_keystore_path } "'
465
-
466
- if USE_ACCUMULATOR :
467
- # Add accumulator setting to verify that it is inlined as well
468
- agent_config += f'\n key_store.accumulator_key_path = "accumulator_program_key.json"'
469
-
470
- LOGGER .debug (f"Built legacy agent config:\n { agent_config } " )
471
-
472
- path = os .path .join (tmp_path , "agent_conf_legacy.toml" )
473
-
474
- with open (path , 'w' ) as f :
475
- f .write (agent_config )
476
-
477
- return path
478
-
479
-
480
-
481
- @pytest .fixture
482
- def agent (self , sync_accounts , agent_keystore , tmp_path , initialize_message_buffer_program , agent_config ):
442
+ def agent (self , sync_accounts , tmp_path , initialize_message_buffer_program , agent_config ):
483
443
LOGGER .debug ("Building agent binary" )
484
444
self .run ("cargo build --release --bin agent" )
485
445
@@ -493,7 +453,7 @@ def agent(self, sync_accounts, agent_keystore, tmp_path, initialize_message_buff
493
453
yield
494
454
495
455
@pytest .fixture
496
- def agent_hotload (self , sync_accounts , agent_keystore , agent_keystore_path , tmp_path , initialize_message_buffer_program , agent_config ):
456
+ def agent_hotload (self , sync_accounts , agent_keystore_path , tmp_path , initialize_message_buffer_program , agent_config ):
497
457
"""
498
458
Spawns an agent without a publish keypair, used for keypair hotloading testing
499
459
"""
@@ -723,44 +683,6 @@ async def test_publish_forever(self, client: PythAgentClient, tmp_path):
723
683
await client .update_price (price_account , 47 , 2 , "trading" )
724
684
time .sleep (1 )
725
685
726
- @pytest .mark .asyncio
727
- async def test_agent_migrate_config (self ,
728
- agent_keystore ,
729
- agent_legacy_config ,
730
- agent_migrate_config_binary ,
731
- client_no_spawn : PythAgentClient ,
732
- initialize_message_buffer_program ,
733
- sync_accounts ,
734
- tmp_path ,
735
- ):
736
- os .environ ["RUST_BACKTRACE" ] = "full"
737
- os .environ ["RUST_LOG" ] = "debug"
738
-
739
- # Migrator must run successfully (run() raises on error)
740
- new_config = self .run (f"{ agent_migrate_config_binary } -c { agent_legacy_config } " ).stdout .strip ()
741
-
742
- LOGGER .debug (f"Successfully migrated legacy config to:\n { new_config } " )
743
-
744
- # Overwrite legacy config with the migrated version.
745
- #
746
- # NOTE: assumes 'w' erases the file before access)
747
- with open (agent_legacy_config , 'w' ) as f :
748
- f .write (new_config )
749
- f .flush ()
750
-
751
- self .run ("cargo build --release --bin agent" )
752
-
753
- log_dir = os .path .join (tmp_path , "agent_logs" )
754
-
755
- # We start the agent manually to pass it the updated legacy config
756
- with self .spawn (f"../target/release/agent --config { agent_legacy_config } " , log_dir = log_dir ):
757
- time .sleep (3 )
758
- await client_no_spawn .connect ()
759
-
760
- # Continue with the simple test case, which must succeed
761
- await self .test_update_price_simple (client_no_spawn )
762
- await client_no_spawn .close ()
763
-
764
686
@pytest .mark .asyncio
765
687
async def test_agent_respects_market_hours (self , client : PythAgentClient ):
766
688
'''
0 commit comments