diff options
author | John Jannotti <jannotti@gmail.com> | 2023-12-11 12:32:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 12:32:19 -0500 |
commit | 548fbb48f877ab24a6edfb12777134ccc690fc95 (patch) | |
tree | 78991756fd68abf90c0c23fc283d5c45a790707e | |
parent | 4b872f2324c6b27dbabd4017bf1b9f4088bdfdf6 (diff) |
AVM: Require every global field to get tested (#5864)
-rw-r--r-- | data/transactions/logic/eval_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/data/transactions/logic/eval_test.go b/data/transactions/logic/eval_test.go index fd8b9ff80..481f9544f 100644 --- a/data/transactions/logic/eval_test.go +++ b/data/transactions/logic/eval_test.go @@ -1232,6 +1232,7 @@ const globalV9TestProgram = globalV8TestProgram + ` const globalV10TestProgram = globalV9TestProgram + ` global AssetCreateMinBalance; int 1001; ==; && global AssetOptInMinBalance; int 1001; ==; && +global GenesisHash; len; int 32; ==; && ` func TestGlobal(t *testing.T) { @@ -1254,12 +1255,16 @@ func TestGlobal(t *testing.T) { 7: {CallerApplicationAddress, globalV7TestProgram}, 8: {CallerApplicationAddress, globalV8TestProgram}, 9: {CallerApplicationAddress, globalV9TestProgram}, - 10: {AssetOptInMinBalance, globalV10TestProgram}, + 10: {GenesisHash, globalV10TestProgram}, } // tests keys are versions so they must be in a range 1..AssemblerMaxVersion plus zero version require.LessOrEqual(t, len(tests), AssemblerMaxVersion+1) require.Len(t, globalFieldSpecs, int(invalidGlobalField)) + // ensure we are testing everything + require.Equal(t, tests[AssemblerMaxVersion].lastField, invalidGlobalField-1, + "did you add a new global field?") + ledger := NewLedger(nil) addr, err := basics.UnmarshalChecksumAddress(testAddr) require.NoError(t, err) |