Skip to content

Commit

Permalink
Parse slot/gas as uint64 in test code (flashbots#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtraglia authored Aug 22, 2022
1 parent b0b19e4 commit e614c25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/test-cli/beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ func getCurrentBeaconBlock(beaconEndpoint string) (beaconBlockData, error) {
return beaconBlockData{}, err
}

slot, err := strconv.Atoi(blockResp.Data.Message.Slot)
slot, err := strconv.ParseUint(blockResp.Data.Message.Slot, 10, 64)
if err != nil {
return beaconBlockData{}, err
}

return beaconBlockData{Slot: uint64(slot), BlockHash: blockResp.Data.Message.Body.ExecutionPayload.BlockHash}, err
return beaconBlockData{Slot: slot, BlockHash: blockResp.Data.Message.Body.ExecutionPayload.BlockHash}, err
}

// MergemockBeacon - fake beacon for use with mergemock relay's engine
Expand Down
4 changes: 2 additions & 2 deletions cmd/test-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ func main() {

var gasLimit uint64
envGasLimitStr := getEnv("VALIDATOR_GAS_LIMIT", "30000000")
envGasLimit, err := strconv.Atoi(envGasLimitStr)
envGasLimit, err := strconv.ParseUint(envGasLimitStr, 10, 64)
if err != nil {
log.WithError(err).Fatal("invalid gas limit specified")
}
generateCommand.Uint64Var(&gasLimit, "gas-limit", uint64(envGasLimit), "Gas limit to register the validator with")
generateCommand.Uint64Var(&gasLimit, "gas-limit", envGasLimit, "Gas limit to register the validator with")

var validatorFeeRecipient string
envValidatorFeeRecipient := getEnv("VALIDATOR_FEE_RECIPIENT", "0x0000000000000000000000000000000000000000")
Expand Down

0 comments on commit e614c25

Please sign in to comment.