honeymaker 0.12.3 → 0.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/native-gems.yml +100 -0
  3. data/.github/workflows/release.yml +36 -0
  4. data/.github/workflows/test.yml +19 -4
  5. data/Cargo.lock +1078 -0
  6. data/Cargo.toml +14 -0
  7. data/README.md +39 -0
  8. data/Rakefile +28 -16
  9. data/crates/honeymaker/Cargo.toml +18 -0
  10. data/crates/honeymaker/src/encode.rs +106 -0
  11. data/crates/honeymaker/src/kraken/lookup.rs +140 -0
  12. data/crates/honeymaker/src/kraken/mod.rs +5 -0
  13. data/crates/honeymaker/src/kraken/normalize.rs +536 -0
  14. data/crates/honeymaker/src/kraken/requests.rs +286 -0
  15. data/crates/honeymaker/src/kraken/sign.rs +166 -0
  16. data/crates/honeymaker/src/kraken/trades.rs +201 -0
  17. data/crates/honeymaker/src/lib.rs +10 -0
  18. data/crates/honeymaker/src/num.rs +115 -0
  19. data/crates/honeymaker/src/semantics.rs +100 -0
  20. data/crates/honeymaker/src/types.rs +85 -0
  21. data/crates/honeymaker/tests/kraken_stage2.rs +592 -0
  22. data/crates/honeymaker/tests/kraken_trades_pager.rs +307 -0
  23. data/crates/honeymaker/tests/kraken_vectors.rs +78 -0
  24. data/crates/honeymaker/tests/vectors/decimal.json +146 -0
  25. data/crates/honeymaker/tests/vectors/kraken_add_order_wire.json +74 -0
  26. data/crates/honeymaker/tests/vectors/kraken_signing.json +3314 -0
  27. data/crates/honeymaker/tests/vectors/kraken_trades_pager.json +1583 -0
  28. data/crates/honeymaker-client/Cargo.toml +30 -0
  29. data/crates/honeymaker-client/examples/probe.rs +147 -0
  30. data/crates/honeymaker-client/src/kraken.rs +514 -0
  31. data/crates/honeymaker-client/src/lib.rs +4 -0
  32. data/crates/honeymaker-client/src/transport/connect.rs +583 -0
  33. data/crates/honeymaker-client/src/transport/io_timeout.rs +352 -0
  34. data/crates/honeymaker-client/src/transport/response.rs +169 -0
  35. data/crates/honeymaker-client/src/transport.rs +467 -0
  36. data/crates/honeymaker-client/tests/classification.rs +203 -0
  37. data/crates/honeymaker-client/tests/kraken_client.rs +949 -0
  38. data/crates/honeymaker-client/tests/response.rs +522 -0
  39. data/crates/honeymaker-client/tests/support/mod.rs +550 -0
  40. data/crates/honeymaker-client/tests/transport.rs +828 -0
  41. data/ext/honeymaker_native/Cargo.toml +16 -0
  42. data/ext/honeymaker_native/extconf.rb +6 -0
  43. data/ext/honeymaker_native/src/convert.rs +150 -0
  44. data/ext/honeymaker_native/src/kraken.rs +362 -0
  45. data/ext/honeymaker_native/src/lib.rs +90 -0
  46. data/ext/honeymaker_native/src/ruby_decimal.rs +90 -0
  47. data/lib/honeymaker/clients/bybit.rb +19 -2
  48. data/lib/honeymaker/clients/coinbase.rb +3 -2
  49. data/lib/honeymaker/clients/kraken.rb +6 -1
  50. data/lib/honeymaker/exchanges/coinbase.rb +5 -4
  51. data/lib/honeymaker/native/kraken.rb +263 -0
  52. data/lib/honeymaker/native.rb +42 -0
  53. data/lib/honeymaker/version.rb +1 -1
  54. data/lib/honeymaker.rb +12 -2
  55. data/script/parity/kraken_client_live.rb +191 -0
  56. data/script/parity/kraken_live.rb +70 -0
  57. data/script/parity/kraken_transport.rb +604 -0
  58. data/script/parity/resolve.c +49 -0
  59. data/script/release/push_gems.sh +28 -0
  60. data/script/vectors/kraken.rb +50 -0
  61. data/script/vectors/kraken_stage2.rb +146 -0
  62. data/test/fixtures/coinbase_products.json +1 -1
  63. data/test/honeymaker/clients/bybit_client_test.rb +25 -0
  64. data/test/honeymaker/clients/coinbase_client_test.rb +14 -0
  65. data/test/honeymaker/clients/kraken_client_test.rb +15 -0
  66. data/test/honeymaker/exchanges/coinbase_test.rb +22 -2
  67. data/test/native/backend_switch_test.rb +53 -0
  68. data/test/native/convert_test.rb +137 -0
  69. data/test/native/gem_isolation_test.rb +17 -0
  70. data/test/native/loader_test.rb +29 -0
  71. data/test/native/lockstep_test.rb +23 -0
  72. data/test/native/signing_smoke_test.rb +28 -0
  73. data/test/parity/kraken_client_parity_test.rb +398 -0
  74. data/test/parity/kraken_exchange_parity_test.rb +172 -0
  75. data/test/release/branch_hardening_test.rb +34 -0
  76. data/test/release/push_gems_test.rb +79 -0
  77. data/test/smoke.rb +24 -0
  78. data/test/support/kraken_signing_smoke.rb +21 -0
  79. data/test/support/parity_helper.rb +62 -0
  80. data/test/support/venue_double.rb +100 -0
  81. metadata +84 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2306f41b9132fa6da84591b6ec38ca160a3fd052ef74a0893d3c27f01f64e8f3
