Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
begmaroman committed Oct 9, 2023
1 parent 8e302f0 commit ea63627
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion jsonrpc/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func (d *Dispatcher) registerEndpoints(store JSONRPCStore) error {
d.params.chainID,
}
d.endpoints.Web3 = &Web3{
d.params.chainID,
d.params.chainName,
}
d.endpoints.TxPool = &TxPool{
Expand Down
4 changes: 1 addition & 3 deletions jsonrpc/web3_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import (

// Web3 is the web3 jsonrpc endpoint
type Web3 struct {
chainID uint64
chainName string
}

var clientVersionTemplate = "%s-%d/%s/%s-%s/%s"
var clientVersionTemplate = "%s/%s/%s-%s/%s"

// ClientVersion returns the version of the web3 client (web3_clientVersion)
// Example: "polygon-edge-53105/v1.1.0/linux-amd64/go1.20.0"
Expand All @@ -30,7 +29,6 @@ func (w *Web3) ClientVersion() (interface{}, error) {
return fmt.Sprintf(
clientVersionTemplate,
w.chainName,
w.chainID,
version,
runtime.GOOS,
runtime.GOARCH,
Expand Down
3 changes: 1 addition & 2 deletions jsonrpc/web3_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ func TestWeb3EndpointClientVersion(t *testing.T) {

assert.NoError(t, expectJSONResult(resp, &res))
assert.Contains(t, res,
fmt.Sprintf("%s-%d/%s/%s-%s/%s",
fmt.Sprintf("%s/%s/%s-%s/%s",
chainName,
chainID,
versioning.Version,
runtime.GOOS,
runtime.GOARCH,
Expand Down

0 comments on commit ea63627

Please sign in to comment.