Skip to content

Commit

Permalink
Remove constants typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisPH3 committed Oct 29, 2024
1 parent dc539d5 commit d667ace
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions go/ct/evm_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ func fuzzVm(testee ct.Evm, f *testing.F) {
}

const (
fuzzIdealStackSize int = 7 // < max pops in a single instruction
fuzzMaximumCodeSegment int = 33 // < 1 instruction with 32 data bytes
fuzzMaxGas int = 5_000_000_000 // < gas limits memory usage
fuzzIdealStackSize = 7 // < max pops in a single instruction
fuzzMaximumCodeSegment = 33 // < 1 instruction with 32 data bytes
fuzzMaxGas = 5_000_000_000 // < gas limits memory usage
)

// prepareFuzzingSeeds is a helper function to be used by similar fuzzing tests
Expand All @@ -159,7 +159,7 @@ func prepareFuzzingSeeds(f *testing.F) {
// the fuzzer will generate more interesting values around these, the initial
// list just sketches a region of interest around which the fuzzer will generate
// more values. I found no measurable difference about being more accurate.
for _, gas := range []int64{0, 1, 6, 10, 1000, int64(fuzzMaxGas)} {
for _, gas := range []int64{0, 1, 6, 10, 1000, fuzzMaxGas} {

// generate a code segment with the operation followed by 6 random values
ops := make([]byte, fuzzMaximumCodeSegment)
Expand Down Expand Up @@ -216,7 +216,7 @@ func corpusEntryToCtState(opCodes []byte, gas int64, revision byte, stackBytes [
return nil, fmt.Errorf("negative gas %v", gas)
}

if gas > int64(fuzzMaxGas) {
if gas > fuzzMaxGas {
return nil, fmt.Errorf("gas too large %v", gas)
}

Expand Down

0 comments on commit d667ace

Please sign in to comment.