Skip to content

Commit

Permalink
Update gno version
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Apr 29, 2024
1 parent fe104c2 commit 6d24d4a
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 58 deletions.
11 changes: 8 additions & 3 deletions client/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ type Client struct {
}

// NewClient creates a new TM2 HTTP client
func NewClient(remote string) *Client {
return &Client{
client: rpcClient.NewHTTP(remote, ""),
func NewClient(remote string) (*Client, error) {
client, err := rpcClient.NewHTTPClient(remote)
if err != nil {
return nil, fmt.Errorf("unable to create HTTP client, %w", err)
}

return &Client{
client: client,
}, nil
}

func (c *Client) GetAccount(address crypto.Address) (std.Account, error) {
Expand Down
8 changes: 7 additions & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,17 @@ func (c *faucetCfg) exec(_ context.Context, _ []string) error {
// Create a new logger
logger := slog.New(slog.NewTextHandler(os.Stdout, nil))

// Create the tm2 client
client, err := tm2Client.NewClient(c.remote)
if err != nil {
return fmt.Errorf("unable to create client, %w", err)
}

// Create a new faucet with
// static gas estimation
f, err := faucet.NewFaucet(
static.New(gasFee, gasWanted),
tm2Client.NewClient(c.remote),
client,
faucet.WithLogger(logger),
faucet.WithConfig(c.config),
)
Expand Down
37 changes: 25 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gnolang/faucet
go 1.21

require (
github.com/gnolang/gno v0.0.0-20240313211052-3481a03c98bc
github.com/gnolang/gno v0.0.0-20240429120125-3832b1312d7d
github.com/go-chi/chi/v5 v5.0.12
github.com/pelletier/go-toml v1.9.5
github.com/peterbourgon/ff/v3 v3.4.0
Expand All @@ -13,23 +13,36 @@ require (
)

require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect
github.com/btcsuite/btcd/btcutil v1.1.5 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/jaekwon/testify v1.6.1 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
github.com/rs/xid v1.5.0 // indirect
go.opentelemetry.io/otel v1.25.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.25.0 // indirect
go.opentelemetry.io/otel/metric v1.25.0 // indirect
go.opentelemetry.io/otel/sdk v1.25.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.25.0 // indirect
go.opentelemetry.io/otel/trace v1.25.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/grpc v1.63.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 6d24d4a

Please sign in to comment.