diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e6d8ff..564f8bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [Unreleased] + +### Bug Fixes + +* [#39](https://github.com/JulianToledano/goingecko/pull/39) Change CodeStats types from int16 to int64. + ## [v3.0.0](https://github.com/JulianToledano/goingecko/releases/tag/v3.0.0) - 2025.01-25 ### Improvements diff --git a/api/coins/id_test.go b/api/coins/id_test.go new file mode 100644 index 0000000..f35da05 --- /dev/null +++ b/api/coins/id_test.go @@ -0,0 +1,39 @@ +package coins + +import ( + "context" + "net/http" + "testing" + + "github.com/JulianToledano/goingecko/v3/api/internal" + geckohttp "github.com/JulianToledano/goingecko/v3/http" +) + +func TestCoinsId(t *testing.T) { + tests := []struct { + name string + id string + }{ + { + name: "stellar", + id: "stellar", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &CoinsClient{ + internal.NewClient( + geckohttp.NewClient(geckohttp.WithHttpClient(http.DefaultClient)), + internal.BaseURL, + ), + } + got, err := c.CoinsId(context.Background(), tt.id) + if err != nil { + t.Errorf("CoinsList() error = %v", err) + } + if got == nil { + t.Errorf("CoinsList() got = nil, want not nil") + } + }) + } +} diff --git a/api/types/types.go b/api/types/types.go index 3a4a9e8..4fcf223 100644 --- a/api/types/types.go +++ b/api/types/types.go @@ -139,8 +139,8 @@ type DeveloperData struct { } type CodeStats struct { - Additions int16 `json:"additions"` - Deletions int16 `json:"deletions"` + Additions int64 `json:"additions"` + Deletions int64 `json:"deletions"` } type PublicInterestStats struct {