Skip to content

Commit 45b5ec3

Browse files
committed
handle reth with hash
1 parent 10dae77 commit 45b5ec3

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

pkg/common/parse_client.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,20 @@ func handleNimbus(name string) (*Client, error) {
402402
}
403403

404404
func handleLen1(parts []string) (*Client, error) {
405+
split := strings.Split(parts[0], "-")
406+
407+
if len(split) == 2 && split[0] == "reth" {
408+
return &Client{
409+
Name: split[0],
410+
UserData: Unknown,
411+
Version: Unknown,
412+
Build: split[1],
413+
OS: OSUnknown,
414+
Arch: ArchUnknown,
415+
Language: "rust",
416+
}, nil
417+
}
418+
405419
return &Client{
406420
Name: parts[0],
407421
UserData: Unknown,

pkg/common/parse_client_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func TestParseClientID(t *testing.T) {
185185
},
186186
},
187187
{
188-
name: "reth",
188+
name: "reth base",
189189
ci: "reth/v1.9.2-74351d9/x86_64-unknown-linux-gnu/base/v0.2.1",
190190
client: &Client{
191191
Name: "reth",
@@ -197,6 +197,19 @@ func TestParseClientID(t *testing.T) {
197197
Language: "rust",
198198
},
199199
},
200+
{
201+
name: "reth with git hash",
202+
ci: "reth-97c0e691d2f03d030756d1f4",
203+
client: &Client{
204+
Name: "reth",
205+
UserData: Unknown,
206+
Version: Unknown,
207+
Build: "97c0e691d2f03d030756d1f4",
208+
OS: OSUnknown,
209+
Arch: ArchUnknown,
210+
Language: "rust",
211+
},
212+
},
200213
}
201214

202215
for _, test := range tt {

0 commit comments

Comments
 (0)