File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,23 @@ gcmd="goal -w ${WALLET}"
1717
1818ACCOUNT=$( ${gcmd} account list| awk ' { print $3 }' )
1919
20- APPID=$( ${gcmd} app create --creator " $ACCOUNT " --approval-prog=${TEAL} /app-params.teal --clear-prog=${TEAL} /approve-all.teal --global-byteslices 1 --global-ints 2 --local-byteslices 3 --local-ints 4 --extra-pages 2 --app-arg " addr:$ACCOUNT " | grep Created | awk ' { print $6 }' )
20+ APPID=$( ${gcmd} app create --creator " $ACCOUNT " --approval-prog=${TEAL} /app-params.teal --clear-prog=${TEAL} /approve-all.teal --global-byteslices 1 --global-ints 2 --local-byteslices 3 --local-ints 4 --extra-pages 2 --app-arg " addr:$ACCOUNT " | grep Created | awk ' { print $6 }' )
2121
2222ACCOUNTB=$( ${gcmd} account new| awk ' { print $6 }' )
2323${gcmd} clerk send -f " $ACCOUNT " -t " $ACCOUNTB " -a 1000000
2424
2525# Now call from a different account
2626${gcmd} app call --app-id=" $APPID " --from=" $ACCOUNTB " --app-arg " addr:$ACCOUNT "
2727
28+ # The below checks use quine.teal to test "app_params_get AppApprovalProgram"
2829
30+ # Verify "app_params_get AppApprovalProgram" works on create
31+ APPID_2=$( ${gcmd} app create --creator " $ACCOUNTB " --approval-prog=${TEAL} /quine.teal --clear-prog=${TEAL} /approve-all.teal --global-byteslices 0 --global-ints 0 --local-byteslices 0 --local-ints 0 --extra-pages 0 | grep Created | awk ' { print $6 }' )
32+
33+ # Verify "app_params_get AppApprovalProgram" works on regular app call
34+ ${gcmd} app call --app-id=" $APPID_2 " --from=" $ACCOUNTB "
35+
36+ # Verify "app_params_get AppApprovalProgram" works on update
37+ ${gcmd} app update --app-id=" $APPID_2 " --from=" $ACCOUNTB " --approval-prog=${TEAL} /approve-all.teal --clear-prog=${TEAL} /approve-all.teal
2938
3039date " +${scriptname} OK %Y%m%d_%H%M%S"
Original file line number Diff line number Diff line change 1+ #pragma version 5
2+ // To modify the program:
3+ // 1. Replace the first line with `pushbytes ""`.
4+ // 2. Compile the program.
5+ // 3. Replace the first line with `pushbytes <compiled bytecode>`
6+ // 4. Update the varuint length of the new bytecode (line 11)
7+ // 5. The quine is complete. Compile again.
8+ pushbytes 0x0580004957000280011a504f0149570300505081007200441243
9+ dup
10+ extract 0 2
11+ pushbytes 0x1a // the varuint length of 0x0580...
12+ concat
13+ uncover 1
14+ dup
15+ extract 3 0 // the range here must be updated if the varuint length is longer than 1 byte
16+ concat
17+ concat // after this line the whole program is on the stack
18+ pushint 0
19+ app_params_get AppApprovalProgram
20+ assert
21+ ==
22+ return
You can’t perform that action at this time.
0 commit comments