summaryrefslogtreecommitdiff
path: root/data/transactions/logic/assembler_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'data/transactions/logic/assembler_test.go')
-rw-r--r--data/transactions/logic/assembler_test.go33
1 files changed, 29 insertions, 4 deletions
diff --git a/data/transactions/logic/assembler_test.go b/data/transactions/logic/assembler_test.go
index c45c0af77..3f609fd7e 100644
--- a/data/transactions/logic/assembler_test.go
+++ b/data/transactions/logic/assembler_test.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2019-2023 Algorand, Inc.
+// Copyright (C) 2019-2024 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
@@ -427,6 +427,13 @@ match_label1:
pushbytess "1" "2" "1"
`
+const stateProofNonsense = `
+pushbytes 0x0123456789abcd
+sumhash512
+dup; dup
+falcon_verify
+`
+
const v8Nonsense = v7Nonsense + switchNonsense + frameNonsense + matchNonsense + boxNonsense
const v9Nonsense = v8Nonsense
@@ -438,7 +445,7 @@ const spliceNonsence = `
const v10Nonsense = v9Nonsense + pairingNonsense + spliceNonsence
-const v11Nonsense = v10Nonsense
+const v11Nonsense = v10Nonsense + stateProofNonsense
const v6Compiled = "2004010002b7a60c26050242420c68656c6c6f20776f726c6421070123456789abcd208dae2087fbba51304eb02b91f656948397a7946390e8cb70fc9ea4d95f92251d047465737400320032013202320380021234292929292b0431003101310231043105310731083109310a310b310c310d310e310f3111311231133114311533000033000133000233000433000533000733000833000933000a33000b33000c33000d33000e33000f3300113300123300133300143300152d2e01022581f8acd19181cf959a1281f8acd19181cf951a81f8acd19181cf1581f8acd191810f082209240a220b230c240d250e230f2310231123122313231418191a1b1c28171615400003290349483403350222231d4a484848482b50512a632223524100034200004322602261222704634848222862482864286548482228246628226723286828692322700048482371004848361c0037001a0031183119311b311d311e311f312023221e312131223123312431253126312731283129312a312b312c312d312e312f447825225314225427042455220824564c4d4b0222382124391c0081e80780046a6f686e2281d00f23241f880003420001892224902291922494249593a0a1a2a3a4a5a6a7a8a9aaabacadae24af3a00003b003c003d816472064e014f012a57000823810858235b235a2359b03139330039b1b200b322c01a23c1001a2323c21a23c3233e233f8120af06002a494905002a49490700b400b53a03b6b7043cb8033a0c2349c42a9631007300810881088120978101c53a8101c6003a"
@@ -460,7 +467,9 @@ const spliceCompiled = "d2d3"
const v10Compiled = v9Compiled + pairingCompiled + spliceCompiled
-const V11Compiled = v10Compiled
+const stateProofCompiled = "80070123456789abcd86494985"
+
+const V11Compiled = v10Compiled + stateProofCompiled
var nonsense = map[uint64]string{
1: v1Nonsense,
@@ -541,7 +550,7 @@ func TestAssemble(t *testing.T) {
}
}
-var experiments = []uint64{}
+var experiments = []uint64{spOpcodesVersion}
// TestExperimental forces a conscious choice to promote "experimental" opcode
// groups. This will fail when we increment vFuture's LogicSigVersion. If we had
@@ -2955,6 +2964,22 @@ done:
`, LogicVersion, exp(5, "concat arg 1 wanted type []byte..."))
}
+func TestTypeTrackingRegression(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ t.Parallel()
+ testProg(t, `
+callsub end // wipes out initial program knowledge, makes scratch "any"
+label1:
+ load 1
+ byte 0x01
+ stores // we had a bug in which the "any" seemed constant
+ load 0
+ load 0
+ +
+end:
+`, LogicVersion)
+}
+
func TestMergeProtos(t *testing.T) {
partitiontest.PartitionTest(t)
t.Parallel()