From 336e3e5ceb7891010b9f75322937d160a64b1ab8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 08:27:19 +0200 Subject: [PATCH 01/36] chore: Bump trakx/bump-version-action from 8 to 9.0.0 (#22) Bumps [trakx/bump-version-action](https://github.com/trakx/bump-version-action) from 8 to 9.0.0. - [Release notes](https://github.com/trakx/bump-version-action/releases) - [Commits](https://github.com/trakx/bump-version-action/compare/v8...v9.0.0) --- updated-dependencies: - dependency-name: trakx/bump-version-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/publish.nuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.nuget.yml b/.github/workflows/publish.nuget.yml index 9b9f418..31df87d 100644 --- a/.github/workflows/publish.nuget.yml +++ b/.github/workflows/publish.nuget.yml @@ -43,7 +43,7 @@ jobs: - name: Bump version id: bumpVersion - uses: trakx/bump-version-action@v8 + uses: trakx/bump-version-action@v9.0.0 with: semverIncrementLevel: ${{github.event.inputs.semverIncrementLevel}} releaseBranches: master From 84f82337478f88eff85babcbc61173e2fc8ff5e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 09:07:47 +0100 Subject: [PATCH 02/36] chore: Bump anothrNick/github-tag-action from 1.38.0 to 1.39.0 (#23) Bumps [anothrNick/github-tag-action](https://github.com/anothrNick/github-tag-action) from 1.38.0 to 1.39.0. - [Release notes](https://github.com/anothrNick/github-tag-action/releases) - [Commits](https://github.com/anothrNick/github-tag-action/compare/1.38.0...1.39.0) --- updated-dependencies: - dependency-name: anothrNick/github-tag-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/publish.nuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.nuget.yml b/.github/workflows/publish.nuget.yml index 31df87d..119506f 100644 --- a/.github/workflows/publish.nuget.yml +++ b/.github/workflows/publish.nuget.yml @@ -89,7 +89,7 @@ jobs: --source "https://nuget.pkg.github.com/trakx/index.json"; done - name: push version tag - uses: anothrNick/github-tag-action@1.38.0 + uses: anothrNick/github-tag-action@1.39.0 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} CUSTOM_TAG: v${{steps.bumpVersion.outputs.fullVersion}} From 7b6b97be39cc755fc19daeb4c16a5c8e6cac7246 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 09:08:05 +0100 Subject: [PATCH 03/36] chore: Bump Trakx.Utils.Testing from 0.3.1 to 0.3.11 (#25) Bumps Trakx.Utils.Testing from 0.3.1 to 0.3.11. --- updated-dependencies: - dependency-name: Trakx.Utils.Testing dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: monsieurleberre --- .../Trakx.CryptoCompare.ApiClient.Tests.csproj | 2 +- .../Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index 562606c..88328ab 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -28,7 +28,7 @@ - + all diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index ebf1016..ebb74bd 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -17,7 +17,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From f35efe8074920acaa7f3568504bd64fc02da321e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 09:08:19 +0100 Subject: [PATCH 04/36] chore: Bump Trakx.Utils from 0.3.1 to 0.3.11 (#26) Bumps Trakx.Utils from 0.3.1 to 0.3.11. --- updated-dependencies: - dependency-name: Trakx.Utils dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: monsieurleberre --- .../Trakx.CryptoCompare.ApiClient.Websocket.csproj | 2 +- .../Trakx.CryptoCompare.ApiClient.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj index cb536fd..70cbfe2 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 7f7776c..5646c41 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -13,7 +13,7 @@ - + From bedf939c3a2c2bf72f30e57b654eaf724ee5c6b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 09:08:46 +0100 Subject: [PATCH 05/36] chore: Bump FluentAssertions from 6.5.1 to 6.6.0 (#24) Bumps [FluentAssertions](https://github.com/fluentassertions/fluentassertions) from 6.5.1 to 6.6.0. - [Release notes](https://github.com/fluentassertions/fluentassertions/releases) - [Changelog](https://github.com/fluentassertions/fluentassertions/blob/develop/AcceptApiChanges.ps1) - [Commits](https://github.com/fluentassertions/fluentassertions/compare/6.5.1...6.6.0) --- updated-dependencies: - dependency-name: FluentAssertions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: monsieurleberre --- .../Trakx.CryptoCompare.ApiClient.Tests.csproj | 2 +- .../Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index 88328ab..b51db20 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -18,7 +18,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index ebb74bd..ed159db 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 07224136ea2a83c3501b844a339f4b3f3c0d06d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 09:37:13 +0200 Subject: [PATCH 06/36] chore: Bump trakx/bump-version-action from 9.0.0 to 9.0.1 (#27) Bumps [trakx/bump-version-action](https://github.com/trakx/bump-version-action) from 9.0.0 to 9.0.1. - [Release notes](https://github.com/trakx/bump-version-action/releases) - [Commits](https://github.com/trakx/bump-version-action/compare/v9.0.0...v9.0.1) --- updated-dependencies: - dependency-name: trakx/bump-version-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/publish.nuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.nuget.yml b/.github/workflows/publish.nuget.yml index 119506f..f3c210c 100644 --- a/.github/workflows/publish.nuget.yml +++ b/.github/workflows/publish.nuget.yml @@ -43,7 +43,7 @@ jobs: - name: Bump version id: bumpVersion - uses: trakx/bump-version-action@v9.0.0 + uses: trakx/bump-version-action@v9.0.1 with: semverIncrementLevel: ${{github.event.inputs.semverIncrementLevel}} releaseBranches: master From ececddb5f266a405cc34af7ec878ae1858d68156 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 09:41:06 +0200 Subject: [PATCH 07/36] chore: Bump GitHubActionsTestLogger from 1.3.0 to 1.4.1 (#29) Bumps [GitHubActionsTestLogger](https://github.com/Tyrrrz/GitHubActionsTestLogger) from 1.3.0 to 1.4.1. - [Release notes](https://github.com/Tyrrrz/GitHubActionsTestLogger/releases) - [Changelog](https://github.com/Tyrrrz/GitHubActionsTestLogger/blob/master/Changelog.md) - [Commits](https://github.com/Tyrrrz/GitHubActionsTestLogger/compare/1.3...1.4.1) --- updated-dependencies: - dependency-name: GitHubActionsTestLogger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Trakx.CryptoCompare.ApiClient.Tests.csproj | 2 +- .../Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index b51db20..e2182dc 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -19,7 +19,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index ed159db..18f9ed7 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -10,7 +10,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 3d252d0f22be8a4d61d5d3d10d55e9f9e2676dda Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 May 2022 09:42:13 +0100 Subject: [PATCH 08/36] chore: Bump Trakx.Utils from 0.3.11 to 0.3.13 (#36) Bumps Trakx.Utils from 0.3.11 to 0.3.13. --- updated-dependencies: - dependency-name: Trakx.Utils dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Trakx.CryptoCompare.ApiClient.Websocket.csproj | 2 +- .../Trakx.CryptoCompare.ApiClient.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj index 70cbfe2..5920fdb 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 5646c41..6826414 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -13,7 +13,7 @@ - + From 12cac6f4b899bb17aff4985b530d33c50dd0221e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 May 2022 09:42:30 +0100 Subject: [PATCH 09/36] chore: Bump Serilog from 2.10.0 to 2.11.0 (#32) Bumps [Serilog](https://github.com/serilog/serilog) from 2.10.0 to 2.11.0. - [Release notes](https://github.com/serilog/serilog/releases) - [Changelog](https://github.com/serilog/serilog/blob/dev/CHANGES.md) - [Commits](https://github.com/serilog/serilog/compare/v2.10.0...v2.11.0) --- updated-dependencies: - dependency-name: Serilog dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: monsieurleberre --- .../Trakx.CryptoCompare.ApiClient.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 6826414..80a7f10 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -11,7 +11,7 @@ - + From 2d9a062c2334b23c7bed17b7f152104fb1311e5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 May 2022 09:42:44 +0100 Subject: [PATCH 10/36] chore: Bump Trakx.Utils.Testing from 0.3.11 to 0.3.13 (#35) Bumps Trakx.Utils.Testing from 0.3.11 to 0.3.13. --- updated-dependencies: - dependency-name: Trakx.Utils.Testing dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: monsieurleberre --- .../Trakx.CryptoCompare.ApiClient.Tests.csproj | 2 +- .../Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index e2182dc..4cc07a4 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -28,7 +28,7 @@ - + all diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index 18f9ed7..e98eeda 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -17,7 +17,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 5ffa517e3e8e0b91d0f1d45bc8671a8d0fe5cfde Mon Sep 17 00:00:00 2001 From: monsieurleberre Date: Sun, 1 May 2022 09:44:24 +0100 Subject: [PATCH 11/36] update bump-version --- .github/workflows/publish.nuget.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.nuget.yml b/.github/workflows/publish.nuget.yml index 9b9f418..7b104ad 100644 --- a/.github/workflows/publish.nuget.yml +++ b/.github/workflows/publish.nuget.yml @@ -43,11 +43,9 @@ jobs: - name: Bump version id: bumpVersion - uses: trakx/bump-version-action@v8 + uses: trakx/bump-version-action/get-tag@v9.1.1 with: semverIncrementLevel: ${{github.event.inputs.semverIncrementLevel}} - releaseBranches: master - githubToken: ${{secrets.GITHUB_TOKEN}} - name: Setup .NET Core uses: actions/setup-dotnet@v2 @@ -88,8 +86,9 @@ jobs: for f in ./nuget/*.symbols.nupkg; do echo "pushing $f file.." && dotnet nuget push $f --api-key ${{secrets.GITHUB_TOKEN}} \ --source "https://nuget.pkg.github.com/trakx/index.json"; done - - name: push version tag - uses: anothrNick/github-tag-action@1.38.0 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - CUSTOM_TAG: v${{steps.bumpVersion.outputs.fullVersion}} + - name: Push version tag + id: pushTag + uses: trakx/bump-version-action/push-tag@v9.1.1 + with: + tag: v${{steps.bumpVersion.outputs.fullVersion}} + githubToken: ${{secrets.GITHUB_TOKEN}} From ffd55d442bb56f9b3e5aa24086e90e89635c16ad Mon Sep 17 00:00:00 2001 From: monsieurleberre Date: Tue, 24 May 2022 09:56:14 +0200 Subject: [PATCH 12/36] update packages --- .../Trakx.CryptoCompare.ApiClient.Tests.csproj | 10 +++++----- ...rakx.CryptoCompare.ApiClient.Websocket.Tests.csproj | 10 +++++----- .../Trakx.CryptoCompare.ApiClient.Websocket.csproj | 4 ++-- .../Trakx.CryptoCompare.ApiClient.csproj | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index 4cc07a4..db03534 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -18,19 +18,19 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index e98eeda..c72188a 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -9,17 +9,17 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj index 5920fdb..02e1770 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 80a7f10..648545b 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -13,7 +13,7 @@ - + From 4dc22e8e22a61eb109dfb4cf901d4c73f52a0613 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Tue, 28 Mar 2023 17:40:22 +0100 Subject: [PATCH 13/36] refactor: rename from/to symbol to base/quote --- .../Model/Ohlc.cs | 4 ++-- .../Model/Ticker.cs | 4 ++-- .../Model/Trade.cs | 4 ++-- .../Rest/Models/Responses/AggregatedData.cs | 4 ++-- .../CoinFullAggregatedDataDisplay.cs | 4 ++-- .../Rest/Models/Responses/Sub.cs | 22 +++++++++---------- .../Rest/Models/Responses/TopInfo.cs | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs index 1745c57..0318222 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs @@ -7,8 +7,8 @@ public class Ohlc : InboundMessageBase { #nullable disable [JsonPropertyName("MARKET")] public string Market { get; set; } - [JsonPropertyName("FROMSYMBOL")] public string FromSymbol { get; set; } - [JsonPropertyName("TOSYMBOL")] public string ToSymbol { get; set; } + [JsonPropertyName("FROMSYMBOL")] public string BaseSymbol { get; set; } + [JsonPropertyName("TOSYMBOL")] public string QuoteSymbol { get; set; } [JsonPropertyName("TS"), JsonConverter(typeof(ULongOrStringConverter))] public ulong TimeStamp { get; set; } [JsonPropertyName("UNIT")] public string Unit { get; set; } [JsonPropertyName("ACTION")] public string Action { get; set; } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs index d6d43c8..c0dd0b1 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs @@ -7,8 +7,8 @@ public class Ticker : InboundMessageBase { #nullable disable [JsonPropertyName("MARKET")] public string Market { get; set; } - [JsonPropertyName("FROMSYMBOL")] public string FromSymbol { get; set; } - [JsonPropertyName("TOSYMBOL")] public string ToSymbol { get; set; } + [JsonPropertyName("FROMSYMBOL")] public string BaseSymbol { get; set; } + [JsonPropertyName("TOSYMBOL")] public string QuoteSymbol { get; set; } [JsonPropertyName("FLAGS"), JsonConverter(typeof(ULongOrStringConverter))] public ulong Flags { get; set; } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs index 111483d..5ba3736 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs @@ -7,8 +7,8 @@ public class Trade : InboundMessageBase { #nullable disable [JsonPropertyName("M")] public string Market { get; set; } - [JsonPropertyName("FSYM")] public string FromSymbol { get; set; } - [JsonPropertyName("TSYM")] public string ToSymbol { get; set; } + [JsonPropertyName("FSYM")] public string BaseSymbol { get; set; } + [JsonPropertyName("TSYM")] public string QuoteSymbol { get; set; } [JsonPropertyName("F"), JsonConverter(typeof(ULongOrStringConverter))] public ulong Flags { get; set; } [JsonPropertyName("ID")] public string Id { get; set; } [JsonPropertyName("TS"), JsonConverter(typeof(ULongOrStringConverter))] public ulong TimeStamp { get; set; } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/AggregatedData.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/AggregatedData.cs index 58fbde7..8f30f6e 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/AggregatedData.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/AggregatedData.cs @@ -10,7 +10,7 @@ public class AggregatedData public string Flags { get; set; } [JsonProperty("FROMSYMBOL")] - public string FromSymbol { get; set; } + public string BaseSymbol { get; set; } [JsonProperty("HIGH24HOUR")] public double? High24Hour { get; set; } @@ -41,7 +41,7 @@ public class AggregatedData public double? Price { get; set; } [JsonProperty("TOSYMBOL")] - public string ToSymbol { get; set; } + public string QuoteSymbol { get; set; } [JsonProperty("TYPE")] public string Type { get; set; } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinFullAggregatedDataDisplay.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinFullAggregatedDataDisplay.cs index 96a6deb..cd046e4 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinFullAggregatedDataDisplay.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinFullAggregatedDataDisplay.cs @@ -18,7 +18,7 @@ public class CoinFullAggregatedDataDisplay public string ChangePCTDay { get; set; } [JsonProperty("FROMSYMBOL")] - public string FromSymbol { get; set; } + public string BaseSymbol { get; set; } [JsonProperty("HIGH24HOUR")] public string High24Hour { get; set; } @@ -66,7 +66,7 @@ public class CoinFullAggregatedDataDisplay public string Supply { get; set; } [JsonProperty("TOSYMBOL")] - public string ToSymbol { get; set; } + public string QuoteSymbol { get; set; } [JsonProperty("TOTALVOLUME24H")] public string TotalVolume24H { get; set; } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Sub.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Sub.cs index b5957c1..88c95de 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Sub.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Sub.cs @@ -4,12 +4,12 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { - public struct Sub : IEquatable + public readonly struct Sub : IEquatable { public bool Equals(Sub other) => string.Equals(this.Exchange, other.Exchange) - && string.Equals(this.FromSymbol, other.FromSymbol) - && this.SubId == other.SubId - && string.Equals(this.ToSymbol, other.ToSymbol); + && string.Equals(this.BaseSymbol, other.BaseSymbol) + && this.SubId == other.SubId + && string.Equals(this.QuoteSymbol, other.QuoteSymbol); public override bool Equals(object obj) { @@ -25,9 +25,9 @@ public override int GetHashCode() unchecked { var hashCode = this.Exchange.GetHashCode(); - hashCode = (hashCode * 397) ^ this.FromSymbol.GetHashCode(); + hashCode = (hashCode * 397) ^ this.BaseSymbol.GetHashCode(); hashCode = (hashCode * 397) ^ (int)this.SubId; - hashCode = (hashCode * 397) ^ this.ToSymbol.GetHashCode(); + hashCode = (hashCode * 397) ^ this.QuoteSymbol.GetHashCode(); return hashCode; } } @@ -38,22 +38,22 @@ public Sub([NotNull] string exchange, [NotNull] string fromSymbol, SubId subId, Check.NotNullOrWhiteSpace(fromSymbol, nameof(fromSymbol)); Check.NotNullOrWhiteSpace(toSymbol, nameof(toSymbol)); this.Exchange = exchange; - this.FromSymbol = fromSymbol; + this.BaseSymbol = fromSymbol; this.SubId = subId; - this.ToSymbol = toSymbol; + this.QuoteSymbol = toSymbol; } public string Exchange { get; } - public string FromSymbol { get; } + public string BaseSymbol { get; } public SubId SubId { get; } - public string ToSymbol { get; } + public string QuoteSymbol { get; } public override string ToString() { - return $"{this.SubId:D}~{this.Exchange}~{this.FromSymbol}~{this.ToSymbol}"; + return $"{this.SubId:D}~{this.Exchange}~{this.BaseSymbol}~{this.QuoteSymbol}"; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopInfo.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopInfo.cs index 9927332..a8034cd 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopInfo.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopInfo.cs @@ -5,9 +5,9 @@ public class TopInfo #nullable disable public string Exchange { get; set; } - public string FromSymbol { get; set; } + public string BaseSymbol { get; set; } - public string ToSymbol { get; set; } + public string QuoteSymbol { get; set; } public decimal Volume24H { get; set; } From 5c41e79e55d511674de00e0f18edcff619a6340a Mon Sep 17 00:00:00 2001 From: TiagoFroisPereira Date: Thu, 20 Apr 2023 11:06:29 +0100 Subject: [PATCH 14/36] Update to .Net 7 Update pipeline to support .net7 --- .github/workflows/dotnet-core.yml | 2 +- .github/workflows/publish.nuget.yml | 2 +- .../Integration/ReadmeDocumentationUpdater.cs | 2 +- .../Clients/CryptoCompareClientTestsBase.cs | 4 +- .../Core/ThrottledHttpClientHandlerTests.cs | 5 +- ...Trakx.CryptoCompare.ApiClient.Tests.csproj | 70 +++++++++---------- .../CryptoCompareWebsocketHandlerTests.cs | 6 +- ...toCompare.ApiClient.Websocket.Tests.csproj | 39 ++++++----- .../Model/Ohlc.cs | 2 +- .../Model/Ticker.cs | 2 +- .../Model/Trade.cs | 2 +- ...x.CryptoCompare.ApiClient.Websocket.csproj | 4 +- .../CryptoCompareApiConfiguration.cs | 2 +- .../Trakx.CryptoCompare.ApiClient.csproj | 6 +- 14 files changed, 73 insertions(+), 75 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 5847918..bc2f09c 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -21,7 +21,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v2 with: - dotnet-version: 6.0.x + dotnet-version: 7.0.x - name: Add github nuget source run: dotnet nuget add source "https://nuget.pkg.github.com/trakx/index.json" --name "github" --username "trakx-bot" --password ${{secrets.TRAKX_BOT_READONLY_PAT}} --store-password-in-clear-text diff --git a/.github/workflows/publish.nuget.yml b/.github/workflows/publish.nuget.yml index 7b104ad..e2e9c51 100644 --- a/.github/workflows/publish.nuget.yml +++ b/.github/workflows/publish.nuget.yml @@ -50,7 +50,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v2 with: - dotnet-version: 6.0.x + dotnet-version: 7.0.x - name: Add github nuget source run: dotnet nuget add source "https://nuget.pkg.github.com/trakx/index.json" --name "github" --username "trakx-bot" --password ${{secrets.TRAKX_BOT_READONLY_PAT}} --store-password-in-clear-text diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/ReadmeDocumentationUpdater.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/ReadmeDocumentationUpdater.cs index fc726e8..1af7e10 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/ReadmeDocumentationUpdater.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/ReadmeDocumentationUpdater.cs @@ -1,4 +1,4 @@ -using Trakx.Utils.Testing.ReadmeUpdater; +using Trakx.Common.Testing.Documentation.ReadmeUpdater; using Xunit.Abstractions; namespace Trakx.CryptoCompare.ApiClient.Tests.Integration diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs index 098efad..e7f5593 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs @@ -1,7 +1,7 @@ using System; using Microsoft.Extensions.DependencyInjection; +using Trakx.Common.Testing.Configuration; using Trakx.CryptoCompare.ApiClient.Rest; -using Trakx.Utils.Testing; using Xunit; namespace Trakx.CryptoCompare.ApiClient.Tests.Integration.Rest.Clients @@ -29,7 +29,7 @@ public class CryptoCompareApiFixture : IDisposable public ICryptoCompareClient CryptoCompareClient { get; } public CryptoCompareApiFixture() { - var configuration = ConfigurationHelper.GetConfigurationFromEnv(); + var configuration = AwsConfigurationHelper.GetConfigurationFromAws(); var services = new ServiceCollection(); services.AddCryptoCompareClient(configuration); var provider = services.BuildServiceProvider(); diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs index 2ae2bea..17336aa 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs @@ -1,9 +1,8 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; -using Microsoft.Extensions.Options; +using Trakx.Common.Testing.Configuration; using Trakx.CryptoCompare.ApiClient.Rest; -using Trakx.Utils.Testing; using Xunit; namespace Trakx.CryptoCompare.ApiClient.Tests.Integration.Rest.Core @@ -16,7 +15,7 @@ public async Task WaitsBetweenQueries() var throttleDelayMs = 200; var queriesCount = 5; - var configuration = ConfigurationHelper.GetConfigurationFromEnv() + var configuration = EnvConfigurationHelper.GetConfigurationFromEnv() with { ThrottleDelayMs = throttleDelayMs }; diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index db03534..6b2aa56 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -1,43 +1,41 @@  - - net6.0 + + net7.0 - false - + false + - + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - - + + + - + \ No newline at end of file diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs index d7e98c9..41e5a4a 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs @@ -5,11 +5,9 @@ using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading.Tasks; +using Trakx.Common.Testing.Configuration; using Trakx.CryptoCompare.ApiClient.Websocket.Extensions; using Trakx.CryptoCompare.ApiClient.Websocket.Model; -using Trakx.Utils.Testing; -using Trakx.Websocket; -using Trakx.Websocket.Interfaces; using Trakx.Websocket.Model; using Xunit; @@ -34,7 +32,7 @@ public IServiceProvider CreateServiceProvider() BufferSize = 4096, MaxSubscriptionsPerScope = 100 }; - var configuration = ConfigurationHelper.GetConfigurationFromEnv() + var configuration = EnvConfigurationHelper.GetConfigurationFromEnv() with { WebSocketBaseUrl = "wss://streamer.cryptocompare.com/v2?api_key=", }; serviceCollection.AddCryptoCompareWebsockets(configuration, websocketConfiguration); diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index c72188a..f9fec8e 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 false @@ -9,24 +9,27 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs index 0318222..8d94a17 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs @@ -1,5 +1,5 @@ using System.Text.Json.Serialization; -using Trakx.Utils.Serialization.Converters; +using Trakx.Common.Serialization.Converters; namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs index c0dd0b1..dec6b3f 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs @@ -1,5 +1,5 @@ using System.Text.Json.Serialization; -using Trakx.Utils.Serialization.Converters; +using Trakx.Common.Serialization.Converters; namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs index 5ba3736..28963a2 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs @@ -1,5 +1,5 @@ using System.Text.Json.Serialization; -using Trakx.Utils.Serialization.Converters; +using Trakx.Common.Serialization.Converters; namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj index 02e1770..560d321 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj @@ -1,14 +1,14 @@  - net6.0 + net7.0 - + diff --git a/src/Trakx.CryptoCompare.ApiClient/CryptoCompareApiConfiguration.cs b/src/Trakx.CryptoCompare.ApiClient/CryptoCompareApiConfiguration.cs index 0bb23eb..daf9ce4 100644 --- a/src/Trakx.CryptoCompare.ApiClient/CryptoCompareApiConfiguration.cs +++ b/src/Trakx.CryptoCompare.ApiClient/CryptoCompareApiConfiguration.cs @@ -1,6 +1,6 @@ using System; using System.Text.Json.Serialization; -using Trakx.Utils.Attributes; +using Trakx.Common.Attributes; namespace Trakx.CryptoCompare.ApiClient { diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 648545b..23f2ebf 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -1,19 +1,19 @@  - net6.0 + net7.0 - + - + From 0c8044b1aedf7b3595cc19785ebfc11eb038d412 Mon Sep 17 00:00:00 2001 From: TiagoFroisPereira Date: Thu, 20 Apr 2023 11:35:53 +0100 Subject: [PATCH 15/36] PUMP Trakx.WebSocket to latest version --- .../Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj | 2 +- .../Trakx.CryptoCompare.ApiClient.Websocket.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index f9fec8e..affbc88 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj index 560d321..181f1ba 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj @@ -9,7 +9,7 @@ - + From dae6f8fed9d6c96f39ab08976a8b41f4543666a9 Mon Sep 17 00:00:00 2001 From: TiagoFroisPereira Date: Thu, 20 Apr 2023 12:16:49 +0100 Subject: [PATCH 16/36] Fix unit test --- README.md | 11 ++++++----- .../Rest/Clients/CryptoCompareClientTestsBase.cs | 2 +- .../Trakx.CryptoCompare.ApiClient.Tests.csproj | 3 +-- .../Integration/CryptoCompareWebsocketHandlerTests.cs | 3 ++- .../ServiceConfiguration.cs | 1 - .../Trakx.CryptoCompare.ApiClient.csproj | 2 -- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1f1f28a..c06e58e 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,6 @@ In order to be able to run some integration tests, you should create a `.env` fi CryptoCompareApiConfiguration__ApiKey=******** ``` -## AWS Parameters -In order to be able to run some integration tests you should ensure that you have access to the following AWS parameters : -```awsParams -/Trakx/CryptoCompare/ApiClient/CryptoCompareApiConfiguration/ApiKey -``` ## Basic usage ````csharp @@ -80,3 +75,9 @@ Console.WriteLine(eth.Data.General.Name); [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjoancaron%2Fcryptocompare-api.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjoancaron%2Fcryptocompare-api?ref=badge_large) + +## AWS Parameters +In order to be able to run some integration tests, you should ensure that you have access to the AWS parameters starting in `/CiCd`. In order for the applications in this solution to run correctly on AWS, please ensure that variables starting in `/[environment]` are defined for all 3 environments \( _Production_, _Staging_, _Development_ \) : +```awsParams +/[environment]/Trakx/CryptoCompare/ApiClient/CryptoCompareApiConfiguration/ApiKey +``` \ No newline at end of file diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs index e7f5593..a4cd66f 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs @@ -29,7 +29,7 @@ public class CryptoCompareApiFixture : IDisposable public ICryptoCompareClient CryptoCompareClient { get; } public CryptoCompareApiFixture() { - var configuration = AwsConfigurationHelper.GetConfigurationFromAws(); + var configuration = EnvConfigurationHelper.GetConfigurationFromEnv(); var services = new ServiceCollection(); services.AddCryptoCompareClient(configuration); var provider = services.BuildServiceProvider(); diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index 6b2aa56..df69253 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -1,8 +1,7 @@  - net7.0 - + net7.0 false diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs index 41e5a4a..40ab0ee 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs @@ -1,6 +1,7 @@ using FluentAssertions; using Microsoft.Extensions.DependencyInjection; using System; +using System.Globalization; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; @@ -66,7 +67,7 @@ public async Task Should_be_able_to_get_full_top_tier_volume_subscriptions() var result = await GetResult(CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("btc")) .ConfigureAwait(false); result!.Symbol.Should().Be("BTC"); - decimal.Parse(result.Volume).Should().BeGreaterThan(0); + decimal.Parse(result.Volume,CultureInfo.InvariantCulture).Should().BeGreaterThan(0); } [Fact] diff --git a/src/Trakx.CryptoCompare.ApiClient/ServiceConfiguration.cs b/src/Trakx.CryptoCompare.ApiClient/ServiceConfiguration.cs index faf90a7..c08033e 100644 --- a/src/Trakx.CryptoCompare.ApiClient/ServiceConfiguration.cs +++ b/src/Trakx.CryptoCompare.ApiClient/ServiceConfiguration.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; using Trakx.CryptoCompare.ApiClient.Rest; namespace Trakx.CryptoCompare.ApiClient diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 23f2ebf..867983d 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -11,8 +11,6 @@ - - From 85323d62f7bf114ef80020476abc840b06d1e846 Mon Sep 17 00:00:00 2001 From: TiagoFroisPereira Date: Thu, 20 Apr 2023 12:32:01 +0100 Subject: [PATCH 17/36] Update pipeline --- .github/workflows/automerge.yml | 17 +++++++ .github/workflows/delete.packages.yml | 27 +++++++++++ .github/workflows/nuget.yml | 65 +++++++++++++++++++++++++++ .github/workflows/test.yml | 22 +++++++++ 4 files changed, 131 insertions(+) create mode 100644 .github/workflows/automerge.yml create mode 100644 .github/workflows/delete.packages.yml create mode 100644 .github/workflows/nuget.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..43617c6 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,17 @@ +name: Auto Merge Dependabot Requests + +on: pull_request_target + +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Merge non major updates + uses: trakx/github-actions/dependabot-automerge@v10.0.9 + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/delete.packages.yml b/.github/workflows/delete.packages.yml new file mode 100644 index 0000000..26ce63c --- /dev/null +++ b/.github/workflows/delete.packages.yml @@ -0,0 +1,27 @@ +name: Delete old packages + +on: + workflow_dispatch: + inputs: + name: + description: 'The name of the package to be deleted.' + required: true + num-old-versions-to-delete: + description: 'The number of old versions to delete starting from the oldest version.' + default: '1' + required: false + +jobs: + + delete: + + runs-on: ubuntu-latest + + steps: + - name: Delete packages + id: deletePackages + uses: actions/delete-package-versions@v3 + with: + package-name: '${{github.event.inputs.name}}' + num-old-versions-to-delete: ${{github.event.inputs.num-old-versions-to-delete}} + diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml new file mode 100644 index 0000000..d1c6c01 --- /dev/null +++ b/.github/workflows/nuget.yml @@ -0,0 +1,65 @@ +name: Publish Nuget Packages + +on: + + # the workflow run allows to not run the test suite twice for non release + # branches, and should be used for all branches, but the reference branch + # in workflow run is the default branch and we don't get the correct release + # tags when it is triggered from release branches like stage and dev. + workflow_run: + workflows: ["Build and Test"] + types: [completed] + branches-ignore: [ stage, master ] + + # so we treat these releases branches specially, using the push trigger directly. + push: + branches: [ stage, master ] + + workflow_dispatch: + inputs: + semverIncrementLevel: + description: "Level of the semver (major.minor.patch) to be increased to get the new package version." + required: false + default: "patch" + debuggable: + description: "Set to false if you want a non debuggable (Release) package." + required: false + default: "true" + +jobs: + + test: + uses: ./.github/workflows/test.yml + if: ${{ github.event_name != 'workflow_run' }} + secrets: inherit + + publish: + + needs: [test] + runs-on: ubuntu-latest + if: | + always() && + (needs.test.result == 'success' || (needs.test.result == 'skipped' + && github.event_name == 'workflow_run' + && github.event.workflow_run.conclusion == 'success' )) + + steps: + - name: Default input values + id: default-inputs + run: | + debuggable="${{github.event.inputs.debuggable}}" + debuggable=${debuggable:-true} + echo '::set-output name=debuggable::'$debuggable + + semverIncrementLevel="${{github.event.inputs.semverIncrementLevel}}" + semverIncrementLevel=${semverIncrementLevel:-true} + echo '::set-output name=semverIncrementLevel::'$semverIncrementLevel + + - name: Build and publish nuget packages + id: publish + uses: trakx/github-actions/publish-nuget@v10.0.9 + with: + packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} + githubToken: ${{secrets.GITHUB_TOKEN}} + debuggable: ${{steps.default-inputs.outputs.debuggable}} + semverIncrementLevel: ${{steps.default-inputs.outputs.semverIncrementLevel}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5dddacd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +name: Build and Test + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev, stage, master ] + workflow_call: + +jobs: + + test: + runs-on: ubuntu-latest + steps: + - name: Test and cover solutions + id: test + uses: trakx/github-actions/test-dotnet@v10.0.9 + with: + packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} + codacyToken: ${{secrets.CODACY_TOKEN}} + awsAccessKeyId: ${{secrets.AWS_ACCESS_KEY_ID}} + awsAccessKeySecret: ${{secrets.AWS_ACCESS_KEY_SECRET}} From 5d48f8b8297a88a624618b320a8c9254bd9b27c9 Mon Sep 17 00:00:00 2001 From: Tiago Pereira Date: Thu, 20 Apr 2023 12:32:24 +0100 Subject: [PATCH 18/36] Update src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs Co-authored-by: Emanuel Gaspar --- .../Integration/CryptoCompareWebsocketHandlerTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs index 40ab0ee..b08a544 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs @@ -67,7 +67,8 @@ public async Task Should_be_able_to_get_full_top_tier_volume_subscriptions() var result = await GetResult(CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("btc")) .ConfigureAwait(false); result!.Symbol.Should().Be("BTC"); - decimal.Parse(result.Volume,CultureInfo.InvariantCulture).Should().BeGreaterThan(0); + decimal.TryParse(result.Volume, CultureInfo.InvariantCulture, out decimal volume); + volume.Should().BeGreaterThan(0); } [Fact] From 5be5fc143bf0ba35ad24042706877f51c25c1af7 Mon Sep 17 00:00:00 2001 From: Tiago Pereira Date: Thu, 20 Apr 2023 12:44:41 +0100 Subject: [PATCH 19/36] Update .github/workflows/automerge.yml Co-authored-by: Emanuel Gaspar --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 43617c6..2e935c2 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -12,6 +12,6 @@ jobs: if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Merge non major updates - uses: trakx/github-actions/dependabot-automerge@v10.0.9 + uses: trakx/github-actions/dependabot-automerge@v10.0.11 with: githubToken: ${{ secrets.GITHUB_TOKEN }} From 558d8214b22d0749ac1d22c02d6921739a77a70c Mon Sep 17 00:00:00 2001 From: Tiago Pereira Date: Thu, 20 Apr 2023 12:44:46 +0100 Subject: [PATCH 20/36] Update .github/workflows/nuget.yml Co-authored-by: Emanuel Gaspar --- .github/workflows/nuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index d1c6c01..6d17d86 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -57,7 +57,7 @@ jobs: - name: Build and publish nuget packages id: publish - uses: trakx/github-actions/publish-nuget@v10.0.9 + uses: trakx/github-actions/publish-nuget@v10.0.11 with: packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} githubToken: ${{secrets.GITHUB_TOKEN}} From d037cc8f2bd2024cf6d18e50d6c107c457aa7f8b Mon Sep 17 00:00:00 2001 From: TiagoFroisPereira Date: Thu, 20 Apr 2023 12:53:03 +0100 Subject: [PATCH 21/36] fix issue in pipeline --- .github/workflows/automerge.yml | 2 +- .github/workflows/dotnet-core.yml | 56 ----------------- .github/workflows/nuget.yml | 8 +-- .github/workflows/publish.nuget.yml | 94 ----------------------------- .github/workflows/test.yml | 2 +- 5 files changed, 6 insertions(+), 156 deletions(-) delete mode 100644 .github/workflows/dotnet-core.yml delete mode 100644 .github/workflows/publish.nuget.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 43617c6..2e935c2 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -12,6 +12,6 @@ jobs: if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Merge non major updates - uses: trakx/github-actions/dependabot-automerge@v10.0.9 + uses: trakx/github-actions/dependabot-automerge@v10.0.11 with: githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml deleted file mode 100644 index bc2f09c..0000000 --- a/.github/workflows/dotnet-core.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: .NET Core - -on: - push: - branches: [ dev, master ] - pull_request: - branches: [ dev, master ] - -env: - SOLUTION_PATH: "src/Trakx.CryptoCompare.ApiClient.sln" - CryptoCompareApiConfiguration__ApiKey: ${{secrets.CRYPTOCOMPARE_API_KEY}} - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 7.0.x - - - name: Add github nuget source - run: dotnet nuget add source "https://nuget.pkg.github.com/trakx/index.json" --name "github" --username "trakx-bot" --password ${{secrets.TRAKX_BOT_READONLY_PAT}} --store-password-in-clear-text - - - name: Install dependencies - run: dotnet restore ${{env.SOLUTION_PATH}} - - - name: Remove github source - run: dotnet nuget remove source "github" - - - name: Build - run: | - dotnet build ${{env.SOLUTION_PATH}} --configuration Debug --no-restore - - name: Test & Coverage - run: | - for f in ./src/*.Tests/*.Tests.csproj; do echo "testing project $f" && \ - dotnet test $f --configuration Debug --no-restore --logger GitHubActions --verbosity normal\ - /p:CollectCoverage=true \ - /p:CoverletOutputFormat=opencover \ - /p:UserSourceLink=true \ - /p:ExcludeByAttribute=\"Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute\" \ - /p:Include=\"[Trakx.*]*\"; \ - done - - - name: Publish Coverage - env: - CODACY_PROJECT_TOKEN: ${{secrets.CODACY_TOKEN}} - run: | - for f in ./src/*.Tests/coverage.opencover.xml; do echo "sending coverage report $f" && \ - bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l csharp -r $f --partial --commit-uuid ${{github.sha}}; \ - done - bash <(curl -Ls https://coverage.codacy.com/get.sh) final --commit-uuid ${{github.sha}} diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index d1c6c01..d09ff85 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -49,17 +49,17 @@ jobs: run: | debuggable="${{github.event.inputs.debuggable}}" debuggable=${debuggable:-true} - echo '::set-output name=debuggable::'$debuggable + echo "debuggable=$debuggable" >> $GITHUB_OUTPUT semverIncrementLevel="${{github.event.inputs.semverIncrementLevel}}" semverIncrementLevel=${semverIncrementLevel:-true} - echo '::set-output name=semverIncrementLevel::'$semverIncrementLevel + echo "semverIncrementLevel=$semverIncrementLevel" >> $GITHUB_OUTPUT - name: Build and publish nuget packages id: publish - uses: trakx/github-actions/publish-nuget@v10.0.9 + uses: trakx/github-actions/publish-nuget@v10.0.11 with: packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} githubToken: ${{secrets.GITHUB_TOKEN}} debuggable: ${{steps.default-inputs.outputs.debuggable}} - semverIncrementLevel: ${{steps.default-inputs.outputs.semverIncrementLevel}} + semverIncrementLevel: ${{steps.default-inputs.outputs.semverIncrementLevel}} \ No newline at end of file diff --git a/.github/workflows/publish.nuget.yml b/.github/workflows/publish.nuget.yml deleted file mode 100644 index e2e9c51..0000000 --- a/.github/workflows/publish.nuget.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Publish nuget package - -on: - workflow_dispatch: - inputs: - semverIncrementLevel: - description: 'Level of the semver (major.minor.patch) to be increased to get the new package version.' - required: true - default: 'patch' - push: - branches: - - master - -env: - SOLUTION_PATH: "src/Trakx.CryptoCompare.ApiClient.sln" - PROJECT_PATH: "src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj" - PROJECT_WEBSOCKET_PATH: "src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj" - CryptoCompareApiConfiguration__ApiKey: ${{secrets.CRYPTOCOMPARE_API_KEY}} - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - - name: Set compilation mode - id: comp-mode - run: | - DEBUGGABLE="${{github.event.inputs.debuggable}}" - DEBUGGABLE=${DEBUGGABLE:-true} - if [ [DEBUGGABLE == f*] -o [DEBUGGABLE == F*] ]; then - COMP_MODE=Release - else - COMP_MODE=Debug - fi - echo '::set-output name=compilationMode::'$COMP_MODE - echo "compilation mode set to ${{steps.comp-mode.outputs.compilationMode}}" - - - name: checkout - uses: actions/checkout@v3 - - - name: Bump version - id: bumpVersion - uses: trakx/bump-version-action/get-tag@v9.1.1 - with: - semverIncrementLevel: ${{github.event.inputs.semverIncrementLevel}} - - - name: Setup .NET Core - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 7.0.x - - - name: Add github nuget source - run: dotnet nuget add source "https://nuget.pkg.github.com/trakx/index.json" --name "github" --username "trakx-bot" --password ${{secrets.TRAKX_BOT_READONLY_PAT}} --store-password-in-clear-text - - - name: Install dependencies - run: dotnet restore ${{env.SOLUTION_PATH}} - - - name: Remove github source - run: dotnet nuget remove source "github" - - - name: Build - run: | - dotnet build ${{env.SOLUTION_PATH}} \ - --configuration ${{steps.comp-mode.outputs.compilationMode}} \ - -p:Version=${{steps.bumpVersion.outputs.assemblyVersion}} \ - -p:SourceRevisionId=${{steps.bumpVersion.outputs.productVersion}} \ - --no-restore - - - name: Test - run: dotnet test ${{env.SOLUTION_PATH}} --no-restore --verbosity normal - - - name: Package - run: | - dotnet pack ${{env.PROJECT_PATH}} --no-build --configuration ${{ steps.comp-mode.outputs.compilationMode }} \ - --output ./nuget/ -p:PackageVersion=${{ steps.bumpVersion.outputs.fullVersion }} --include-symbols --include-source - dotnet pack ${{env.PROJECT_WEBSOCKET_PATH}} --no-build --configuration ${{ steps.comp-mode.outputs.compilationMode }} \ - --output ./nuget/ -p:PackageVersion=${{ steps.bumpVersion.outputs.fullVersion }} --include-symbols --include-source - - - name: Publish - # https://github.com/NuGet/Home/issues/8580 - run: | - ls ./nuget/*.nupkg - for f in ./nuget/*.symbols.nupkg; do echo "pushing $f file.." && dotnet nuget push $f --api-key ${{secrets.GITHUB_TOKEN}} \ - --source "https://nuget.pkg.github.com/trakx/index.json"; done - - - name: Push version tag - id: pushTag - uses: trakx/bump-version-action/push-tag@v9.1.1 - with: - tag: v${{steps.bumpVersion.outputs.fullVersion}} - githubToken: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5dddacd..c6754f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Test and cover solutions id: test - uses: trakx/github-actions/test-dotnet@v10.0.9 + uses: trakx/github-actions/test-dotnet@v10.0.11 with: packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} codacyToken: ${{secrets.CODACY_TOKEN}} From a984cad2888ec96239a039eeb6d94cc82a6d3db3 Mon Sep 17 00:00:00 2001 From: TiagoFroisPereira Date: Thu, 20 Apr 2023 12:55:51 +0100 Subject: [PATCH 22/36] Update to get the configuration in test from AWS --- .../Integration/Rest/Clients/CryptoCompareClientTestsBase.cs | 2 +- .../Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs | 5 +++-- .../Integration/CryptoCompareWebsocketHandlerTests.cs | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs index a4cd66f..e7f5593 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs @@ -29,7 +29,7 @@ public class CryptoCompareApiFixture : IDisposable public ICryptoCompareClient CryptoCompareClient { get; } public CryptoCompareApiFixture() { - var configuration = EnvConfigurationHelper.GetConfigurationFromEnv(); + var configuration = AwsConfigurationHelper.GetConfigurationFromAws(); var services = new ServiceCollection(); services.AddCryptoCompareClient(configuration); var provider = services.BuildServiceProvider(); diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs index 17336aa..b06a275 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs @@ -15,8 +15,9 @@ public async Task WaitsBetweenQueries() var throttleDelayMs = 200; var queriesCount = 5; - var configuration = EnvConfigurationHelper.GetConfigurationFromEnv() - with { + var configuration = AwsConfigurationHelper.GetConfigurationFromAws() + with + { ThrottleDelayMs = throttleDelayMs }; var client = new CryptoCompareClient(configuration); diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs index b08a544..f737ca7 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs @@ -33,8 +33,9 @@ public IServiceProvider CreateServiceProvider() BufferSize = 4096, MaxSubscriptionsPerScope = 100 }; - var configuration = EnvConfigurationHelper.GetConfigurationFromEnv() - with { WebSocketBaseUrl = "wss://streamer.cryptocompare.com/v2?api_key=", }; + var configuration = AwsConfigurationHelper.GetConfigurationFromAws() + with + { WebSocketBaseUrl = "wss://streamer.cryptocompare.com/v2?api_key=", }; serviceCollection.AddCryptoCompareWebsockets(configuration, websocketConfiguration); return serviceCollection.BuildServiceProvider(); From 521626ef647f6aa7bae0f3e835f91812ed2944da Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Tue, 23 May 2023 12:29:14 +0100 Subject: [PATCH 23/36] refactor: explicit method and strongly typed deserialize when AddInternalAsync is called with SubRemove --- .../CryptoCompareWebsocketHandler.cs | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs index f7d8937..9148e1f 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs @@ -1,10 +1,10 @@ -using Microsoft.Extensions.Options; -using Serilog; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text.Json; using System.Threading.Tasks; +using Serilog; +using Trakx.Common.Extensions; using Trakx.CryptoCompare.ApiClient.Websocket.Model; using Trakx.Websocket; using Trakx.Websocket.Interfaces; @@ -16,12 +16,12 @@ public class CryptoCompareWebsocketHandler : ClientWebsocketRedirectHandlerBase< { private readonly CryptoCompareApiConfiguration _config; - public CryptoCompareWebsocketHandler(WebsocketConfiguration websocketConfigurationOption, + public CryptoCompareWebsocketHandler( + WebsocketConfiguration websocketConfigurationOption, CryptoCompareApiConfiguration config, IClientWebsocketFactory clientWebsocketFactory, - TaskScheduler taskScheduler = null) : base( - websocketConfigurationOption - , clientWebsocketFactory, taskScheduler) + TaskScheduler? taskScheduler = null) + : base(websocketConfigurationOption, clientWebsocketFactory, taskScheduler) { _config = config; } @@ -48,7 +48,7 @@ public CryptoCompareWebsocketHandler(WebsocketConfiguration websocketConfigurati protected override object? DeserializeClientSocketIncoming(string topic, IncomingMessage m) { - var typeStr = m.DeserializedMessage?.Type ?? null; + var typeStr = m.DeserializedMessage?.Type; if (typeStr != null && MessageTypesByTopics.ContainsKey(typeStr)) { var type = MessageTypesByTopics[typeStr]; @@ -61,30 +61,30 @@ public CryptoCompareWebsocketHandler(WebsocketConfiguration websocketConfigurati protected override async Task AddInternalAsync(TopicSubscription subscription) { - var jDoc = JsonDocument.Parse(subscription.Topic); - JsonProperty? unsubProperties = jDoc.RootElement.EnumerateObject().Any(t => t.Name.Equals("action", StringComparison.InvariantCultureIgnoreCase) - && t.Value.GetString().Equals("SubRemove", StringComparison.InvariantCultureIgnoreCase)) ? - jDoc.RootElement.EnumerateObject().FirstOrDefault(t => t.Name == "subs") - : null; - if (unsubProperties != null) + if (subscription.Topic.ContainsIgnoreCase(SubscribeActions.SubRemove.ToString())) { - var unsubArrayLength = unsubProperties.Value.Value.GetArrayLength(); - for (int i = 0; i < unsubArrayLength; i++) - { - var unsubElement = unsubProperties.Value.Value[i].GetString(); - var toRemoveSubs = Subscriptions.Where(t => t.Topic.Contains(unsubElement, StringComparison.InvariantCultureIgnoreCase)) - .ToList(); - if (toRemoveSubs.Any()) - { - await this.RemoveAsync(toRemoveSubs); - } - } - SendClient(subscription.Topic); - return true; + return await RemovePrivateAsync(subscription); } - return await base.AddInternalAsync(subscription); } + private async Task RemovePrivateAsync(TopicSubscription subscription) + { + var payload = JsonSerializer.Deserialize(subscription.Topic); + + if (payload == null) return false; + if (payload.Action != SubscribeActions.SubRemove) return false; + + foreach (var item in payload.Subs) + { + var toRemoveSubs = Subscriptions.Where(t => t.Topic.ContainsIgnoreCase(item)); + if (!toRemoveSubs.Any()) continue; + await this.RemoveAsync(toRemoveSubs.ToList()); + } + + SendClient(subscription.Topic); + return true; + } + protected override Uri ClientSocketUri => _config.WebSocketEndpoint; } From 32b7700fcfd27ebfb4cefe076f3952c70cfc67a4 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Tue, 23 May 2023 12:48:29 +0100 Subject: [PATCH 24/36] chore: version bumps --- .github/workflows/dotnet-core.yml | 2 +- .github/workflows/publish.nuget.yml | 6 +++--- .../Trakx.CryptoCompare.ApiClient.Tests.csproj | 9 ++++----- .../Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj | 6 +++--- .../Trakx.CryptoCompare.ApiClient.Websocket.csproj | 2 +- .../Trakx.CryptoCompare.ApiClient.csproj | 4 ++-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index bc2f09c..0daf4da 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup .NET Core - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x diff --git a/.github/workflows/publish.nuget.yml b/.github/workflows/publish.nuget.yml index e2e9c51..defa601 100644 --- a/.github/workflows/publish.nuget.yml +++ b/.github/workflows/publish.nuget.yml @@ -43,12 +43,12 @@ jobs: - name: Bump version id: bumpVersion - uses: trakx/bump-version-action/get-tag@v9.1.1 + uses: trakx/bump-version-action/get-tag@v10.0.14 with: semverIncrementLevel: ${{github.event.inputs.semverIncrementLevel}} - name: Setup .NET Core - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x @@ -88,7 +88,7 @@ jobs: - name: Push version tag id: pushTag - uses: trakx/bump-version-action/push-tag@v9.1.1 + uses: trakx/bump-version-action/push-tag@v10.0.14 with: tag: v${{steps.bumpVersion.outputs.fullVersion}} githubToken: ${{secrets.GITHUB_TOKEN}} diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index df69253..dd72366 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -16,15 +16,15 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + all @@ -33,8 +33,7 @@ - + \ No newline at end of file diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index affbc88..1d6b7bf 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -18,7 +18,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -28,8 +28,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj index 181f1ba..edfae1b 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 867983d..905ca71 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -9,9 +9,9 @@ - + - + From 38f17afb4531879bd36c9ef14d5b953aa712e606 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Tue, 23 May 2023 13:16:31 +0100 Subject: [PATCH 25/36] chore: testing coverlet bump to v6 --- .../Trakx.CryptoCompare.ApiClient.Tests.csproj | 4 ++-- .../Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index dd72366..4e092f7 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -8,11 +8,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index 1d6b7bf..3dcda7f 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -10,11 +10,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all From ac734d311528f75dbd76d94446c88f61d19a0b3a Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Tue, 23 May 2023 14:37:50 +0100 Subject: [PATCH 26/36] feat: explicit RemoveAsync with single TopicSubscription; more test coverage --- .../CryptoCompareWebsocketHandlerTests.cs | 77 +++++++++++++++---- .../CryptoCompareWebsocketHandler.cs | 24 ++++-- .../ICryptoCompareWebsocketHandler.cs | 7 +- 3 files changed, 84 insertions(+), 24 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Unit/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Unit/CryptoCompareWebsocketHandlerTests.cs index 3745171..83a8a51 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Unit/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Unit/CryptoCompareWebsocketHandlerTests.cs @@ -1,12 +1,11 @@ -using FluentAssertions; -using Microsoft.Extensions.Options; -using NSubstitute; using System; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Text.Json; using System.Threading.Tasks; +using FluentAssertions; +using NSubstitute; using Trakx.CryptoCompare.ApiClient.Websocket.Model; using Trakx.Websocket.Interfaces; using Trakx.Websocket.Model; @@ -20,10 +19,15 @@ public class CryptoCompareWebsocketHandlerTests { private readonly TestWebsocketClient _testClient; private readonly CryptoCompareWebsocketHandler _websocketHandler; + private readonly TopicSubscription _topicSub; + private readonly TopicSubscription _removeSub; + + private int SubscriptionCount => _websocketHandler.CurrentSubscriptions.Count; public CryptoCompareWebsocketHandlerTests() { _testClient = Substitute.ForPartsOf(); + var fakeConfiguration = new WebsocketConfiguration { BufferSize = 4092, @@ -33,35 +37,70 @@ public CryptoCompareWebsocketHandlerTests() var fakeWebsocketFactory = Substitute.For(); fakeWebsocketFactory.CreateNewWebSocket(Arg.Any(), Arg.Any>()) .Returns(_testClient); + var fakeFinexConfig = new CryptoCompareApiConfiguration() { WebSocketBaseUrl = "https://www.google.com" }; _websocketHandler = new CryptoCompareWebsocketHandler(fakeConfiguration, fakeFinexConfig, fakeWebsocketFactory); + + _topicSub = SetupTopicSubscription(SubscribeActions.SubAdd); + _removeSub = SetupTopicSubscription(SubscribeActions.SubRemove); } [Fact] - public async Task AddAsync_should_remove_subscription_on_sub_remove() + public async Task AddAsync_sends_message_to_client() { - var topicSub = CryptoCompareSubscriptionFactory.GetTopicSubscription(SubscribeActions.SubAdd, - CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("test")); - var removeSub = CryptoCompareSubscriptionFactory.GetTopicSubscription(SubscribeActions.SubRemove, - CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("test")); - await _websocketHandler.AddAsync(topicSub); - _websocketHandler.CurrentSubscriptions.Count.Should().Be(1); - await _websocketHandler.AddAsync(removeSub); - _websocketHandler.CurrentSubscriptions.Count.Should().Be(0); + await _websocketHandler.AddAsync(_topicSub); + _testClient.Received(1).Send(_topicSub.Topic); + } + + [Fact] + public async Task RemoveAsync_sends_message_to_client() + { + // this call is needed to "open" the channel + await _websocketHandler.AddAsync(_topicSub); + + await _websocketHandler.RemoveAsync(_removeSub); + + _testClient.Received(1).Send(_removeSub.Topic); + } + + [Fact] + public async Task AddAsync_removes_subscription_on_sub_remove() + { + await _websocketHandler.AddAsync(_topicSub); + SubscriptionCount.Should().Be(1); + + await _websocketHandler.AddAsync(_removeSub); + SubscriptionCount.Should().Be(0); + } + + [Fact] + public async Task RemoveAsync_only_removes_subscription_with_valid_topic() + { + await _websocketHandler.AddAsync(_topicSub); + SubscriptionCount.Should().Be(1); + + // no changes because it doesn't have the SubRemove action + await _websocketHandler.RemoveAsync(_topicSub); + SubscriptionCount.Should().Be(1); + + await _websocketHandler.RemoveAsync(_removeSub); + SubscriptionCount.Should().Be(0); + + // only 2 message should have been sent, the first Add and the valid Remove + _testClient.Received(1).Send(_topicSub.Topic); + _testClient.Received(1).Send(_removeSub.Topic); } [Fact] public async Task IncomingMessage_should_map_to_correct_observer() { - var topicSub = CryptoCompareSubscriptionFactory.GetTopicSubscription(SubscribeActions.SubAdd, - CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("test")); - await _websocketHandler.AddAsync(topicSub); + await _websocketHandler.AddAsync(_topicSub); - var topicMessageTask = _websocketHandler.GetTopicMessageStream(topicSub.Topic) + var topicMessageTask = _websocketHandler.GetTopicMessageStream(_topicSub.Topic) .Buffer(TimeSpan.FromSeconds(5), 1) .Select(t => t.FirstOrDefault()) .FirstOrDefaultAsync() @@ -75,4 +114,10 @@ public async Task IncomingMessage_should_map_to_correct_observer() topicMessage!.Symbol.Should().Be(fullVolumeMsg.Symbol); topicMessage!.Volume.Should().Be(fullVolumeMsg.Volume); } + + private static TopicSubscription SetupTopicSubscription(SubscribeActions action) + { + var subscriptionString = CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("test"); + return CryptoCompareSubscriptionFactory.GetTopicSubscription(action, subscriptionString); + } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs index 9148e1f..76efc5f 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs @@ -26,6 +26,8 @@ public CryptoCompareWebsocketHandler( _config = config; } + protected override Uri ClientSocketUri => _config.WebSocketEndpoint; + protected override IReadOnlyDictionary MessageTypesByTopics => new Dictionary { { "0", typeof(Trade) }, @@ -61,14 +63,14 @@ public CryptoCompareWebsocketHandler( protected override async Task AddInternalAsync(TopicSubscription subscription) { - if (subscription.Topic.ContainsIgnoreCase(SubscribeActions.SubRemove.ToString())) + if (HasRemoveAction(subscription)) { - return await RemovePrivateAsync(subscription); + return await RemoveAsync(subscription); } return await base.AddInternalAsync(subscription); } - private async Task RemovePrivateAsync(TopicSubscription subscription) + public async Task RemoveAsync(TopicSubscription subscription) { var payload = JsonSerializer.Deserialize(subscription.Topic); @@ -77,14 +79,22 @@ private async Task RemovePrivateAsync(TopicSubscription subscription) foreach (var item in payload.Subs) { - var toRemoveSubs = Subscriptions.Where(t => t.Topic.ContainsIgnoreCase(item)); - if (!toRemoveSubs.Any()) continue; - await this.RemoveAsync(toRemoveSubs.ToList()); + var toRemoveSubs = Subscriptions.Where(t => t.Topic.ContainsIgnoreCase(item)).ToList(); + foreach (var unwanted in toRemoveSubs) + { + Subscriptions.Remove(unwanted); + } } SendClient(subscription.Topic); + + await Task.CompletedTask; return true; } - protected override Uri ClientSocketUri => _config.WebSocketEndpoint; + private static bool HasRemoveAction(TopicSubscription subscription) + { + var remove = SubscribeActions.SubRemove.ToString(); + return subscription.Topic.ContainsIgnoreCase(remove); + } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/ICryptoCompareWebsocketHandler.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/ICryptoCompareWebsocketHandler.cs index fa84710..c839f18 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/ICryptoCompareWebsocketHandler.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/ICryptoCompareWebsocketHandler.cs @@ -1,8 +1,13 @@ -using Trakx.CryptoCompare.ApiClient.Websocket.Model; +using System.Threading.Tasks; +using Trakx.CryptoCompare.ApiClient.Websocket.Model; using Trakx.Websocket.Interfaces; +using Trakx.Websocket.Model; namespace Trakx.CryptoCompare.ApiClient.Websocket; public interface ICryptoCompareWebsocketHandler : IClientWebsocketRedirectHandler { + /// Removes the specified session subscription. + /// The subscription. + Task RemoveAsync(TopicSubscription subscription); } From d4a78c4c4a4c6f3c49500b30d9d38c1438c71c9c Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Wed, 24 May 2023 13:10:26 +0100 Subject: [PATCH 27/36] Gonen's feedback (thanks) --- .../Unit/CryptoCompareWebsocketHandlerTests.cs | 6 ++++-- .../CryptoCompareWebsocketHandler.cs | 15 +++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Unit/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Unit/CryptoCompareWebsocketHandlerTests.cs index 83a8a51..04e5f87 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Unit/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Unit/CryptoCompareWebsocketHandlerTests.cs @@ -17,6 +17,8 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Tests.Unit; public class CryptoCompareWebsocketHandlerTests { + private const string TestSymbol = "btc"; + private readonly TestWebsocketClient _testClient; private readonly CryptoCompareWebsocketHandler _websocketHandler; private readonly TopicSubscription _topicSub; @@ -105,7 +107,7 @@ public async Task IncomingMessage_should_map_to_correct_observer() .Select(t => t.FirstOrDefault()) .FirstOrDefaultAsync() .ToTask(); - var fullVolumeMsg = new FullVolume { Type = "11", Volume = 1, Symbol = "BTC" }; + var fullVolumeMsg = new FullVolume { Type = "11", Volume = 1, Symbol = TestSymbol }; var fakeMsg = JsonSerializer.Serialize(fullVolumeMsg); _testClient.StreamFakeMessage(ResponseMessage.TextMessage(fakeMsg)); @@ -117,7 +119,7 @@ public async Task IncomingMessage_should_map_to_correct_observer() private static TopicSubscription SetupTopicSubscription(SubscribeActions action) { - var subscriptionString = CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("test"); + var subscriptionString = CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr(TestSymbol); return CryptoCompareSubscriptionFactory.GetTopicSubscription(action, subscriptionString); } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs index 76efc5f..d0c5645 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/CryptoCompareWebsocketHandler.cs @@ -77,9 +77,9 @@ public async Task RemoveAsync(TopicSubscription subscription) if (payload == null) return false; if (payload.Action != SubscribeActions.SubRemove) return false; - foreach (var item in payload.Subs) + foreach (var payloadSub in payload.Subs) { - var toRemoveSubs = Subscriptions.Where(t => t.Topic.ContainsIgnoreCase(item)).ToList(); + var toRemoveSubs = Subscriptions.Where(t => t.Topic.ContainsIgnoreCase(payloadSub)).ToList(); foreach (var unwanted in toRemoveSubs) { Subscriptions.Remove(unwanted); @@ -92,9 +92,16 @@ public async Task RemoveAsync(TopicSubscription subscription) return true; } + /// + /// The for + /// has a payload of type . + /// This method checks if the in the payload is . + /// It's a fast string-based check, using the string representation of the enum. + /// The slower alternative would be parsing the JSON payload. + /// private static bool HasRemoveAction(TopicSubscription subscription) { - var remove = SubscribeActions.SubRemove.ToString(); - return subscription.Topic.ContainsIgnoreCase(remove); + var subRemoveAsString = SubscribeActions.SubRemove.ToString(); + return subscription.Topic.ContainsIgnoreCase(subRemoveAsString); } } From 5c9fdc47f418ff0d7646352747ea76a55a0fc44a Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Wed, 24 May 2023 14:39:38 +0100 Subject: [PATCH 28/36] ensure configuration is loaded from AWS, from CiCd or Development --- .../Clients/CryptoCompareClientTestsBase.cs | 10 ++++++++- .../Core/ThrottledHttpClientHandlerTests.cs | 5 +++-- .../CryptoCompareWebsocketHandlerTests.cs | 15 ++++++------- .../CryptoCompareApiConfiguration.cs | 22 ++++++++----------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs index e7f5593..19390ef 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs @@ -29,13 +29,21 @@ public class CryptoCompareApiFixture : IDisposable public ICryptoCompareClient CryptoCompareClient { get; } public CryptoCompareApiFixture() { - var configuration = AwsConfigurationHelper.GetConfigurationFromAws(); + CryptoCompareApiConfiguration configuration = LoadConfiguration(); + var services = new ServiceCollection(); services.AddCryptoCompareClient(configuration); var provider = services.BuildServiceProvider(); CryptoCompareClient = provider.GetRequiredService(); } + public static CryptoCompareApiConfiguration LoadConfiguration() + { + return AwsConfigurationHelper.GetConfigurationFromAws() + ?? AwsConfigurationHelper.GetConfigurationFromAws("Development") + ?? throw new InvalidOperationException("Unable to load configuration from AWS"); + } + protected virtual void Dispose(bool disposing) { if (!disposing) return; diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs index b06a275..adc8aee 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Core/ThrottledHttpClientHandlerTests.cs @@ -1,8 +1,8 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; -using Trakx.Common.Testing.Configuration; using Trakx.CryptoCompare.ApiClient.Rest; +using Trakx.CryptoCompare.ApiClient.Tests.Integration.Rest.Clients; using Xunit; namespace Trakx.CryptoCompare.ApiClient.Tests.Integration.Rest.Core @@ -15,11 +15,12 @@ public async Task WaitsBetweenQueries() var throttleDelayMs = 200; var queriesCount = 5; - var configuration = AwsConfigurationHelper.GetConfigurationFromAws() + var configuration = CryptoCompareApiFixture.LoadConfiguration() with { ThrottleDelayMs = throttleDelayMs }; + var client = new CryptoCompareClient(configuration); var stopWatch = new Stopwatch(); diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs index f737ca7..4e4ed4d 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs @@ -1,12 +1,12 @@ -using FluentAssertions; -using Microsoft.Extensions.DependencyInjection; -using System; +using System; using System.Globalization; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; using System.Threading.Tasks; -using Trakx.Common.Testing.Configuration; +using FluentAssertions; +using Microsoft.Extensions.DependencyInjection; +using Trakx.CryptoCompare.ApiClient.Tests.Integration.Rest.Clients; using Trakx.CryptoCompare.ApiClient.Websocket.Extensions; using Trakx.CryptoCompare.ApiClient.Websocket.Model; using Trakx.Websocket.Model; @@ -25,7 +25,7 @@ public CryptoCompareWebsocketHandlerTests() _cryptoCompareWebsocketHandler = _serviceScope.ServiceProvider.GetRequiredService(); } - public IServiceProvider CreateServiceProvider() + public static IServiceProvider CreateServiceProvider() { var serviceCollection = new ServiceCollection(); var websocketConfiguration = new WebsocketConfiguration @@ -33,9 +33,8 @@ public IServiceProvider CreateServiceProvider() BufferSize = 4096, MaxSubscriptionsPerScope = 100 }; - var configuration = AwsConfigurationHelper.GetConfigurationFromAws() - with - { WebSocketBaseUrl = "wss://streamer.cryptocompare.com/v2?api_key=", }; + + var configuration = CryptoCompareApiFixture.LoadConfiguration(); serviceCollection.AddCryptoCompareWebsockets(configuration, websocketConfiguration); return serviceCollection.BuildServiceProvider(); diff --git a/src/Trakx.CryptoCompare.ApiClient/CryptoCompareApiConfiguration.cs b/src/Trakx.CryptoCompare.ApiClient/CryptoCompareApiConfiguration.cs index daf9ce4..ca1d33d 100644 --- a/src/Trakx.CryptoCompare.ApiClient/CryptoCompareApiConfiguration.cs +++ b/src/Trakx.CryptoCompare.ApiClient/CryptoCompareApiConfiguration.cs @@ -2,21 +2,17 @@ using System.Text.Json.Serialization; using Trakx.Common.Attributes; -namespace Trakx.CryptoCompare.ApiClient +namespace Trakx.CryptoCompare.ApiClient; + +public record CryptoCompareApiConfiguration { - public record CryptoCompareApiConfiguration - { -#nullable disable - public string WebSocketBaseUrl { get; init; } = "wss://streamer.cryptocompare.com/"; + public string WebSocketBaseUrl { get; init; } = "wss://streamer.cryptocompare.com/"; - [AwsParameter] - [SecretEnvironmentVariable] - public string ApiKey { get; set; } + [AwsParameter(AllowGlobal = true)] + public string? ApiKey { get; set; } - [JsonIgnore] - public Uri WebSocketEndpoint => new Uri(new Uri(WebSocketBaseUrl), $"v2?api_key={ApiKey}"); + [JsonIgnore] + public Uri WebSocketEndpoint => new(new Uri(WebSocketBaseUrl), $"v2?api_key={ApiKey}"); - public int ThrottleDelayMs { get; init; } = 0; -#nullable restore - } + public int ThrottleDelayMs { get; init; } = 0; } From 9bc252b712b2736166914e4ae4c5ddee50b1455d Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Wed, 24 May 2023 14:52:37 +0100 Subject: [PATCH 29/36] ensure tests pass at all times --- README.md | 5 +++++ .../CryptoCompareWebsocketHandlerTests.cs | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c06e58e..2ac8fbf 100644 --- a/README.md +++ b/README.md @@ -79,5 +79,10 @@ Console.WriteLine(eth.Data.General.Name); ## AWS Parameters In order to be able to run some integration tests, you should ensure that you have access to the AWS parameters starting in `/CiCd`. In order for the applications in this solution to run correctly on AWS, please ensure that variables starting in `/[environment]` are defined for all 3 environments \( _Production_, _Staging_, _Development_ \) : ```awsParams +# REPOSITORY SECRETS /[environment]/Trakx/CryptoCompare/ApiClient/CryptoCompareApiConfiguration/ApiKey + +# GLOBAL SECRETS +# Instead of creating a specific repository secret, can use the global one with the same [Key] +/[environment]/Global/CryptoCompareApiConfiguration/ApiKey ``` \ No newline at end of file diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs index 4e4ed4d..59fc82d 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs @@ -64,8 +64,8 @@ private async Task GetResult(string subStr) where T : InboundMessageBase [Fact] public async Task Should_be_able_to_get_full_top_tier_volume_subscriptions() { - var result = await GetResult(CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("btc")) - .ConfigureAwait(false); + var subscriptionString = CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("btc"); + var result = await GetResult(subscriptionString).ConfigureAwait(false); result!.Symbol.Should().Be("BTC"); decimal.TryParse(result.Volume, CultureInfo.InvariantCulture, out decimal volume); volume.Should().BeGreaterThan(0); @@ -74,16 +74,23 @@ public async Task Should_be_able_to_get_full_top_tier_volume_subscriptions() [Fact] public async Task Should_be_able_to_get_oc_book() { - var result = await GetResult(CryptoCompareSubscriptionFactory.GetTopOfOrderBookSubscriptionStr("Binance", "btc", "usdt")) - .ConfigureAwait(false); + var subscriptionString = CryptoCompareSubscriptionFactory.GetTopOfOrderBookSubscriptionStr("Binance", "btc", "usdt"); + + // when running tests, this call sometimes fails the first time + // so adding another attempt to see if this always passes + var result + = await GetResult(subscriptionString) + ?? await GetResult(subscriptionString); + + result.Should().NotBeNull(); result!.Type.Should().Be("30"); } [Fact] public async Task Should_be_able_to_get_ohlcc_candles() { - var result = await GetResult(CryptoCompareSubscriptionFactory.GetOHLCCandlesSubscriptionStr("Binance", "btc", "usdt", "m")) - .ConfigureAwait(false); + var subscriptionString = CryptoCompareSubscriptionFactory.GetOHLCCandlesSubscriptionStr("Binance", "btc", "usdt", "m"); + var result = await GetResult(subscriptionString).ConfigureAwait(false); result!.Open.Should().BeGreaterThan(0); result!.LastTimeStamp.Should().BeGreaterThan(0); result!.Market.Should().NotBeNull(); From 8dd796c0b8a80b6332d985e7ff430110f493309f Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Wed, 24 May 2023 14:55:46 +0100 Subject: [PATCH 30/36] remove Development environment from test config --- .../Integration/Rest/Clients/CryptoCompareClientTestsBase.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs index 19390ef..54e5767 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/CryptoCompareClientTestsBase.cs @@ -40,7 +40,6 @@ public CryptoCompareApiFixture() public static CryptoCompareApiConfiguration LoadConfiguration() { return AwsConfigurationHelper.GetConfigurationFromAws() - ?? AwsConfigurationHelper.GetConfigurationFromAws("Development") ?? throw new InvalidOperationException("Unable to load configuration from AWS"); } From f6472dea88fe8a565858dc356a9d072159bc8720 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Wed, 24 May 2023 15:17:39 +0100 Subject: [PATCH 31/36] increase buffer window to 30 seconds --- .../Integration/CryptoCompareWebsocketHandlerTests.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs index 59fc82d..8dcfd10 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs @@ -46,14 +46,15 @@ public void Dispose() } - private async Task GetResult(string subStr) where T : InboundMessageBase + private async Task GetResult(string subStr, int bufferSeconds = 10) + where T : InboundMessageBase { var topicSub = CryptoCompareSubscriptionFactory.GetTopicSubscription (SubscribeActions.SubAdd, subStr); await _cryptoCompareWebsocketHandler.AddAsync(topicSub); var res = await _cryptoCompareWebsocketHandler.GetTopicMessageStream(topicSub.Topic) - .Buffer(TimeSpan.FromSeconds(10), 1) + .Buffer(TimeSpan.FromSeconds(bufferSeconds), 1) .Select(t => t.FirstOrDefault()) .FirstOrDefaultAsync() .ToTask(); @@ -76,11 +77,7 @@ public async Task Should_be_able_to_get_oc_book() { var subscriptionString = CryptoCompareSubscriptionFactory.GetTopOfOrderBookSubscriptionStr("Binance", "btc", "usdt"); - // when running tests, this call sometimes fails the first time - // so adding another attempt to see if this always passes - var result - = await GetResult(subscriptionString) - ?? await GetResult(subscriptionString); + var result = await GetResult(subscriptionString, bufferSeconds: 30); result.Should().NotBeNull(); result!.Type.Should().Be("30"); From 1108f912b358e4fdb8ccee8728c2a37bab5fc2d8 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Wed, 24 May 2023 16:05:45 +0100 Subject: [PATCH 32/36] Update .github/workflows/delete.packages.yml Co-authored-by: monsieurleberre --- .github/workflows/delete.packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/delete.packages.yml b/.github/workflows/delete.packages.yml index 26ce63c..117729c 100644 --- a/.github/workflows/delete.packages.yml +++ b/.github/workflows/delete.packages.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Delete packages id: deletePackages - uses: actions/delete-package-versions@v3 + uses: actions/delete-package-versions@v4 with: package-name: '${{github.event.inputs.name}}' num-old-versions-to-delete: ${{github.event.inputs.num-old-versions-to-delete}} From 1b66d7fe210012807b78d14aeae455aeec551d20 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Wed, 24 May 2023 16:06:28 +0100 Subject: [PATCH 33/36] Update .github/workflows/delete.packages.yml Co-authored-by: monsieurleberre --- .github/workflows/delete.packages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/delete.packages.yml b/.github/workflows/delete.packages.yml index 117729c..65b08dd 100644 --- a/.github/workflows/delete.packages.yml +++ b/.github/workflows/delete.packages.yml @@ -23,5 +23,6 @@ jobs: uses: actions/delete-package-versions@v4 with: package-name: '${{github.event.inputs.name}}' + package-type: 'nuget' num-old-versions-to-delete: ${{github.event.inputs.num-old-versions-to-delete}} From 11c81273063208f21011b06493e8aacdb7e0e150 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Tue, 31 Oct 2023 13:44:07 +0000 Subject: [PATCH 34/36] Nuget bumps, fix IDE warnings and messages, nullable properties (#96) * nuget bumps, fix IDE warnings and messages, nullable properties * flags in plural * Pascal case --- .../Rest/Clients/PriceClientTests.cs | 16 ++- ...Trakx.CryptoCompare.ApiClient.Tests.csproj | 12 +-- .../Unit/Rest/Helpers/CheckTest.cs | 7 +- .../Unit/ServiceConfigurationTests.cs | 8 +- .../CryptoCompareWebsocketHandlerTests.cs | 38 +++++--- ...toCompare.ApiClient.Websocket.Tests.csproj | 12 +-- .../AddCryptoCompareWebsocketsExtensions.cs | 12 ++- .../Model/HeartBeat.cs | 4 +- .../Model/InboundMessageBase.cs | 2 +- .../Model/Ohlc.cs | 2 +- .../Model/Ticker.cs | 10 +- .../Model/TopTierFullVolume.cs | 9 +- .../Model/Trade.cs | 2 +- ...x.CryptoCompare.ApiClient.Websocket.csproj | 25 ++--- .../Rest/Clients/BaseApiClient.cs | 7 +- .../Rest/Clients/HistoryClient.cs | 7 +- .../Rest/Clients/IHistoryClient.cs | 14 +-- .../Rest/Clients/INewsClient.cs | 12 +-- .../Rest/Clients/IPricesClient.cs | 6 +- .../Rest/Clients/PriceClient.cs | 2 +- .../Rest/Converters/StringToSubConverter.cs | 15 +-- .../Rest/Core/ApiUrls.cs | 22 ++--- .../Rest/Core/ThottledHttpClientHandler.cs | 6 +- .../Rest/Extensions/DateTimeExtensions.cs | 3 +- .../Rest/Extensions/UriExtensions.cs | 18 ++-- .../Rest/Helpers/Check.cs | 8 +- .../Rest/Helpers/JetbrainsAnnotations.cs | 97 +++++++++---------- .../Rest/Models/Responses/AggregatedData.cs | 12 +-- .../Rest/Models/Responses/Calls.cs | 5 +- .../Models/Responses/CoinAggregatedData.cs | 2 +- .../Models/Responses/CoinSnapshotFullData.cs | 11 ++- .../Responses/CoinSnapshotFullResponse.cs | 2 +- .../Rest/Models/Responses/ICO.cs | 2 +- .../Rest/Models/Responses/MarketCapDisplay.cs | 1 - .../Rest/Models/Responses/MiningEquipment.cs | 4 +- .../Responses/MiningEquipmentsResponse.cs | 3 +- .../Models/Responses/PriceAverageResponse.cs | 4 +- .../Responses/PriceMultiFullResponse.cs | 4 +- .../Rest/Models/Responses/SEO.cs | 12 +-- .../Rest/Models/Responses/Sub.cs | 41 ++++---- .../Rest/Models/Responses/SubListResponse.cs | 6 +- .../Rest/Models/Responses/TopVolume24HInfo.cs | 6 +- .../Models/Responses/TopVolume24HResponse.cs | 2 +- .../Models/Responses/TopVolumesResponse.cs | 5 +- .../ServiceConfiguration.cs | 4 +- .../Trakx.CryptoCompare.ApiClient.csproj | 5 +- 46 files changed, 271 insertions(+), 236 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/PriceClientTests.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/PriceClientTests.cs index fe6d3ef..d75cb60 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/PriceClientTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Integration/Rest/Clients/PriceClientTests.cs @@ -1,4 +1,6 @@ -using System.Threading.Tasks; +using System; +using System.Linq; +using System.Threading.Tasks; using FluentAssertions; using Xunit; @@ -38,7 +40,8 @@ public async Task CanCallGenerateCustomAverageEndpoint() Assert.NotNull(result); } - [Fact] public async Task CanCallWithLargeNumberOfFSymbols() + [Fact] + public async Task CanCallWithLargeNumberOfFSymbols() { var symbols = new[] { @@ -50,8 +53,13 @@ [Fact] public async Task CanCallWithLargeNumberOfFSymbols() "srm", "cake", "luna" }; var result = await CryptoCompareClient.Prices.MultipleSymbolsPriceAsync(symbols, new[] { "USD", "EUR" }); - result.Count.Should().Be(symbols.Length); - Assert.NotNull(result); + + result.Should().NotBeEmpty(); + + var missingKeys = symbols.Except(result.Keys, StringComparer.OrdinalIgnoreCase).Order().ToList(); + + var maximumMissingAllowed = symbols.Length * 10 / 100; // 10% missing + missingKeys.Count.Should().BeLessThanOrEqualTo(maximumMissingAllowed); } } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index 4e092f7..fa1d776 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -16,17 +16,17 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Unit/Rest/Helpers/CheckTest.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Unit/Rest/Helpers/CheckTest.cs index 34678c4..aa216b1 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Unit/Rest/Helpers/CheckTest.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Unit/Rest/Helpers/CheckTest.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions; using Trakx.CryptoCompare.ApiClient.Rest.Helpers; using Xunit; @@ -6,7 +7,7 @@ namespace Trakx.CryptoCompare.ApiClient.Tests.Unit.Rest.Helpers { public class CheckTest { - public static string Blah = nameof(Blah); + internal const string Blah = nameof(Blah); /// /// NotNullOrWhiteSpace should not throw ArgumentNullException when string is not null. @@ -27,7 +28,7 @@ public void NotNullOrWhiteSpaceShouldNotThrowArgumentNullExceptionWhenStringIsNo public void NotNullOrWhiteSpaceShouldThrowArgumentNullExceptionWhenStringIsNullOrEmptyOrWhitespace(string value) { var exception = Assert.Throws(() => Check.NotNullOrWhiteSpace(value, Blah)); - Assert.Equal(exception.ParamName, Blah); + exception.ParamName.Should().Be(Blah); } /// @@ -46,7 +47,7 @@ public void NotNullShouldNotThrowArgumentNullExceptionWhenObjectIsNotNull() public void NotNullShouldThrowArgumentNullExceptionWhenObjectIsNull() { var exception = Assert.Throws(() => Check.NotNull(null, Blah)); - Assert.Equal(exception.ParamName, Blah); + exception.ParamName.Should().Be(Blah); } } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Unit/ServiceConfigurationTests.cs b/src/Trakx.CryptoCompare.ApiClient.Tests/Unit/ServiceConfigurationTests.cs index be502e9..d279d6e 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Unit/ServiceConfigurationTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Unit/ServiceConfigurationTests.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using FluentAssertions; +using Microsoft.Extensions.DependencyInjection; using Xunit; namespace Trakx.CryptoCompare.ApiClient.Tests.Unit @@ -13,7 +14,10 @@ public void Services_should_be_built() var serviceCollection = new ServiceCollection(); serviceCollection.AddCryptoCompareClient(configuration); serviceCollection.AddLogging(); - var serviceProvider = serviceCollection.BuildServiceProvider(); + + var action = () => _ = serviceCollection.BuildServiceProvider(); + + action.Should().NotThrow(); } } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs index 8dcfd10..143d798 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/CryptoCompareWebsocketHandlerTests.cs @@ -1,5 +1,4 @@ using System; -using System.Globalization; using System.Linq; using System.Reactive.Linq; using System.Reactive.Threading.Tasks; @@ -40,12 +39,6 @@ public static IServiceProvider CreateServiceProvider() return serviceCollection.BuildServiceProvider(); } - public void Dispose() - { - _serviceScope.Dispose(); - } - - private async Task GetResult(string subStr, int bufferSeconds = 10) where T : InboundMessageBase { @@ -66,10 +59,9 @@ private async Task GetResult(string subStr, int bufferSeconds = 10) public async Task Should_be_able_to_get_full_top_tier_volume_subscriptions() { var subscriptionString = CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("btc"); - var result = await GetResult(subscriptionString).ConfigureAwait(false); + var result = await GetResult(subscriptionString); result!.Symbol.Should().Be("BTC"); - decimal.TryParse(result.Volume, CultureInfo.InvariantCulture, out decimal volume); - volume.Should().BeGreaterThan(0); + result.Volume.Should().BeGreaterThan(0); } [Fact] @@ -87,11 +79,35 @@ public async Task Should_be_able_to_get_oc_book() public async Task Should_be_able_to_get_ohlcc_candles() { var subscriptionString = CryptoCompareSubscriptionFactory.GetOHLCCandlesSubscriptionStr("Binance", "btc", "usdt", "m"); - var result = await GetResult(subscriptionString).ConfigureAwait(false); + var result = await GetResult(subscriptionString); result!.Open.Should().BeGreaterThan(0); result!.LastTimeStamp.Should().BeGreaterThan(0); result!.Market.Should().NotBeNull(); result.Close.Should().BeGreaterThan(0); } + + #region IDisposable + + private bool _wasDisposed; + + protected virtual bool Dispose(bool disposing) + { + if (_wasDisposed) return false; + if (disposing) + { + _serviceScope.Dispose(); + } + + _wasDisposed = true; + return true; + } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + + #endregion } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index 3dcda7f..ac78549 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -18,18 +18,18 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Extensions/AddCryptoCompareWebsocketsExtensions.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Extensions/AddCryptoCompareWebsocketsExtensions.cs index b2c0948..f35777a 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Extensions/AddCryptoCompareWebsocketsExtensions.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Extensions/AddCryptoCompareWebsocketsExtensions.cs @@ -1,5 +1,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Trakx.Common.Configuration; using Trakx.Websocket; using Trakx.Websocket.Interfaces; using Trakx.Websocket.Model; @@ -8,7 +9,10 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Extensions; public static class AddCryptoCompareWebsocketsExtensions { - public static void AddCryptoCompareWebsockets(this IServiceCollection services, CryptoCompareApiConfiguration apiConfiguration, WebsocketConfiguration webSocketConfiguration) + public static void AddCryptoCompareWebsockets( + this IServiceCollection services, + CryptoCompareApiConfiguration apiConfiguration, + WebsocketConfiguration webSocketConfiguration) { services.AddSingleton(); services.AddSingleton(); @@ -18,10 +22,8 @@ public static void AddCryptoCompareWebsockets(this IServiceCollection services, public static void AddCryptoCompareWebsockets(this IServiceCollection services, IConfiguration config) { - var apiConfiguration = config.GetSection(nameof(CryptoCompareApiConfiguration)) - .Get(); - var webSocketConfig = config.GetSection(nameof(WebsocketConfiguration)).Get(); - + var apiConfiguration = config.GetConfiguration(); + var webSocketConfig = config.GetConfiguration(); AddCryptoCompareWebsockets(services, apiConfiguration, webSocketConfig); } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/HeartBeat.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/HeartBeat.cs index df43081..a9cf0ed 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/HeartBeat.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/HeartBeat.cs @@ -4,6 +4,6 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; public class HeartBeat : InboundMessageBase { - [JsonPropertyName("MESSAGE")] public string Message { get; set; } - [JsonPropertyName("TIMEMS")] public ulong TimeMs { get; set; } + [JsonPropertyName("MESSAGE")] public string? Message { get; set; } + [JsonPropertyName("TIMEMS")] public ulong? TimeMs { get; set; } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/InboundMessageBase.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/InboundMessageBase.cs index aff0957..cd7c2d5 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/InboundMessageBase.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/InboundMessageBase.cs @@ -4,5 +4,5 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; public class InboundMessageBase { - [JsonPropertyName("TYPE")] public string Type { get; set; } + [JsonPropertyName("TYPE")] public string? Type { get; set; } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs index 8d94a17..83ce008 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs @@ -1,5 +1,5 @@ using System.Text.Json.Serialization; -using Trakx.Common.Serialization.Converters; +using Trakx.Common.Serialization.Comparers; namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs index dec6b3f..5697406 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs @@ -1,14 +1,13 @@ using System.Text.Json.Serialization; -using Trakx.Common.Serialization.Converters; +using Trakx.Common.Serialization.Comparers; namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; public class Ticker : InboundMessageBase { -#nullable disable - [JsonPropertyName("MARKET")] public string Market { get; set; } - [JsonPropertyName("FROMSYMBOL")] public string BaseSymbol { get; set; } - [JsonPropertyName("TOSYMBOL")] public string QuoteSymbol { get; set; } + [JsonPropertyName("MARKET")] public string? Market { get; set; } + [JsonPropertyName("FROMSYMBOL")] public string? BaseSymbol { get; set; } + [JsonPropertyName("TOSYMBOL")] public string? QuoteSymbol { get; set; } [JsonPropertyName("FLAGS"), JsonConverter(typeof(ULongOrStringConverter))] public ulong Flags { get; set; } @@ -33,5 +32,4 @@ public class Ticker : InboundMessageBase [JsonPropertyName("OPENHOUR")] public decimal? OpenHour { get; set; } [JsonPropertyName("HIGHHOUR")] public decimal? HighHour { get; set; } [JsonPropertyName("LOWHOUR")] public decimal? LowHour { get; set; } -#nullable restore } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/TopTierFullVolume.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/TopTierFullVolume.cs index 4dec8db..d15b6be 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/TopTierFullVolume.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/TopTierFullVolume.cs @@ -4,8 +4,9 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; public class TopTierFullVolume : InboundMessageBase { -#nullable disable - [JsonPropertyName("SYMBOL")] public string Symbol { get; set; } - [JsonPropertyName("TOPTIERFULLVOLUME")] public string Volume { get; set; } -#nullable restore + [JsonPropertyName("SYMBOL")] + public string Symbol { get; set; } = default!; + + [JsonPropertyName("TOPTIERFULLVOLUME")] + public decimal Volume { get; set; } } diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs index 28963a2..8afede3 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs @@ -1,5 +1,5 @@ using System.Text.Json.Serialization; -using Trakx.Common.Serialization.Converters; +using Trakx.Common.Serialization.Comparers; namespace Trakx.CryptoCompare.ApiClient.Websocket.Model; diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj index edfae1b..4a085e1 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket/Trakx.CryptoCompare.ApiClient.Websocket.csproj @@ -1,19 +1,20 @@  - - net7.0 - + + net7.0 + - - + + - - - - + + + + + - - - + + + diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/BaseApiClient.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/BaseApiClient.cs index 9ccceca..b291b3e 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/BaseApiClient.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/BaseApiClient.cs @@ -63,18 +63,17 @@ public async Task SendRequestAsync(HttpMethod httpMe { var apiResponseObject = JsonConvert.DeserializeObject(jsonResponse); - var baseApiResponse = apiResponseObject as BaseApiResponse; - if (baseApiResponse != null && !baseApiResponse.IsSuccessfulResponse) + if (apiResponseObject is BaseApiResponse baseApiResponse && !baseApiResponse.IsSuccessfulResponse) { throw new CryptoCompareException(baseApiResponse); } - return apiResponseObject; + return apiResponseObject!; } catch (JsonSerializationException jsonSerializationException) { var apiErrorResponse = JsonConvert.DeserializeObject(jsonResponse); - throw new CryptoCompareException(apiErrorResponse, jsonSerializationException); + throw new CryptoCompareException(apiErrorResponse!, jsonSerializationException); } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/HistoryClient.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/HistoryClient.cs index 26e784d..5c833f3 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/HistoryClient.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/HistoryClient.cs @@ -16,7 +16,7 @@ public HistoryClient(HttpClient httpClient) { Check.NotNull(httpClient, nameof(httpClient)); } - + /// /// Get the price of any cryptocurrency in any other currency that you need at a given timestamp. /// The price comes from the daily info - so it would be the price at the end of the day GMT based on the requested TS. @@ -42,7 +42,6 @@ public async Task HistoricalForTimestampAsync( { Check.NotNullOrWhiteSpace(fromSymbol, nameof(fromSymbol)); Check.NotEmpty(toSymbols, nameof(toSymbols)); - return await this.GetAsync( ApiUrls.PriceHistorical( @@ -53,7 +52,7 @@ public async Task HistoricalForTimestampAsync( calculationType, tryConversion)).ConfigureAwait(false); } - + /// /// Get open, high, low, close, volumefrom and volumeto from the daily historical data. /// The values are based on 00:00 GMT time.It uses BTC conversion if data is not available because the coin is not trading in the specified currency. @@ -69,7 +68,7 @@ public async Task HistoricalForTimestampAsync( public async Task DailyAsync( string fromSymbol, string toSymbol, - int? limit = null, + int? limit, string? exchangeName = null, DateTimeOffset? toDate = null, bool? allData = null, diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/IHistoryClient.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/IHistoryClient.cs index 3f0c21c..b7cee0e 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/IHistoryClient.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/IHistoryClient.cs @@ -26,7 +26,7 @@ Task HistoricalForTimestampAsync( string fromSymbol, IEnumerable toSymbols, DateTimeOffset requestedDate, - IEnumerable markets = null, + IEnumerable? markets = null, CalculationType? calculationType = null, bool? tryConversion = null); @@ -46,7 +46,7 @@ Task DailyAsync( [NotNull] string fromSymbol, [NotNull] string toSymbol, int? limit, - string exchangeName = null, + string? exchangeName = null, DateTimeOffset? toDate = null, bool? allData = null, int? aggregate = null, @@ -68,7 +68,7 @@ Task HourlyAsync( [NotNull] string fromSymbol, [NotNull] string toSymbol, int? limit = null, - string exchangeName = null, + string? exchangeName = null, DateTimeOffset? toDate = null, bool? allData = null, int? aggregate = null, @@ -91,7 +91,7 @@ Task MinutelyAsync( [NotNull] string fromSymbol, [NotNull] string toSymbol, int? limit = null, - string exchangeName = null, + string? exchangeName = null, DateTimeOffset? toDate = null, bool? allData = null, int? aggregate = null, @@ -114,7 +114,7 @@ Task MinutelyAsync( Task DayAveragePriceAsync( [NotNull] string fromSymbol, [NotNull] string toSymbol, - string exchangeName = null, + string? exchangeName = null, DateTimeOffset? toDate = null, CalculationType? avgType = null, int? utcHourDiff = null, @@ -134,7 +134,7 @@ Task DayAveragePriceAsync( /// Task ExchangeDailyAsync( [NotNull] string toSymbol, - string exchangeName = null, + string? exchangeName = null, DateTimeOffset? toDate = null, int? limit = null, int? aggregate = null, @@ -154,7 +154,7 @@ Task ExchangeDailyAsync( /// Task ExchangeHourlyAsync( [NotNull] string toSymbol, - string exchangeName = null, + string? exchangeName = null, DateTimeOffset? toDate = null, int? limit = null, int? aggregate = null, diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/INewsClient.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/INewsClient.cs index 1b18172..6a8bb92 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/INewsClient.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/INewsClient.cs @@ -6,11 +6,11 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Clients { public interface INewsClient { - /// - /// Return all news providers. - /// - /// - Task> NewsProviders(); + /// + /// Return all news providers. + /// + /// + Task> NewsProviders(); /// /// Get all news /// @@ -19,7 +19,7 @@ public interface INewsClient /// Feeds - for news /// if true cryptocompare will sign request /// - Task> News(string lang = null, long? lTs = null, string[] feeds = null, + Task> News(string? lang = null, long? lTs = null, string[]? feeds = null, bool? sign = null); } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/IPricesClient.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/IPricesClient.cs index 4a2560e..f1fe6d2 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/IPricesClient.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/IPricesClient.cs @@ -32,7 +32,7 @@ Task MultipleSymbolsPriceAsync( IEnumerable fromSymbols, IEnumerable toSymbols, bool? tryConversion = null, - string exchangeName = null); + string? exchangeName = null); /// /// Get all the current trading info (price, vol, open, high, low etc) of any list of cryptocurrencies in any other currency that you need. @@ -49,7 +49,7 @@ Task MultipleSymbolFullDataAsync( IEnumerable fromSymbols, IEnumerable toSymbols, bool? tryConversion = null, - string exchangeName = null); + string? exchangeName = null); /// /// Get the current price of any cryptocurrency in any other currency that you need. @@ -64,6 +64,6 @@ Task SingleSymbolPriceAsync( string fromSymbol, IEnumerable toSymbols, bool? tryConversion = null, - string exchangeName = null); + string? exchangeName = null); } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/PriceClient.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/PriceClient.cs index e6ba584..43288ec 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/PriceClient.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Clients/PriceClient.cs @@ -150,7 +150,7 @@ public async Task SingleSymbolPriceAsync( [NotNull] string fromSymbol, [NotNull] IEnumerable toSymbols, bool? tryConversion = null, - string exchangeName = null) + string? exchangeName = null) { Check.NotNull(fromSymbol, nameof(fromSymbol)); Check.NotEmpty(toSymbols, nameof(toSymbols)); diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Converters/StringToSubConverter.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Converters/StringToSubConverter.cs index 410a0b0..e748825 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Converters/StringToSubConverter.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Converters/StringToSubConverter.cs @@ -37,12 +37,12 @@ public override bool CanConvert(Type objectType) public override object ReadJson( JsonReader reader, Type objectType, - object existingValue, + object? existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.String) { - return this.GetTokenFromString(reader.Value.ToString()); + return GetTokenFromString(reader.Value?.ToString()); } if (reader.TokenType == JsonToken.StartArray) @@ -50,11 +50,11 @@ public override object ReadJson( var tokens = JArray.Load(reader); if (tokens?.HasValues ?? false) { - return tokens.Values().Select(token => this.GetTokenFromString(token.ToString())).ToList(); + return tokens.Values().Select(token => GetTokenFromString(token.ToString())).ToList(); } } - return null; + return null!; } /// @@ -64,13 +64,14 @@ public override object ReadJson( /// The value. /// The calling serializer. /// - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) { throw new NotImplementedException(); } - private Sub GetTokenFromString(string token) + private static Sub GetTokenFromString(string? token) { + if (token == null) return default; var values = token.Split('~'); if (values.Length == 4) { @@ -81,7 +82,7 @@ private Sub GetTokenFromString(string token) subId, values.ElementAtOrDefault(3)); } - return default(Sub); + return default; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Core/ApiUrls.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Core/ApiUrls.cs index 1314e33..f9dbde8 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Core/ApiUrls.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Core/ApiUrls.cs @@ -12,22 +12,22 @@ internal static class ApiUrls { private const string RateLimitsUrl = "/stats/rate/{0}/limit"; - public static readonly Uri MinApiEndpoint = new Uri( + public static readonly Uri MinApiEndpoint = new( "https://min-api.cryptocompare.com/data/", UriKind.Absolute); - public static readonly Uri SiteApiEndpoint = new Uri( + public static readonly Uri SiteApiEndpoint = new( "https://www.cryptocompare.com/api/data/", UriKind.Absolute); - public static Uri AllCoins() => new Uri(MinApiEndpoint, "all/coinlist"); + public static Uri AllCoins() => new(MinApiEndpoint, "all/coinlist"); - public static Uri AllExchanges() => new Uri(MinApiEndpoint, "all/exchanges"); + public static Uri AllExchanges() => new(MinApiEndpoint, "all/exchanges"); public static Uri DayAveragePrice( string fsym, string tsym, - string e, + string? e, DateTimeOffset? toTs, CalculationType? avgType, int? UTCHourDiff, @@ -97,9 +97,9 @@ public static Uri ExchangeHistory( }); } - public static Uri MiningContracts() => new Uri(SiteApiEndpoint, "miningcontracts"); + public static Uri MiningContracts() => new(SiteApiEndpoint, "miningcontracts"); - public static Uri MiningEquipments() => new Uri(SiteApiEndpoint, "miningequipment"); + public static Uri MiningEquipments() => new(SiteApiEndpoint, "miningequipment"); public static Uri News(string? lang = null, long? lTs = null, string[]? feeds = null, bool? sign = null) { @@ -141,7 +141,7 @@ public static Uri PriceAverage( public static Uri PriceHistorical( string fsym, IEnumerable tsyms, - IEnumerable markets, + IEnumerable? markets, DateTimeOffset ts, CalculationType? calculationType, bool? tryConversion) @@ -215,11 +215,11 @@ public static Uri PriceSingle( }); } - public static Uri RateLimitsByHour() => new Uri(MinApiEndpoint, string.Format(RateLimitsUrl, "hour")); + public static Uri RateLimitsByHour() => new(MinApiEndpoint, string.Format(RateLimitsUrl, "hour")); - public static Uri RateLimitsByMinute() => new Uri(MinApiEndpoint, string.Format(RateLimitsUrl, "minute")); + public static Uri RateLimitsByMinute() => new(MinApiEndpoint, string.Format(RateLimitsUrl, "minute")); - public static Uri RateLimitsBySecond() => new Uri(MinApiEndpoint, string.Format(RateLimitsUrl, "second")); + public static Uri RateLimitsBySecond() => new(MinApiEndpoint, string.Format(RateLimitsUrl, "second")); public static Uri SocialStats([NotNull] int id) { diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Core/ThottledHttpClientHandler.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Core/ThottledHttpClientHandler.cs index d462edc..59d2a17 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Core/ThottledHttpClientHandler.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Core/ThottledHttpClientHandler.cs @@ -24,14 +24,14 @@ public ThottledHttpClientHandler(int millisecondsDelay) this._semaphore = new SemaphoreSlim(1, 1); } - protected override async Task SendAsync(HttpRequestMessage requestMessage, CancellationToken cancellationToken) + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { - Check.NotNull(requestMessage, nameof(requestMessage)); + Check.NotNull(request, nameof(request)); await this._semaphore.WaitAsync(cancellationToken).ConfigureAwait(false); try { - return await base.SendAsync(requestMessage, cancellationToken); + return await base.SendAsync(request, cancellationToken); } finally { diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Extensions/DateTimeExtensions.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Extensions/DateTimeExtensions.cs index 58cf5eb..b232c24 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Extensions/DateTimeExtensions.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Extensions/DateTimeExtensions.cs @@ -1,10 +1,11 @@ using System; +using Trakx.Common.Extensions; namespace Trakx.CryptoCompare.ApiClient.Rest.Extensions { public static class DateTimeExtensions { - private static readonly DateTimeOffset epoch = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero); + private static readonly DateTimeOffset epoch = (1970, 1, 1).ToDateTimeOffset(); /// /// Convert a Unix tick to a with UTC offset diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Extensions/UriExtensions.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Extensions/UriExtensions.cs index b1915cc..b83f8fd 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Extensions/UriExtensions.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Extensions/UriExtensions.cs @@ -33,7 +33,7 @@ public static Uri ApplyParameters([NotNull] this Uri uri, IDictionary key.Substring(0, key.IndexOf('=')), - value => value.Substring(value.IndexOf('=') + 1)); + key => key[..key.IndexOf('=')], + value => value[(value.IndexOf('=') + 1)..]); foreach (var (k, v) in existingParameters) { if (!p.ContainsKey(k)) { - p.Add(k,v); + p.Add(k, v); } } var query = string.Join( "&", p.Where(param => !string.IsNullOrWhiteSpace(param.Value)) - .Select(kvp => kvp.Key + "=" + Uri.EscapeDataString(kvp.Value))); + .Select(kvp => kvp.Key + "=" + Uri.EscapeDataString(kvp.Value!))); if (uri.IsAbsoluteUri) { var uriBuilder = new UriBuilder(uri) - { - Query = query - }; + { + Query = query + }; return uriBuilder.Uri; } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Helpers/Check.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Helpers/Check.cs index 1eae50b..18be666 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Helpers/Check.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Helpers/Check.cs @@ -23,7 +23,7 @@ internal static class Check [ContractAnnotation("value:null => halt")] public static IEnumerable NotEmpty( IEnumerable value, - [InvokerParameterName] [NotNull] string parameterName) + [InvokerParameterName][NotNull] string parameterName) { NotNull(value, parameterName); @@ -47,9 +47,9 @@ public static IEnumerable NotEmpty( /// Checked object. /// [ContractAnnotation("value:null => halt")] - public static T NotNull(T value, [InvokerParameterName] [NotNull] string parameterName) + public static T NotNull(T value, [InvokerParameterName][NotNull] string parameterName) { - if (ReferenceEquals(value, null)) + if (value is null) { NotNullOrWhiteSpace(parameterName, nameof(parameterName)); throw new ArgumentNullException(parameterName); @@ -67,7 +67,7 @@ public static T NotNull(T value, [InvokerParameterName] [NotNull] string para /// Checked object. /// [ContractAnnotation("value:null => halt")] - public static string NotNullOrWhiteSpace(string value, [InvokerParameterName] [NotNull] string parameterName) + public static string NotNullOrWhiteSpace(string? value, [InvokerParameterName][NotNull] string parameterName) { if (string.IsNullOrWhiteSpace(value)) { diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Helpers/JetbrainsAnnotations.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Helpers/JetbrainsAnnotations.cs index 8f21d7a..2f35231 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Helpers/JetbrainsAnnotations.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Helpers/JetbrainsAnnotations.cs @@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE using System; -#pragma warning disable 1591 // ReSharper disable UnusedMember.Global // ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedAutoPropertyAccessor.Global @@ -134,7 +133,7 @@ public StringFormatMethodAttribute([NotNull] string formatParameterName) } [NotNull] - public string FormatParameterName { get; private set; } + public string? FormatParameterName { get; private set; } } /// @@ -150,7 +149,7 @@ public ValueProviderAttribute([NotNull] string name) } [NotNull] - public string Name { get; private set; } + public string? Name { get; private set; } } /// @@ -220,7 +219,7 @@ public NotifyPropertyChangedInvocatorAttribute([NotNull] string parameterName) } [CanBeNull] - public string ParameterName { get; private set; } + public string? ParameterName { get; private set; } } /// @@ -281,7 +280,7 @@ public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStat } [NotNull] - public string Contract { get; private set; } + public string? Contract { get; private set; } public bool ForceFullStates { get; private set; } } @@ -368,29 +367,29 @@ public BaseTypeRequiredAttribute([NotNull] Type baseType) internal sealed class UsedImplicitlyAttribute : Attribute { public UsedImplicitlyAttribute() - : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) + : this(ImplicitUseKinds.Default, ImplicitUseTargets.Default) { } - public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags) - : this(useKindFlags, ImplicitUseTargetFlags.Default) + public UsedImplicitlyAttribute(ImplicitUseKinds useKindFlags) + : this(useKindFlags, ImplicitUseTargets.Default) { } - public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags) - : this(ImplicitUseKindFlags.Default, targetFlags) + public UsedImplicitlyAttribute(ImplicitUseTargets targetFlags) + : this(ImplicitUseKinds.Default, targetFlags) { } - public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + public UsedImplicitlyAttribute(ImplicitUseKinds useKindFlags, ImplicitUseTargets targetFlags) { UseKindFlags = useKindFlags; TargetFlags = targetFlags; } - public ImplicitUseTargetFlags TargetFlags { get; private set; } + public ImplicitUseTargets TargetFlags { get; private set; } - public ImplicitUseKindFlags UseKindFlags { get; private set; } + public ImplicitUseKinds UseKindFlags { get; private set; } } /// @@ -401,35 +400,35 @@ public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTar internal sealed class MeansImplicitUseAttribute : Attribute { public MeansImplicitUseAttribute() - : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) + : this(ImplicitUseKinds.Default, ImplicitUseTargets.Default) { } - public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags) - : this(useKindFlags, ImplicitUseTargetFlags.Default) + public MeansImplicitUseAttribute(ImplicitUseKinds useKindFlags) + : this(useKindFlags, ImplicitUseTargets.Default) { } - public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags) - : this(ImplicitUseKindFlags.Default, targetFlags) + public MeansImplicitUseAttribute(ImplicitUseTargets targetFlags) + : this(ImplicitUseKinds.Default, targetFlags) { } - public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + public MeansImplicitUseAttribute(ImplicitUseKinds useKindFlags, ImplicitUseTargets targetFlags) { UseKindFlags = useKindFlags; TargetFlags = targetFlags; } [UsedImplicitly] - public ImplicitUseTargetFlags TargetFlags { get; private set; } + public ImplicitUseTargets TargetFlags { get; private set; } [UsedImplicitly] - public ImplicitUseKindFlags UseKindFlags { get; private set; } + public ImplicitUseKinds UseKindFlags { get; private set; } } [Flags] - internal enum ImplicitUseKindFlags + internal enum ImplicitUseKinds { Default = Access | Assign | InstantiatedWithFixedConstructorSignature, @@ -454,7 +453,7 @@ internal enum ImplicitUseKindFlags /// with or . /// [Flags] - internal enum ImplicitUseTargetFlags + internal enum ImplicitUseTargets { Default = Itself, @@ -471,20 +470,20 @@ internal enum ImplicitUseTargetFlags /// This attribute is intended to mark publicly available API /// which should not be removed and so is treated as used. /// - [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)] - internal sealed class PublicAPIAttribute : Attribute + [MeansImplicitUse(ImplicitUseTargets.WithMembers)] + internal sealed class PublicApiAttribute : Attribute { - public PublicAPIAttribute() + public PublicApiAttribute() { } - public PublicAPIAttribute([NotNull] string comment) + public PublicApiAttribute([NotNull] string comment) { Comment = comment; } [CanBeNull] - public string Comment { get; private set; } + public string? Comment { get; private set; } } /// @@ -529,7 +528,7 @@ public MustUseReturnValueAttribute([NotNull] string justification) } [CanBeNull] - public string Justification { get; private set; } + public string? Justification { get; private set; } } /// @@ -572,7 +571,7 @@ public PathReferenceAttribute([NotNull, PathReference] string basePath) } [CanBeNull] - public string BasePath { get; private set; } + public string? BasePath { get; private set; } } /// @@ -648,13 +647,13 @@ internal sealed class MacroAttribute : Attribute /// Allows specifying a macro that will be executed for a source template /// parameter when the template is expanded. /// - public string Expression { get; set; } + public string? Expression { get; set; } /// /// Identifies the target parameter of a source template if the /// is applied on a template method. /// - public string Target { get; set; } + public string? Target { get; set; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] @@ -666,7 +665,7 @@ public AspMvcAreaMasterLocationFormatAttribute([NotNull] string format) } [NotNull] - public string Format { get; private set; } + public string? Format { get; private set; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] @@ -678,7 +677,7 @@ public AspMvcAreaPartialViewLocationFormatAttribute([NotNull] string format) } [NotNull] - public string Format { get; private set; } + public string? Format { get; private set; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] @@ -690,7 +689,7 @@ public AspMvcAreaViewLocationFormatAttribute([NotNull] string format) } [NotNull] - public string Format { get; private set; } + public string? Format { get; private set; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] @@ -713,7 +712,7 @@ public AspMvcPartialViewLocationFormatAttribute([NotNull] string format) } [NotNull] - public string Format { get; private set; } + public string? Format { get; private set; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] @@ -725,7 +724,7 @@ public AspMvcViewLocationFormatAttribute([NotNull] string format) } [NotNull] - public string Format { get; private set; } + public string? Format { get; private set; } } /// @@ -747,7 +746,7 @@ public AspMvcActionAttribute([NotNull] string anonymousProperty) } [CanBeNull] - public string AnonymousProperty { get; private set; } + public string? AnonymousProperty { get; private set; } } /// @@ -768,7 +767,7 @@ public AspMvcAreaAttribute([NotNull] string anonymousProperty) } [CanBeNull] - public string AnonymousProperty { get; private set; } + public string? AnonymousProperty { get; private set; } } /// @@ -790,7 +789,7 @@ public AspMvcControllerAttribute([NotNull] string anonymousProperty) } [CanBeNull] - public string AnonymousProperty { get; private set; } + public string? AnonymousProperty { get; private set; } } /// @@ -918,7 +917,7 @@ public HtmlElementAttributesAttribute([NotNull] string name) } [CanBeNull] - public string Name { get; private set; } + public string? Name { get; private set; } } [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)] @@ -930,7 +929,7 @@ public HtmlAttributeValueAttribute([NotNull] string name) } [NotNull] - public string Name { get; private set; } + public string? Name { get; private set; } } /// @@ -1091,7 +1090,7 @@ public AspChildControlTypeAttribute([NotNull] string tagName, [NotNull] Type con public Type ControlType { get; private set; } [NotNull] - public string TagName { get; private set; } + public string? TagName { get; private set; } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] @@ -1118,7 +1117,7 @@ public AspRequiredAttributeAttribute([NotNull] string attribute) } [NotNull] - public string Attribute { get; private set; } + public string? Attribute { get; private set; } } [AttributeUsage(AttributeTargets.Property)] @@ -1141,7 +1140,7 @@ public RazorImportNamespaceAttribute([NotNull] string name) } [NotNull] - public string Name { get; private set; } + public string? Name { get; private set; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] @@ -1154,10 +1153,10 @@ public RazorInjectionAttribute([NotNull] string type, [NotNull] string fieldName } [NotNull] - public string FieldName { get; private set; } + public string? FieldName { get; private set; } [NotNull] - public string Type { get; private set; } + public string? Type { get; private set; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] @@ -1169,7 +1168,7 @@ public RazorDirectiveAttribute([NotNull] string directive) } [NotNull] - public string Directive { get; private set; } + public string? Directive { get; private set; } } [AttributeUsage(AttributeTargets.Method)] @@ -1204,7 +1203,7 @@ internal sealed class RazorWriteMethodParameterAttribute : Attribute /// The attribute must be mentioned in your member reordering patterns /// [AttributeUsage(AttributeTargets.All)] - internal sealed class NoReorder : Attribute + internal sealed class NoReorderAttribute : Attribute { } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/AggregatedData.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/AggregatedData.cs index 8f30f6e..c962733 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/AggregatedData.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/AggregatedData.cs @@ -7,16 +7,16 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses public class AggregatedData { [JsonProperty("FLAGS")] - public string Flags { get; set; } + public string? Flags { get; set; } [JsonProperty("FROMSYMBOL")] - public string BaseSymbol { get; set; } + public string? BaseSymbol { get; set; } [JsonProperty("HIGH24HOUR")] public double? High24Hour { get; set; } [JsonProperty("LASTTRADEID")] - public string LastTradeId { get; set; } + public string? LastTradeId { get; set; } [JsonConverter(typeof(UnixTimeConverter))] [JsonProperty("LASTUPDATE")] @@ -32,7 +32,7 @@ public class AggregatedData public double? Low24Hour { get; set; } [JsonProperty("MARKET")] - public string Market { get; set; } + public string? Market { get; set; } [JsonProperty("OPEN24HOUR")] public double? Open24Hour { get; set; } @@ -41,10 +41,10 @@ public class AggregatedData public double? Price { get; set; } [JsonProperty("TOSYMBOL")] - public string QuoteSymbol { get; set; } + public string? QuoteSymbol { get; set; } [JsonProperty("TYPE")] - public string Type { get; set; } + public string? Type { get; set; } [JsonProperty("VOLUME24HOUR")] public double? Volume24Hour { get; set; } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Calls.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Calls.cs index bf23415..ff13a72 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Calls.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Calls.cs @@ -1,10 +1,9 @@ -#pragma warning disable 8618 -namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses +namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { /// /// Api calls. /// -public class Calls + public class Calls { /// /// Calls to history apis. diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinAggregatedData.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinAggregatedData.cs index d68ea2d..1524981 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinAggregatedData.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinAggregatedData.cs @@ -8,7 +8,7 @@ public class CoinAggregatedData : AggregatedData public double? HighDay { get; set; } [JsonProperty("LASTMARKET")] - public string LastMarket { get; set; } + public string? LastMarket { get; set; } [JsonProperty("LOWDAY")] public double? LowDay { get; set; } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinSnapshotFullData.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinSnapshotFullData.cs index 7d56314..03fa07e 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinSnapshotFullData.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinSnapshotFullData.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Collections.Immutable; using Newtonsoft.Json; using Trakx.CryptoCompare.ApiClient.Rest.Converters; @@ -6,15 +7,15 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { public class CoinSnapshotFullData { - public CoinGeneralInfo General { get; set; } + public CoinGeneralInfo? General { get; set; } - public ICO ICO { get; set; } + public Ico? ICO { get; set; } - public SEO SEO { get; set; } + public Seo? SEO { get; set; } - public IReadOnlyList StreamerDataRaw { get; set; } + public IReadOnlyList StreamerDataRaw { get; set; } = ImmutableList.Empty; [JsonConverter(typeof(StringToSubConverter))] - public IReadOnlyList Subs { get; set; } + public IReadOnlyList Subs { get; set; } = ImmutableList.Empty; } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinSnapshotFullResponse.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinSnapshotFullResponse.cs index fa8c82d..7d70307 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinSnapshotFullResponse.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/CoinSnapshotFullResponse.cs @@ -2,6 +2,6 @@ { public class CoinSnapshotFullResponse : BaseApiResponse { - public CoinSnapshotFullData Data { get; set; } + public CoinSnapshotFullData? Data { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/ICO.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/ICO.cs index defbf68..5ab90a8 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/ICO.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/ICO.cs @@ -5,7 +5,7 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { - public class ICO + public class Ico { public string Blog { get; set; } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MarketCapDisplay.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MarketCapDisplay.cs index 482cd02..e890dd1 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MarketCapDisplay.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MarketCapDisplay.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Collections.ObjectModel; -#pragma warning disable 8618 namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MiningEquipment.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MiningEquipment.cs index 5d32286..e8ea8b5 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MiningEquipment.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MiningEquipment.cs @@ -2,8 +2,8 @@ { public class MiningEquipment : MiningData { - public string EquipmentType { get; set; } + public string? EquipmentType { get; set; } - public string PowerConsumption { get; set; } + public string? PowerConsumption { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MiningEquipmentsResponse.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MiningEquipmentsResponse.cs index 387195a..c513956 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MiningEquipmentsResponse.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/MiningEquipmentsResponse.cs @@ -1,9 +1,10 @@ using System.Collections.Generic; +using System.Collections.Immutable; namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { public class MiningEquipmentsResponse : BaseApiResponse { - public IReadOnlyDictionary MiningData { get; set; } + public IReadOnlyDictionary MiningData { get; set; } = ImmutableDictionary.Empty; } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/PriceAverageResponse.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/PriceAverageResponse.cs index 1b16b88..d75a194 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/PriceAverageResponse.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/PriceAverageResponse.cs @@ -5,9 +5,9 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses public class PriceAverageResponse { [JsonProperty("DISPLAY")] - public CoinFullAggregatedDataDisplay Display { get; set; } + public CoinFullAggregatedDataDisplay? Display { get; set; } [JsonProperty("RAW")] - public CoinFullAggregatedData Raw { get; set; } + public CoinFullAggregatedData? Raw { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/PriceMultiFullResponse.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/PriceMultiFullResponse.cs index dbc60c7..9c9132d 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/PriceMultiFullResponse.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/PriceMultiFullResponse.cs @@ -5,9 +5,9 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses public class PriceMultiFullResponse { [JsonProperty("DISPLAY")] - public PriceMultiFullDisplay Display { get; set; } + public PriceMultiFullDisplay? Display { get; set; } [JsonProperty("RAW")] - public PriceMultiFullRaw Raw { get; set; } + public PriceMultiFullRaw? Raw { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/SEO.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/SEO.cs index eab2218..f665e57 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/SEO.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/SEO.cs @@ -1,19 +1,19 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { - public class SEO + public class Seo { - public string BaseImageUrl { get; set; } + public string? BaseImageUrl { get; set; } - public string BaseUrl { get; set; } + public string? BaseUrl { get; set; } public int OgImageHeight { get; set; } - public string OgImageUrl { get; set; } + public string? OgImageUrl { get; set; } public int OgImageWidth { get; set; } - public string PageDescription { get; set; } + public string? PageDescription { get; set; } - public string PageTitle { get; set; } + public string? PageTitle { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Sub.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Sub.cs index 88c95de..d327f54 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Sub.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/Sub.cs @@ -1,19 +1,19 @@ using System; -using JetBrains.Annotations; using Trakx.CryptoCompare.ApiClient.Rest.Helpers; namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { public readonly struct Sub : IEquatable { - public bool Equals(Sub other) => string.Equals(this.Exchange, other.Exchange) - && string.Equals(this.BaseSymbol, other.BaseSymbol) - && this.SubId == other.SubId - && string.Equals(this.QuoteSymbol, other.QuoteSymbol); + public bool Equals(Sub other) + => string.Equals(this.Exchange, other.Exchange) + && string.Equals(this.BaseSymbol, other.BaseSymbol) + && this.SubId == other.SubId + && string.Equals(this.QuoteSymbol, other.QuoteSymbol); - public override bool Equals(object obj) + public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) + if (obj is null) { return false; } @@ -22,25 +22,18 @@ public override bool Equals(object obj) public override int GetHashCode() { - unchecked - { - var hashCode = this.Exchange.GetHashCode(); - hashCode = (hashCode * 397) ^ this.BaseSymbol.GetHashCode(); - hashCode = (hashCode * 397) ^ (int)this.SubId; - hashCode = (hashCode * 397) ^ this.QuoteSymbol.GetHashCode(); - return hashCode; - } + return HashCode.Combine(Exchange, BaseSymbol, SubId, QuoteSymbol); } - public Sub([NotNull] string exchange, [NotNull] string fromSymbol, SubId subId, [NotNull] string toSymbol) + public Sub(string? exchange, string? fromSymbol, SubId subId, string? toSymbol) { Check.NotNullOrWhiteSpace(exchange, nameof(exchange)); Check.NotNullOrWhiteSpace(fromSymbol, nameof(fromSymbol)); Check.NotNullOrWhiteSpace(toSymbol, nameof(toSymbol)); - this.Exchange = exchange; - this.BaseSymbol = fromSymbol; + this.Exchange = exchange!; + this.BaseSymbol = fromSymbol!; this.SubId = subId; - this.QuoteSymbol = toSymbol; + this.QuoteSymbol = toSymbol!; } public string Exchange { get; } @@ -55,5 +48,15 @@ public override string ToString() { return $"{this.SubId:D}~{this.Exchange}~{this.BaseSymbol}~{this.QuoteSymbol}"; } + + public static bool operator ==(Sub left, Sub right) + { + return left.Equals(right); + } + + public static bool operator !=(Sub left, Sub right) + { + return !(left == right); + } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/SubListResponse.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/SubListResponse.cs index 6eb2c4f..635b9e8 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/SubListResponse.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/SubListResponse.cs @@ -16,12 +16,12 @@ public SubListResponse(IDictionary dictionary) public class SubList { [JsonConverter(typeof(StringToSubConverter))] - public IReadOnlyList Current { get; set; } + public IReadOnlyList? Current { get; set; } [JsonConverter(typeof(StringToSubConverter))] - public Sub CurrentAgg { get; set; } + public Sub? CurrentAgg { get; set; } [JsonConverter(typeof(StringToSubConverter))] - public IReadOnlyList Trades { get; set; } + public IReadOnlyList? Trades { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolume24HInfo.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolume24HInfo.cs index 9b4ae92..b73dd2a 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolume24HInfo.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolume24HInfo.cs @@ -4,12 +4,12 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { public class TopVolume24HInfo { - public CoinInfo CoinInfo { get; set; } + public CoinInfo? CoinInfo { get; set; } [JsonProperty("DISPLAY")] - public Volume24HDisplay Display { get; set; } + public Volume24HDisplay? Display { get; set; } [JsonProperty("RAW")] - public Volume24HRaw Raw { get; set; } + public Volume24HRaw? Raw { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolume24HResponse.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolume24HResponse.cs index ef97b2c..8c7114a 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolume24HResponse.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolume24HResponse.cs @@ -4,6 +4,6 @@ namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { public class TopVolume24HResponse : BaseApiResponse { - public IReadOnlyList Data { get; set; } + public IReadOnlyList? Data { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolumesResponse.cs b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolumesResponse.cs index 1468cd4..cc681c2 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolumesResponse.cs +++ b/src/Trakx.CryptoCompare.ApiClient/Rest/Models/Responses/TopVolumesResponse.cs @@ -1,11 +1,12 @@ using System.Collections.Generic; +using System.Collections.Immutable; namespace Trakx.CryptoCompare.ApiClient.Rest.Models.Responses { public class TopVolumesResponse : BaseApiResponse { - public IReadOnlyList Data { get; set; } + public IReadOnlyList Data { get; set; } = ImmutableList.Empty; - public string VolSymbol { get; set; } + public string? VolSymbol { get; set; } } } diff --git a/src/Trakx.CryptoCompare.ApiClient/ServiceConfiguration.cs b/src/Trakx.CryptoCompare.ApiClient/ServiceConfiguration.cs index c08033e..07ebbd4 100644 --- a/src/Trakx.CryptoCompare.ApiClient/ServiceConfiguration.cs +++ b/src/Trakx.CryptoCompare.ApiClient/ServiceConfiguration.cs @@ -1,5 +1,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Trakx.Common.Configuration; using Trakx.CryptoCompare.ApiClient.Rest; namespace Trakx.CryptoCompare.ApiClient @@ -16,8 +17,7 @@ public static IServiceCollection AddCryptoCompareClient( public static IServiceCollection AddCryptoCompareClient(this IServiceCollection services, IConfiguration configuration) { - var apiConfiguration = configuration.GetSection(nameof(CryptoCompareApiConfiguration)) - .Get(); + var apiConfiguration = configuration.GetConfiguration(); return AddCryptoCompareClient(services, apiConfiguration); } } diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 905ca71..9e179c2 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -10,8 +10,9 @@ - - + + + From d4379cbae6631fb13abdfb7fbf2503cc069f10f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:58:22 +0000 Subject: [PATCH 35/36] chore: Bump trakx/github-actions from 10.0.14 to 10.0.26 (#97) Bumps [trakx/github-actions](https://github.com/trakx/github-actions) from 10.0.14 to 10.0.26. - [Release notes](https://github.com/trakx/github-actions/releases) - [Commits](https://github.com/trakx/github-actions/compare/v10.0.14...v10.0.26) --- updated-dependencies: - dependency-name: trakx/github-actions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Emanuel Gaspar --- .github/workflows/automerge.yml | 2 +- .github/workflows/nuget.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 15efdef..1650f33 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -12,6 +12,6 @@ jobs: if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Merge non major updates - uses: trakx/github-actions/dependabot-automerge@v10.0.14 + uses: trakx/github-actions/dependabot-automerge@v10.0.26 with: githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index bbb7b3b..49f46e6 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -57,7 +57,7 @@ jobs: - name: Build and publish nuget packages id: publish - uses: trakx/github-actions/publish-nuget@v10.0.14 + uses: trakx/github-actions/publish-nuget@v10.0.26 with: packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} githubToken: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6117f96..67de735 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Test and cover solutions id: test - uses: trakx/github-actions/test-dotnet@v10.0.14 + uses: trakx/github-actions/test-dotnet@v10.0.26 with: packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} codacyToken: ${{secrets.CODACY_TOKEN}} From ec6e00804d1831df3365cd0382e61631622bc545 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Thu, 2 Nov 2023 14:50:18 +0000 Subject: [PATCH 36/36] nuget bumps, dependabot is failing --- ...Trakx.CryptoCompare.ApiClient.Tests.csproj | 2 +- ...toCompare.ApiClient.Websocket.Tests.csproj | 2 +- src/Trakx.CryptoCompare.ApiClient.sln | 27 +++++++------------ .../Trakx.CryptoCompare.ApiClient.csproj | 2 +- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj index fa1d776..e169195 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Tests/Trakx.CryptoCompare.ApiClient.Tests.csproj @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj index ac78549..e6d0fb2 100644 --- a/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj +++ b/src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj @@ -23,7 +23,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Trakx.CryptoCompare.ApiClient.sln b/src/Trakx.CryptoCompare.ApiClient.sln index fa6ad03..440779b 100644 --- a/src/Trakx.CryptoCompare.ApiClient.sln +++ b/src/Trakx.CryptoCompare.ApiClient.sln @@ -20,24 +20,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt ..\README.md = ..\README.md EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{6016A446-EAD5-451B-B8C0-EC13794036FB}" - ProjectSection(SolutionItems) = preProject - ..\.github\dependabot.yml = ..\.github\dependabot.yml - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{C1DFC2BD-A633-4692-9196-EBF451A87AE0}" - ProjectSection(SolutionItems) = preProject - ..\.github\workflows\dotnet-core.yml = ..\.github\workflows\dotnet-core.yml - ..\.github\workflows\publish.nuget.yml = ..\.github\workflows\publish.nuget.yml - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Trakx.CryptoCompare.ApiClient", "Trakx.CryptoCompare.ApiClient\Trakx.CryptoCompare.ApiClient.csproj", "{F43EBF54-E0AA-40D4-85AE-BBC8D06825AC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Trakx.CryptoCompare.ApiClient.Tests", "Trakx.CryptoCompare.ApiClient.Tests\Trakx.CryptoCompare.ApiClient.Tests.csproj", "{D370556E-337B-4021-B954-71CE9AD1BCF8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trakx.CryptoCompare.ApiClient.Websocket", "Trakx.CryptoCompare.ApiClient.Websocket\Trakx.CryptoCompare.ApiClient.Websocket.csproj", "{A0FD368B-F4F2-4E0D-87A2-4866900156CE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Trakx.CryptoCompare.ApiClient.Websocket", "Trakx.CryptoCompare.ApiClient.Websocket\Trakx.CryptoCompare.ApiClient.Websocket.csproj", "{A0FD368B-F4F2-4E0D-87A2-4866900156CE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trakx.CryptoCompare.ApiClient.Websocket.Tests", "Trakx.CryptoCompare.ApiClient.Websocket.Tests\Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj", "{4D9E5B67-4B53-4A40-BFFD-5FB07727E0EF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Trakx.CryptoCompare.ApiClient.Websocket.Tests", "Trakx.CryptoCompare.ApiClient.Websocket.Tests\Trakx.CryptoCompare.ApiClient.Websocket.Tests.csproj", "{4D9E5B67-4B53-4A40-BFFD-5FB07727E0EF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C37319D5-EA5F-404D-8BB2-07902D8C1D72}" + ProjectSection(SolutionItems) = preProject + ..\.github\workflows\automerge.yml = ..\.github\workflows\automerge.yml + ..\.github\workflows\delete.packages.yml = ..\.github\workflows\delete.packages.yml + ..\.github\workflows\nuget.yml = ..\.github\workflows\nuget.yml + ..\.github\workflows\test.yml = ..\.github\workflows\test.yml + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -65,10 +62,6 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {6016A446-EAD5-451B-B8C0-EC13794036FB} = {B4B8ECDB-63A4-431A-8313-2D90142033C1} - {C1DFC2BD-A633-4692-9196-EBF451A87AE0} = {6016A446-EAD5-451B-B8C0-EC13794036FB} - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3F131DCD-33E4-47BA-8829-65E49F744112} EndGlobalSection diff --git a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj index 9e179c2..b16d03a 100644 --- a/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj +++ b/src/Trakx.CryptoCompare.ApiClient/Trakx.CryptoCompare.ApiClient.csproj @@ -10,7 +10,7 @@ - +