Skip to content

Commit

Permalink
generator: try to find more complex contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden committed Sep 1, 2024
1 parent 86d8a67 commit 09f2087
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions generator/eof_strategies_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package generator

import (
"fmt"
"testing"

"github.com/MariusVanDerWijden/FuzzyVM/filler"
Expand All @@ -15,21 +16,24 @@ func FuzzEOFGenerator(f *testing.F) {
newCon := new(vm.Container)
if err := newCon.UnmarshalBinary(container.MarshalBinary(), true); err == nil {
if err := newCon.ValidateCode(&jt, true); err == nil {
panic(err)
if len(newCon.Code) > 0 && len(newCon.Code[0]) > 10 {
panic(newCon.Code)
}
}
}
})
}

func TestEOFGenerator(t *testing.T) {
data := []byte("\xa0\xfc")
data := []byte("01\xbe\x00\x01 \xfe")
jt := vm.NewPragueEOFInstructionSetForTesting()
fl := filler.NewFiller(data)
container := RandomContainer(fl)
//fmt.Printf("%x\n", container.MarshalBinary())
newCon := new(vm.Container)
if err := newCon.UnmarshalBinary(container.MarshalBinary(), true); err == nil {
if err := newCon.ValidateCode(&jt, true); err == nil {
fmt.Println(container.Code)
panic(err)
}
}
Expand Down

0 comments on commit 09f2087

Please sign in to comment.