Преглед изворни кода

fix: p2w_autoattest don't die after initialization

also minimal formatting
Eran Davidovich пре 3 година
родитељ
комит
f9b0d42a32
1 измењених фајлова са 19 додато и 11 уклоњено
  1. 19 11
      third_party/pyth/p2w_autoattest.py

+ 19 - 11
third_party/pyth/p2w_autoattest.py

@@ -70,14 +70,20 @@ def serve_attestations():
     httpd = HTTPServer(server_address, P2WAutoattestStatusEndpoint)
     httpd.serve_forever()
 
+
 if SOL_AIRDROP_AMT > 0:
     # Fund the p2w owner
-    sol_run_or_die("airdrop", [
-        str(SOL_AIRDROP_AMT),
-        "--keypair", P2W_OWNER_KEYPAIR,
-        "--commitment", "finalized",
-    ])
-    
+    sol_run_or_die(
+        "airdrop",
+        [
+            str(SOL_AIRDROP_AMT),
+            "--keypair",
+            P2W_OWNER_KEYPAIR,
+            "--commitment",
+            "finalized",
+        ],
+    )
+
 
 if P2W_INITIALIZE_SOL_CONTRACT is not None:
     # Get actor pubkeys
@@ -160,7 +166,9 @@ if P2W_ATTESTATION_CFG is None:
 ---
 symbols:"""
 
-    logging.info(f"Retrieved {len(pyth_accounts)} Pyth accounts from endpoint: {pyth_accounts}")
+    logging.info(
+        f"Retrieved {len(pyth_accounts)} Pyth accounts from endpoint: {pyth_accounts}"
+    )
 
     for acc in pyth_accounts:
 
@@ -176,7 +184,7 @@ symbols:"""
     with open(P2W_ATTESTATION_CFG, "w") as f:
         f.write(cfg_yaml)
         f.flush()
-        
+
 
 attest_result = run_or_die(
     [
@@ -191,8 +199,7 @@ attest_result = run_or_die(
         P2W_OWNER_KEYPAIR,
         "attest",
         "-f",
-        P2W_ATTESTATION_CFG
-        
+        P2W_ATTESTATION_CFG,
     ],
     capture_output=True,
 )
@@ -232,8 +239,9 @@ while True:
             P2W_OWNER_KEYPAIR,
             "attest",
             "-f",
-            P2W_ATTESTATION_CFG
+            P2W_ATTESTATION_CFG,
         ],
         capture_output=True,
+        die=False,
     )
     time.sleep(P2W_ATTEST_INTERVAL)