Procházet zdrojové kódy

algorand: Ensure optin transaction is the current transaction (#3131)

* Ensure optin transaction is the current transaction and address the algo_seed transaction in a relative manner.

* Added core_approve.teal based on previous change.

* Fixed admin.py to make the tests pass.
Marcos Nuñez Cortes před 2 roky
rodič
revize
0dcc53cbf8
3 změnil soubory, kde provedl 301 přidání a 203 odebrání
  1. 1 1
      algorand/admin.py
  2. 298 200
      algorand/teal/core_approve.teal
  3. 2 2
      algorand/wormhole_core.py

+ 1 - 1
algorand/admin.py

@@ -1151,7 +1151,7 @@ class PortalCore:
             off += 2
             ret["Fee"] = vaa[off:(off + 32)].hex()
 
-        if int.from_bytes((vaa[off:off+1]), "big") == 3:
+        if len(vaa[off:]) > 133 and int.from_bytes((vaa[off:off+1]), "big") == 3:
             ret["Meta"] = "TokenBridge Transfer With Payload"
             ret["Type"] = int.from_bytes((vaa[off:off+1]), "big")
             off += 1

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 298 - 200
algorand/teal/core_approve.teal


+ 2 - 2
algorand/wormhole_core.py

@@ -126,8 +126,8 @@ def getCoreContracts(   genTeal, approve_name, clear_name,
         @Subroutine(TealType.uint64)
         def optin():
             # Alias for readability
-            algo_seed = Gtxn[0]
-            optin = Gtxn[1]
+            algo_seed = Gtxn[Txn.group_index() - Int(1)]
+            optin = Txn
     
             well_formed_optin = And(
                 # Check that we're paying it

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů