Compiled output.

This commit is contained in:
Hernán Di Pietro 2021-11-02 11:48:50 -03:00
parent db93454f24
commit b37c8943d4
4 changed files with 2541 additions and 70 deletions

2597
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@
"author": "Randlabs inc",
"license": "ISC",
"dependencies": {
"@certusone/wormhole-sdk": "^0.0.5",
"@pythnetwork/client": "^2.3.1",
"@randlabs/js-config-reader": "^1.1.0",
"algosdk": "^1.11.1",

View File

@ -20,7 +20,7 @@ Must be part of group:
verify: Verify guardian signature subset i..j, works in tandem with stateless program.
Arguments: #0 guardian public keys subset i..j (must match stored in global state)
#1 guardian signatures subset i..j
#2 payload to verify
TX Note: payload to verify
Last verification step (the last TX in group) triggers the VAA commiting stage,
where we decide what to do based on the payload.
------------------------------------------------------------------------------------------------
@ -156,7 +156,8 @@ def check_final_verification_state():
i.load() < Global.group_size(),
i.store(i.load() + Int(0))).Do(
Assert(
And(Gtxn[i.load()].application_id() == Txn.application_id(),
And(Gtxn[i.load()].type_enum() == TxnType.ApplicationCall,
Gtxn[i.load()].application_id() == Txn.application_id(),
GetBit(ImportScratchValue(i.load(), SLOTID_VERIFIED_BIT), i.load()) == Int(1)))
),
Return(Int(1))
@ -228,12 +229,12 @@ def clear_state_program():
if __name__ == "__main__":
with open("vaa-processor-approval.teal", "w") as f:
with open("teal/wormhole/build/vaa-processor-approval.teal", "w") as f:
compiled = compileTeal(vaa_processor_program(),
mode=Mode.Application, version=5)
f.write(compiled)
with open("vaa-processor-clear.teal", "w") as f:
with open("teal/wormhole/build/vaa-processor-clear.teal", "w") as f:
compiled = compileTeal(clear_state_program(),
mode=Mode.Application, version=5)
f.write(compiled)

View File

@ -73,13 +73,13 @@ def vaa_verify_program(vaa_processor_app_id):
Txn.application_id() == Int(vaa_processor_app_id),
Txn.type_enum() == TxnType.ApplicationCall,
Global.group_size() == get_group_size(Btoi(num_guardians)),
sig_check(signatures, digest, keys, num_guardians))
sig_check(signatures, digest, keys))
),
Approve()])
if __name__ == "__main__":
with open("vaa-verify.teal", "w") as f:
with open("teal/wormhole/build/vaa-verify.teal", "w") as f:
compiled = compileTeal(vaa_verify_program(
333), mode=Mode.Signature, version=5)
f.write(compiled)