Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/transactions/logic/TEAL_opcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ for notes on transaction fields available, see `txn`. If top of stack is _i_, `g

## gaid t

- Opcode: 0x3c
- Opcode: 0x3c {uint8 transaction group index}
- Pops: _None_
- Pushes: uint64
- push the ID of the asset or application created in the Tth transaction of the current group
Expand Down Expand Up @@ -914,7 +914,7 @@ pushint args are not added to the intcblock during assembly processes

## callsub target

- Opcode: 0x88
- Opcode: 0x88 {int16 branch offset, big endian}
- Pops: _None_
- Pushes: _None_
- branch unconditionally to TARGET, saving the next instruction on the call stack
Expand Down
2 changes: 2 additions & 0 deletions data/transactions/logic/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,12 @@ var opcodeImmediateNotes = map[string]string{
"bnz": "{int16 branch offset, big endian}",
"bz": "{int16 branch offset, big endian}",
"b": "{int16 branch offset, big endian}",
"callsub": "{int16 branch offset, big endian}",
"load": "{uint8 position in scratch space to load from}",
"store": "{uint8 position in scratch space to store to}",
"gload": "{uint8 transaction group index} {uint8 position in scratch space to load from}",
"gloads": "{uint8 position in scratch space to load from}",
"gaid": "{uint8 transaction group index}",
"substring": "{uint8 start position} {uint8 end position}",
"dig": "{uint8 depth}",
"asset_holding_get": "{uint8 asset holding field index}",
Expand Down
14 changes: 14 additions & 0 deletions data/transactions/logic/doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package logic

import (
"strings"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -77,6 +78,19 @@ func TestOpImmediateNote(t *testing.T) {
require.Empty(t, xd)
}

func TestAllImmediatesDocumented(t *testing.T) {
for _, op := range OpSpecs {
count := len(op.Details.Immediates)
note := OpImmediateNote(op.Name)
if count == 1 && op.Details.Immediates[0].kind >= immBytes {
// More elaborate than can be checked by easy count.
require.NotEmpty(t, note)
continue
}
require.Equal(t, count, strings.Count(note, "{"), "%s immediates doc is wrong", op.Name)
}
}

func TestOpDocExtra(t *testing.T) {
xd := OpDocExtra("bnz")
require.NotEmpty(t, xd)
Expand Down
3 changes: 3 additions & 0 deletions scripts/travis/codegen_verification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ echo "Running fixcheck"
GOPATH=$(go env GOPATH)
"$GOPATH"/bin/algofix -error */

echo "Updating TEAL Specs"
make -C data/transactions/logic

echo Checking Enlistment...
if [[ -n $(git status --porcelain) ]]; then
echo Enlistment is dirty - did you forget to run make?
Expand Down