From 16b280e2c95cf82244436c4a3f1a6ef4fd3ddc97 Mon Sep 17 00:00:00 2001 From: Matt Curtis Date: Fri, 29 Sep 2023 06:57:11 +0100 Subject: [PATCH] review comments --- tools/faucet/cmd/cli.go | 3 ++- tools/faucet/webserver/web_server.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/faucet/cmd/cli.go b/tools/faucet/cmd/cli.go index 2fce0fc997..7a042fbae0 100644 --- a/tools/faucet/cmd/cli.go +++ b/tools/faucet/cmd/cli.go @@ -2,6 +2,7 @@ package main import ( "flag" + "github.com/ethereum/go-ethereum/params" "math/big" "github.com/obscuronet/go-obscuro/tools/faucet/faucet" @@ -62,7 +63,7 @@ func parseCLIArgs() *faucet.Config { func toWei(amount *float64) *big.Int { amtFloat := new(big.Float).SetFloat64(*amount) - weiFloat := new(big.Float).Mul(amtFloat, big.NewFloat(1e18)) + weiFloat := new(big.Float).Mul(amtFloat, big.NewFloat(params.Ether)) // don't care about the accuracy here, float should have less than 18 decimal places wei, _ := weiFloat.Int(nil) return wei diff --git a/tools/faucet/webserver/web_server.go b/tools/faucet/webserver/web_server.go index cedda667b2..f3bf7967bb 100644 --- a/tools/faucet/webserver/web_server.go +++ b/tools/faucet/webserver/web_server.go @@ -32,6 +32,7 @@ func NewWebServer(faucetServer *faucet.Faucet, bindAddress string, jwtSecret []b // authed endpoint r.POST("/auth/fund/:token", jwtTokenChecker(jwtSecret, faucetServer.Logger), fundingHandler(faucetServer, defaultAmount)) + // todo (@matt) we need to remove this unsecure endpoint before we provide a fully public sepolia faucet r.POST("/fund/:token", fundingHandler(faucetServer, defaultAmount)) return &WebServer{