Skip to content

Commit

Permalink
Change the way exec.Command is called to sanitize parameters (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodeymo authored Oct 2, 2024
1 parent bce0284 commit c666771
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions testutils/anvil.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,8 @@ func GetContractAddressesFromContractRegistry(ethHttpUrl string) (mockAvsContrac
}

func AdvanceChainByNBlocks(n int, anvilEndpoint string) {
cmd := exec.Command("bash", "-c",
fmt.Sprintf(
// see https://book.getfoundry.sh/reference/anvil/#custom-methods
`cast rpc anvil_mine %d --rpc-url %s`,
n, anvilEndpoint),
)
// see https://book.getfoundry.sh/reference/anvil/#custom-methods
cmd := exec.Command("cast", "rpc", "anvil_mine", fmt.Sprintf("%d", n), "--rpc-url", anvilEndpoint)
err := cmd.Run()
if err != nil {
panic(err)
Expand Down

0 comments on commit c666771

Please sign in to comment.