Skip to content

Commit

Permalink
panic if n is too large
Browse files Browse the repository at this point in the history
fix error
  • Loading branch information
hadv committed Mar 14, 2023
1 parent 37a3601 commit cb9dcd7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions evmcore/apply_fake_genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package evmcore

import (
"crypto/ecdsa"
"errors"
"math"
"math/big"
"time"
Expand Down Expand Up @@ -207,5 +208,9 @@ func FakeKey(n int) *ecdsa.PrivateKey {
key90, key91, key92, key93, key94, key95, key96, key97, key98, key99,
}

if n > len(keys) {
panic(errors.New("validator num is toor large"))
}

return keys[n-1]
}

0 comments on commit cb9dcd7

Please sign in to comment.