4
- data.tar.gz: 40bb6abacd74cfbd7fded2bb0d560700be9be0bf29c4fbf2aa7ab725d816a294
3
+ metadata.gz: 78709a467495784c1d111fff613edd1188ad5a7bee608abff82dbee3fdb5842d
4
+ data.tar.gz: ad8c934dfbe76031ca3c54e74a6e81a79119c0ec489ce415152a56465b8aa234
5
5
  SHA512:
6
- metadata.gz: 326a5af73ef2f8564dda06d0d6f82a3f873d5b05f725d579666ccbb1df42a74603221904190972ac8b7b7fbe74d673898f1bc5e08da799655fd11d3959dfc1a6
7
- data.tar.gz: 1c24efe089db21b89d7c24bd563da3841f5cfd3899c339d5524a3c55970245632bcdf8c36b2f060bbae6bc50e8a2f7e918c87684ba9e7e2e91002cdabf14c31e
6
+ metadata.gz: 0e45cbd2df342d861721818bf52245f23457a170fbbc0cdf464de89d2e82b5c41d2bd1d9c459ebbd019c87a4fce0c56cb87310a449a19afc0df405a09195f61c
7
+ data.tar.gz: 76cecab1382c572bb8a8f1f87ed843737ee40d762a4318031f0723ee5fd67f70ff4920471881101a95f620b2fb7c3fc049b143a997fc1db50a8dfc2e97ea5aba
@@ -0,0 +1,100 @@
1
+ name: Native gems
2
+
3
+ on:
4
+ pull_request:
5
+ paths: ["crates/**", "ext/**", "Cargo.*", "rust-toolchain.toml", "honeymaker.gemspec", "Rakefile",
6
+ "lib/honeymaker/native.rb", "test/smoke.rb", ".github/workflows/native-gems.yml"]
7
+ workflow_call:
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ cross:
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ platform: [x86_64-linux, aarch64-linux, x86_64-darwin, arm64-darwin, x64-mingw-ucrt]
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
22
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
23
+ with:
24
+ ruby-version: "3.4"
25
+ bundler-cache: true
26
+ - uses: oxidize-rb/actions/cross-gem@ec90b4aa48795518d79be3f5cc478d1d7ccd02a8 # v1.5.0
27
+ id: cross
28
+ with:
29
+ platform: ${{ matrix.platform }}
30
+ ruby-versions: "3.4,4.0"
31
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
32
+ with:
33
+ name: gem-${{ matrix.platform }}
34
+ path: ${{ steps.cross.outputs.gem-path }}
35
+
36
+ source:
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
40
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
41
+ with:
42
+ ruby-version: "3.4"
43
+ bundler-cache: true
44
+ - run: bundle exec rake build
45
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
46
+ with:
47
+ name: gem-ruby
48
+ path: pkg/honeymaker-*.gem
49
+
50
+ source-install:
51
+ needs: source
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
55
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
56
+ with:
57
+ ruby-version: "4.0"
58
+ - run: rustup toolchain install 1.94.0 --profile minimal
59
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
60
+ with:
61
+ name: gem-ruby
62
+ path: gems
63
+ - run: gem install --no-document --platform ruby gems/*.gem
64
+ env:
65
+ RUSTUP_TOOLCHAIN: "1.94.0"
66
+ - run: ruby test/smoke.rb
67
+ env:
68
+ EXPECT_PLATFORM: ruby
69
+
70
+ smoke:
71
+ needs: cross
72
+ strategy:
73
+ fail-fast: false
74
+ matrix:
75
+ include:
76
+ - { os: ubuntu-latest, platform: x86_64-linux, ruby: "3.4" }
77
+ - { os: ubuntu-latest, platform: x86_64-linux, ruby: "4.0" }
78
+ - { os: ubuntu-24.04-arm, platform: aarch64-linux, ruby: "3.4" }
79
+ - { os: ubuntu-24.04-arm, platform: aarch64-linux, ruby: "4.0" }
80
+ - { os: macos-15-intel, platform: x86_64-darwin, ruby: "3.4" }
81
+ - { os: macos-15-intel, platform: x86_64-darwin, ruby: "4.0" }
82
+ - { os: macos-14, platform: arm64-darwin, ruby: "3.4" }
83
+ - { os: macos-14, platform: arm64-darwin, ruby: "4.0" }
84
+ - { os: windows-latest, platform: x64-mingw-ucrt, ruby: "3.4" }
85
+ - { os: windows-latest, platform: x64-mingw-ucrt, ruby: "4.0" }
86
+ runs-on: ${{ matrix.os }}
87
+ steps:
88
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
89
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
90
+ with:
91
+ ruby-version: ${{ matrix.ruby }}
92
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
93
+ with:
94
+ name: gem-${{ matrix.platform }}
95
+ path: gems
96
+ - run: gem install --no-document gems/*.gem
97
+ shell: bash
98
+ - run: ruby test/smoke.rb
99
+ env:
100
+ EXPECT_PLATFORM: ${{ matrix.platform }}
@@ -0,0 +1,36 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ gems:
12
+ uses: ./.github/workflows/native-gems.yml
13
+
14
+ publish:
15
+ needs: gems
16
+ runs-on: ubuntu-latest
17
+ environment: rubygems # required reviewer: Jan
18
+ permissions:
19
+ id-token: write
20
+ contents: read
21
+ steps:
22
+ # Checkout cleans the workspace, so it must precede artifact download.
23
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
24
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
25
+ with:
26
+ pattern: gem-*
27
+ merge-multiple: true
28
+ path: gems
29
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
30
+ with:
31
+ ruby-version: "3.4"
32
+ - uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
33
+ with:
34
+ trusted-publisher: true
35
+ - name: Push platform gems first, the source gem last (idempotent)
36
+ run: script/release/push_gems.sh gems "${GITHUB_REF_NAME#v}"
@@ -6,13 +6,28 @@ on:
6
6
  pull_request:
7
7
  branches: [main]
8
8
 
9
+ permissions:
10
+ contents: read
11
+
9
12
  jobs:
10
13
  test:
11
- runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ os: [ubuntu-latest, macos-14]
18
+ ruby: ["3.4", "4.0"]
19
+ runs-on: ${{ matrix.os }}
12
20
  steps:
13
- - uses: actions/checkout@v4
14
- - uses: ruby/setup-ruby@v1
21
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
22
+ - uses: oxidize-rb/actions/setup-ruby-and-rust@ec90b4aa48795518d79be3f5cc478d1d7ccd02a8 # v1.5.0
15
23
  with:
16
- ruby-version: "3.4"
24
+ ruby-version: ${{ matrix.ruby }}
17
25
  bundler-cache: true
26
+ cargo-cache: true
27
+ - run: cargo test --locked -p honeymaker
28
+ - run: cargo test --locked -p honeymaker-client
29
+ - run: cargo clippy --locked -p honeymaker-client --all-targets -- -D warnings
30
+ - run: bundle exec rake compile
18
31
  - run: bundle exec rake test
32
+ env:
33
+ HONEYMAKER_REQUIRE_NATIVE: "1"